InfiniteWall.h
Go to the documentation of this file.
1 // This file is part of the MercuryDPM project (https://www.mercurydpm.org).
2 // Copyright (c), The MercuryDPM Developers Team. All rights reserved.
3 // License: BSD 3-Clause License; see the LICENSE file in the root directory.
4 
9 
10 #ifndef INFINITEWALL_H
11 #define INFINITEWALL_H
12 
13 #include "BaseWall.h"
14 #include "Math/Vector.h"
15 
26 class InfiniteWall final : public BaseWall
27 {
28 public:
29 
33  InfiniteWall();
34 
38  InfiniteWall(const InfiniteWall& w);
39 
43  explicit InfiniteWall(const ParticleSpecies* species);
44 
48  InfiniteWall(Vec3D normal, Vec3D point, const ParticleSpecies* species);
49 
53  InfiniteWall(Vec3D PointA, Vec3D PointB, Vec3D PointC, const ParticleSpecies* species);
54 
58  ~InfiniteWall() override;
59 
63  InfiniteWall* copy() const override;
64 
68  void set(Vec3D normal, Vec3D point);
69 
73  void setNormal(Vec3D normal);
74 
81  void set(Vec3D normal, Mdouble position);
82 
83  using BaseWall::move;
84 
88  Mdouble getDistance(Vec3D position) const;
89 
93  bool getDistanceAndNormal(const BaseParticle& p, Mdouble& distance, Vec3D& normal_return) const override;
94 
98  bool getDistanceNormalOverlapSuperquadric(const SuperQuadricParticle& p, Mdouble& distance, Vec3D& normal_return,
99  Mdouble& overlap) const override;
100 
104  void read(std::istream& is) override;
105 
109  void oldRead(std::istream& is);
110 
114  //void write(std::ostream& os) const override;
115 
119  std::string getName() const override;
120 
124  Vec3D getNormal() const;
125 
129  void createVTK(std::vector<Vec3D>& myPoints) const;
130 
134  void createVTK(std::vector<Vec3D>& myPoints, Vec3D max, Vec3D min) const;
135 
139  void writeVTK(VTKContainer& vtk) const override;
140 
141  Vec3D
142  getFurthestPointSuperQuadric(const Vec3D& normalBodyFixed, const Vec3D& axes, Mdouble eps1, Mdouble eps2) const override;
143 };
144 
145 #endif
#define MERCURYDPM_DEPRECATED
Definition: GeneralDefine.h:16
RowVector3d w
Definition: Matrix_resize_int.cpp:3
float * p
Definition: Tutorial_Map_using.cpp:9
virtual void move(const Vec3D &move)
Moves this BaseInteractable by adding an amount to the position.
Definition: BaseInteractable.cc:193
Definition: BaseParticle.h:33
Basic class for walls.
Definition: BaseWall.h:28
A infinite wall fills the half-space {point: (position_-point)*normal_<=0}.
Definition: InfiniteWall.h:27
void createVTK(std::vector< Vec3D > &myPoints) const
Definition: InfiniteWall.cc:203
Vec3D getNormal() const
Access function for normal.
Definition: InfiniteWall.cc:192
void setNormal(Vec3D normal)
Changes the normal of the InfiniteWall.
Definition: InfiniteWall.cc:106
bool getDistanceAndNormal(const BaseParticle &p, Mdouble &distance, Vec3D &normal_return) const override
Compute the distance from the wall for a given BaseParticle and return if there is a collision....
Definition: InfiniteWall.cc:147
void read(std::istream &is) override
Reads InfiniteWall from a restart file.
Definition: InfiniteWall.cc:159
void set(Vec3D normal, Vec3D point)
Defines a standard wall, given an outward normal vector s.t. normal*x=normal*point for all x of the w...
Definition: InfiniteWall.cc:97
~InfiniteWall() override
Default destructor.
Definition: InfiniteWall.cc:76
Vec3D getFurthestPointSuperQuadric(const Vec3D &normalBodyFixed, const Vec3D &axes, Mdouble eps1, Mdouble eps2) const override
Largely untested, use at your own risk for anything other than ellipsoids.
Definition: InfiniteWall.cc:291
std::string getName() const override
Writes the InfiniteWall to an output stream, usually a restart file.
Definition: InfiniteWall.cc:184
Mdouble getDistance(Vec3D position) const
Returns the distance of the wall to the particle.
Definition: InfiniteWall.cc:130
InfiniteWall * copy() const override
Wall copy method. It calls the copy constructor of this Wall, useful for polymorphism.
Definition: InfiniteWall.cc:84
void writeVTK(VTKContainer &vtk) const override
Definition: InfiniteWall.cc:249
bool getDistanceNormalOverlapSuperquadric(const SuperQuadricParticle &p, Mdouble &distance, Vec3D &normal_return, Mdouble &overlap) const override
Compute the distance from the wall for a given BaseParticle and return if there is a collision....
Definition: InfiniteWall.cc:258
InfiniteWall()
Default constructor, the normal is infinitely long.
Definition: InfiniteWall.cc:13
void oldRead(std::istream &is)
Reads InfiniteWall from an old-style restart file.
Definition: InfiniteWall.cc:169
Definition: ParticleSpecies.h:16
Definition: SuperQuadricParticle.h:36
Definition: Kernel/Math/Vector.h:30
#define min(a, b)
Definition: datatypes.h:22
#define max(a, b)
Definition: datatypes.h:23
void normal(const Vector< double > &x, Vector< double > &normal)
Definition: free_surface_rotation.cc:65
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
Definition: BaseWall.h:17