26 #ifndef TriangulatedWall_H
27 #define TriangulatedWall_H
90 void readVTK(std::string filename);
122 void read(std::istream &is)
override;
127 void write(std::ostream &os)
const override;
132 std::string
getName()
const override;
TriangulatedWall()
Default constructor.
bool getDistanceAndNormal(const BaseParticle &p, Mdouble &distance, Vec3D &normal_return) const
Returns true if contact with the face exists, false if not. If contact exists, then the distance and ...
A TriangulatedWall is a triangulation created from a set of vertices and a n-by-3 connectivity matrix...
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...
void write(std::ostream &os) const override
Writes an TriangulatedWall to an output stream, for example a restart file.
std::vector< Vec3D > vertex_
Struct used to store the properties of a face needed for contact detection.
void read(std::istream &is) override
Reads an TriangulatedWall from an input stream, for example a restart file.
TriangulatedWall & operator=(const TriangulatedWall &other)
void readVTK(std::string filename)
std::vector< BaseInteraction * > getInteractionWith(BaseParticle *p, Mdouble timeStamp, InteractionHandler *interactionHandler) override
Get the interaction between this TriangulatedWall and given BaseParticle at a given time...
std::array< Vec3D *, 3 > vertex
defines the three vertices (anticlockwise direction around the normal)
Container to store Interaction objects.
std::string getName() const override
Returns the name of the object, here the string "TriangulatedWall".
Vec3D normal
face normal (vertices are ordered anticlockwise direction around the normal)
void writeVTK(VTKContainer &vtk) const override
void move(const Vec3D &move) override
Move the TriangulatedWall to a new position, which is a Vec3D from the old position.
std::array< Vec3D, 3 > edgeNormal
For each edge, stores the vector normal to the face normal and the edge direction (vector between the...
std::vector< Face > face_
virtual ~TriangulatedWall()
Destructor.
TriangulatedWall * copy() const override
Wall copy method. It calls the copy constructor of this Wall, useful for polymorphism.
Mdouble getDistance(const Vec3D &otherPosition) const
computes the signed distance to the face in normal direction
Implementation of a 3D vector (by Vitaliy).
std::array< Face *, 3 > neighbor
For each edge, stores the neighboring face (nullptr if none)