26 #ifndef MeshTriangle_H
27 #define MeshTriangle_H
104 {
return "MeshTriangle"; }
109 void read(std::istream& is)
override;
114 void write(std::ostream& os)
const override;
155 void setVertexIds(
unsigned int i,
unsigned int j,
unsigned int k);
191 void rotate(
const Vec3D& angularVelocity)
override;
257 std::array<MeshTriangle*, 3>
neighbor = {{
nullptr}};
double Mdouble
Definition: GeneralDefine.h:34
@ A
Definition: StatisticsVector.h:42
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:60
Definition: BaseParticle.h:54
Basic class for walls.
Definition: BaseWall.h:49
Container to store Interaction objects.
Definition: InteractionHandler.h:45
MeshTriangle implements a triangle whose vertex positions are defined by three particles.
Definition: MeshTriangle.h:75
std::array< Vec3D, 3 > getVertices() const
Returns an array of the vertex coordinates.
Definition: MeshTriangle.h:137
void read(std::istream &is) override
Reads an MeshTriangle from an input stream, for example a restart file.
Definition: MeshTriangle.cc:354
std::vector< std::vector< unsigned int > > vertexNeighbors
Definition: MeshTriangle.h:262
std::array< Vec3D, 3 > vertex_
Definition: MeshTriangle.h:280
void checkInteractions(InteractionHandler *interactionHandler, unsigned int timeStamp) override
Checks, if the forces of all interctions should be applied.
Definition: MeshTriangle.cc:110
const Vec3D getVelocityAtContact(const Vec3D &contact) const override
Calculates the local velocity at a specified point.
Definition: MeshTriangle.cc:315
void setMass(Mdouble mass)
Definition: MeshTriangle.cc:681
Vec3D faceNormal_
Definition: MeshTriangle.h:303
void setVertexVelocities(Vec3D A, Vec3D B, Vec3D C)
Sets the velocity of the vertex points.
Definition: MeshTriangle.cc:471
Mdouble getInvMass() const override
Definition: MeshTriangle.cc:671
Mdouble getArea() const
Returns the area of the triangle.
Definition: MeshTriangle.h:147
MeshTriangle(const MeshTriangle &other)=default
Copy constructor.
void handleParticleAddition(unsigned int id, BaseParticle *p) override
Handles the addition of particles to the particle Handler.
Definition: MeshTriangle.cc:545
BaseInteraction * getInteractionWith(BaseParticle *p, unsigned timeStamp, InteractionHandler *interactionHandler) override
Definition: MeshTriangle.cc:48
void setHandler(WallHandler *handler) override
Set the handler.
Definition: MeshTriangle.cc:493
void rotate(const Vec3D &angularVelocity) override
Rotates this BaseInteractable.
Definition: MeshTriangle.cc:342
std::array< unsigned int, 3 > getVertexIds() const
Returns an array containing the ids of the vertex particles.
Definition: MeshTriangle.h:160
void write(std::ostream &os) const override
Writes an MeshTriangle to an output stream, for example a restart file.
Definition: MeshTriangle.cc:403
std::array< MeshTriangle *, 3 > neighbor
Definition: MeshTriangle.h:257
std::array< Vec3D, 3 > vertexVelocity_
Definition: MeshTriangle.h:281
const Vec3D getBaricentricWeight(const Vec3D &contact) const
Calculates the barycentric weight of a specified point.
Definition: MeshTriangle.cc:326
Vec3D vertexMin_
Definition: MeshTriangle.h:287
std::array< unsigned int, 3 > vertexIds_
Definition: MeshTriangle.h:296
bool isActive
Definition: MeshTriangle.h:309
void retrieveVertexParticles()
Tries to get pointers to all vertex particles from the handler.
Definition: MeshTriangle.cc:563
Vec3D vertexMax_
Definition: MeshTriangle.h:288
bool getDistanceNormalOverlapType(const BaseParticle &p, Mdouble &distance, Vec3D &normal, Mdouble &overlap, unsigned int &type) const
Definition: MeshTriangle.cc:225
std::array< double, 3 > edgeLength_
Definition: MeshTriangle.h:297
void applyPressure(Mdouble presure)
Apply a force pointing in normal direction corresponding to the specified pressure.
Definition: MeshTriangle.cc:694
bool isInsideTriangle(const Vec3D &point) const
Determines if a given point is within the triangle.
Definition: MeshTriangle.cc:660
void actionsOnRestart() override
Actions executed on restart.
Definition: MeshTriangle.cc:589
void updateVerticesFromParticles()
Retrieve new positions from updated vertex particles.
Definition: MeshTriangle.cc:510
std::array< Vec3D, 3 > edgeNormal_
Definition: MeshTriangle.h:293
void handleParticleRemoval(unsigned int id) override
Handles the removal of particles to the particle Handler.
Definition: MeshTriangle.cc:525
MeshTriangle * copy() const override
Wall copy method. It calls the copy constructor of this Wall, useful for polymorphism.
Definition: MeshTriangle.h:97
bool isLocal(Vec3D &min, Vec3D &max) const override
Determines if the triangle is considered local.
Definition: MeshTriangle.cc:649
void checkActive()
Check if the triangle is considered active.
Definition: MeshTriangle.cc:581
bool getActive()
Definition: MeshTriangle.h:236
std::array< BaseParticle *, 3 > vertexParticle_
Definition: MeshTriangle.h:282
void actionsAfterParticleGhostUpdate() override
actionsPerformed after the position update of (ghost-) particles.
Definition: MeshTriangle.cc:599
std::string getName() const override
Returns the name of the object, here the string "MeshTriangle".
Definition: MeshTriangle.h:103
void applyForce(Vec3D force)
Apply the given force to the triangle.
Definition: MeshTriangle.cc:713
Mdouble area_
Definition: MeshTriangle.h:304
void setVertices(Vec3D A, Vec3D B, Vec3D C)
Sets member variables such that the wall represents a triangle with vertices A, B,...
Definition: MeshTriangle.cc:456
void updateVertexAndNormal()
Update vertexMin_, vertexMax_ and faceNormal_ for an updated position.
Definition: MeshTriangle.cc:622
~MeshTriangle() override=default
Destructor.
void setVertexIds(unsigned int i, unsigned int j, unsigned int k)
sets the ids of the vertex particles. Calls retrieveVertexParticles.
Definition: MeshTriangle.cc:481
MeshTriangle()=default
Default constructor.
void move(const Vec3D &move) override
Definition: MeshTriangle.cc:610
std::array< Vec3D, 3 > edge_
Definition: MeshTriangle.h:294
Mdouble invMass_
Definition: MeshTriangle.h:307
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: MeshTriangle.cc:199
Vec3D getFaceNormal() const
Returns the face normal.
Definition: MeshTriangle.h:142
void writeVTK(VTKContainer &vtk) const override
Definition: MeshTriangle.cc:438
Container to store all BaseWall.
Definition: WallHandler.h:44
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
Definition: BaseWall.h:38