|
MeshTriangle implements a triangle whose vertex positions are defined by three particles. More...
#include <MeshTriangle.h>
Public Member Functions | |
MeshTriangle ()=default | |
Default constructor. More... | |
MeshTriangle (const MeshTriangle &other)=default | |
Copy constructor. More... | |
~MeshTriangle () override=default | |
Destructor. More... | |
MeshTriangle * | copy () const override |
Wall copy method. It calls the copy constructor of this Wall, useful for polymorphism. More... | |
std::string | getName () const override |
Returns the name of the object, here the string "MeshTriangle". More... | |
void | read (std::istream &is) override |
Reads an MeshTriangle from an input stream, for example a restart file. More... | |
void | write (std::ostream &os) const override |
Writes an MeshTriangle to an output stream, for example a restart file. More... | |
void | setVertices (Vec3D A, Vec3D B, Vec3D C) |
Sets member variables such that the wall represents a triangle with vertices A, B, C. More... | |
void | setVertices (Vec3D A, Vec3D B, Vec3D C, Vec3D position) |
Same as setVertices(A,B,C), but sets the position explicitly. The position is important when you rotate the wall, as the wall will be rotated around this position. More... | |
void | setVertexVelocities (Vec3D A, Vec3D B, Vec3D C) |
Sets the velocity of the vertex points. More... | |
std::array< Vec3D, 3 > | getVertices () const |
Returns an array of the vertex coordinates. More... | |
Vec3D | getFaceNormal () const |
Returns the face normal. More... | |
Mdouble | getArea () const |
Returns the area of the triangle. More... | |
void | move (const Vec3D &move) override |
void | setVertexIds (unsigned int i, unsigned int j, unsigned int k) |
sets the ids of the vertex particles. Calls retrieveVertexParticles. More... | |
std::array< unsigned int, 3 > | getVertexIds () const |
Returns an array containing the ids of the vertex particles. More... | |
void | writeVTK (VTKContainer &vtk) const override |
BaseInteraction * | getInteractionWith (BaseParticle *p, unsigned timeStamp, InteractionHandler *interactionHandler) override |
void | checkInteractions (InteractionHandler *interactionHandler, unsigned int timeStamp) override |
Checks, if the forces of all interctions should be applied. More... | |
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. If there is a collision, also return the normal vector. More... | |
bool | getDistanceNormalOverlapType (const BaseParticle &p, Mdouble &distance, Vec3D &normal, Mdouble &overlap, unsigned int &type) const |
const Vec3D | getVelocityAtContact (const Vec3D &contact) const override |
Calculates the local velocity at a specified point. More... | |
const Vec3D | getBaricentricWeight (const Vec3D &contact) const |
Calculates the barycentric weight of a specified point. More... | |
void | rotate (const Vec3D &angularVelocity) override |
Rotates this BaseInteractable. More... | |
bool | isLocal (Vec3D &min, Vec3D &max) const override |
Determines if the triangle is considered local. More... | |
bool | isInsideTriangle (const Vec3D &point) const |
Determines if a given point is within the triangle. More... | |
Mdouble | getInvMass () const override |
void | setMass (Mdouble mass) |
void | actionsOnRestart () override |
Actions executed on restart. More... | |
void | actionsAfterParticleGhostUpdate () override |
actionsPerformed after the position update of (ghost-) particles. More... | |
void | handleParticleRemoval (unsigned int id) override |
Handles the removal of particles to the particle Handler. More... | |
void | handleParticleAddition (unsigned int id, BaseParticle *p) override |
Handles the addition of particles to the particle Handler. More... | |
void | retrieveVertexParticles () |
Tries to get pointers to all vertex particles from the handler. More... | |
void | checkActive () |
Check if the triangle is considered active. More... | |
bool | getActive () |
void | setHandler (WallHandler *handler) override |
Set the handler. More... | |
void | applyPressure (Mdouble presure) |
Apply a force pointing in normal direction corresponding to the specified pressure. More... | |
void | applyForce (Vec3D force) |
Apply the given force to the triangle. More... | |
Public Member Functions inherited from BaseWall | |
BaseWall () | |
Default constructor. More... | |
BaseWall (const BaseWall &w) | |
Copy constructor. More... | |
~BaseWall () override | |
Default destructor. More... | |
virtual bool | getDistanceNormalOverlap (const BaseParticle &P, Mdouble &distance, Vec3D &normal_return, Mdouble &overlap) const |
virtual bool | getDistanceNormalOverlapSuperquadric (const SuperQuadricParticle &p, Mdouble &distance, Vec3D &normal_return, Mdouble &overlap) const |
virtual Vec3D | getFurthestPointSuperQuadric (const Vec3D &normalBodyFixed, const Vec3D &axes, Mdouble eps1, Mdouble eps2) const |
WallHandler * | getHandler () const |
A function which returns the WallHandler that handles this BaseWall. More... | |
void | setIndSpecies (unsigned int indSpecies) override |
Define the species of this wall using the index of the species in the SpeciesHandler in this DPMBase. More... | |
void | setSpecies (const ParticleSpecies *species) |
Defines the species of the current wall. More... | |
bool | isFixed () const override |
void | setForceControl (Vec3D forceGoal, Vec3D gainFactor, Vec3D baseVelocity={0, 0, 0}) |
Slowly adjusts the force on a wall towards a specified goal, by adjusting (prescribing) the velocity of the wall. More... | |
bool | getLinePlaneIntersect (Vec3D &intersect, const Vec3D &p0, const Vec3D &p1, const Vec3D &n, const Vec3D &p) |
bool | isInsideWallVTK (const Vec3D &point, const Vec3D &normal, const Vec3D &position) const |
void | projectOntoWallVTK (Vec3D &point0, const Vec3D &point1, const Vec3D &normal, const Vec3D &position) const |
void | intersectVTK (std::vector< Vec3D > &points, Vec3D normal, Vec3D position) const |
virtual BaseInteraction * | getInteractionWithSuperQuad (SuperQuadricParticle *p, unsigned timeStamp, InteractionHandler *interactionHandler) |
void | getVTK (std::vector< Vec3D > &points, std::vector< std::vector< double >> &triangleStrips) |
const Vec3D | getAxis () const |
bool | getVTKVisibility () const |
void | setVTKVisibility (bool vtkVisibility) |
void | addRenderedWall (BaseWall *w) |
BaseWall * | getRenderedWall (size_t i) const |
std::vector< BaseWall * > | getRenderedWalls () const |
void | removeRenderedWalls () |
void | renderWall (VTKContainer &vtk) |
void | addParticlesAtWall (unsigned numElements=50) |
void | setVelocityControl (Vec3D forceGoal, Vec3D gainFactor, Vec3D baseVelocity) |
virtual void | writeWallDetailsVTK (VTKData &data) const |
virtual void | computeWear () |
Public Member Functions inherited from BaseInteractable | |
BaseInteractable () | |
Default BaseInteractable constructor. More... | |
BaseInteractable (const BaseInteractable &p) | |
Copy constructor. More... | |
~BaseInteractable () override | |
Destructor, it simply destructs the BaseInteractable and all the objects it contains. More... | |
unsigned int | getIndSpecies () const |
Returns the index of the species associated with the interactable object. More... | |
const ParticleSpecies * | getSpecies () const |
Returns a pointer to the species of this BaseInteractable. More... | |
void | setSpecies (const ParticleSpecies *species) |
Sets the species of this BaseInteractable. More... | |
const Vec3D & | getForce () const |
Returns the force on this BaseInteractable. More... | |
const Vec3D & | getTorque () const |
Returns the torque on this BaseInteractable. More... | |
void | setForce (const Vec3D &force) |
Sets the force on this BaseInteractable. More... | |
void | setTorque (const Vec3D &torque) |
Sets the torque on this BaseInteractable. More... | |
void | addForce (const Vec3D &addForce) |
Adds an amount to the force on this BaseInteractable. More... | |
void | addTorque (const Vec3D &addTorque) |
Adds an amount to the torque on this BaseInteractable. More... | |
virtual void | resetForceTorque (int numberOfOMPthreads) |
void | sumForceTorqueOMP () |
const Vec3D & | getPosition () const |
Returns the position of this BaseInteractable. More... | |
const Quaternion & | getOrientation () const |
Returns the orientation of this BaseInteractable. More... | |
virtual void | setPosition (const Vec3D &position) |
Sets the position of this BaseInteractable. More... | |
void | setOrientationViaNormal (Vec3D normal) |
Sets the orientation of this BaseInteractable by defining the vector that results from the rotation of the (1,0,0) vector. More... | |
void | setOrientationViaEuler (Vec3D eulerAngle) |
Sets the orientation of this BaseInteractable by defining the euler angles. More... | |
virtual void | setOrientation (const Quaternion &orientation) |
Sets the orientation of this BaseInteractable. More... | |
const std::vector< BaseInteraction * > & | getInteractions () const |
Returns a list of interactions which belong to this interactable. More... | |
void | addInteraction (BaseInteraction *I) |
Adds an interaction to this BaseInteractable. More... | |
bool | removeInteraction (BaseInteraction *I) |
Removes an interaction from this BaseInteractable. More... | |
void | copyInteractionsForPeriodicParticles (const BaseInteractable &p) |
Copies interactions to this BaseInteractable whenever a periodic copy made. More... | |
void | setVelocity (const Vec3D &velocity) |
set the velocity of the BaseInteractable. More... | |
void | setAngularVelocity (const Vec3D &angularVelocity) |
set the angular velocity of the BaseInteractble. More... | |
void | addVelocity (const Vec3D &velocity) |
adds an increment to the velocity. More... | |
void | addAngularVelocity (const Vec3D &angularVelocity) |
add an increment to the angular velocity. More... | |
virtual const Vec3D & | getVelocity () const |
Returns the velocity of this interactable. More... | |
virtual const Vec3D & | getAngularVelocity () const |
Returns the angular velocity of this interactable. More... | |
void | setPrescribedPosition (const std::function< Vec3D(double)> &prescribedPosition) |
Allows the position of an infinite mass interactable to be prescribed. More... | |
void | applyPrescribedPosition (double time) |
Computes the position from the user defined prescribed position function. More... | |
void | setPrescribedVelocity (const std::function< Vec3D(double)> &prescribedVelocity) |
Allows the velocity of an infinite mass interactable to be prescribed. More... | |
void | applyPrescribedVelocity (double time) |
Computes the velocity from the user defined prescribed velocity function. More... | |
void | setPrescribedOrientation (const std::function< Quaternion(double)> &prescribedOrientation) |
Allows the orientation of the infinite mass interactbale to be prescribed. More... | |
void | applyPrescribedOrientation (double time) |
Computes the orientation from the user defined prescribed orientation function. More... | |
void | setPrescribedAngularVelocity (const std::function< Vec3D(double)> &prescribedAngularVelocity) |
Allows the angular velocity of the infinite mass interactable to be prescribed. More... | |
void | applyPrescribedAngularVelocity (double time) |
Computes the angular velocity from the user defined prescribed angular velocity. More... | |
void | integrateBeforeForceComputation (double time, double timeStep) |
This is part of integrate routine for objects with infinite mass. More... | |
void | integrateAfterForceComputation (double time, double timeStep) |
This is part of the integration routine for objects with infinite mass. More... | |
virtual Mdouble | getCurvature (const Vec3D &labFixedCoordinates) const |
virtual bool | isFaceContact (const Vec3D &normal) const |
Public Member Functions inherited from BaseObject | |
BaseObject ()=default | |
Default constructor. More... | |
BaseObject (const BaseObject &p)=default | |
Copy constructor, copies all the objects BaseObject contains. More... | |
virtual | ~BaseObject ()=default |
virtual destructor More... | |
virtual void | moveInHandler (unsigned int index) |
Except that it is virtual, it does the same thing as setIndex() does. More... | |
void | setIndex (unsigned int index) |
Allows one to assign an index to an object in the handler/container. More... | |
void | setId (unsigned long id) |
Assigns a unique identifier to each object in the handler (container) which remains constant even after the object is deleted from the container/handler. More... | |
unsigned int | getIndex () const |
Returns the index of the object in the handler. More... | |
unsigned int | getId () const |
Returns the unique identifier of any particular object. More... | |
void | setGroupId (unsigned groupId) |
unsigned | getGroupId () const |
Public Attributes | |
std::array< MeshTriangle *, 3 > | neighbor = {{nullptr}} |
std::vector< std::vector< unsigned int > > | vertexNeighbors |
Private Member Functions | |
void | updateVertexAndNormal () |
Update vertexMin_, vertexMax_ and faceNormal_ for an updated position. More... | |
void | updateVerticesFromParticles () |
Retrieve new positions from updated vertex particles. More... | |
Private Attributes | |
std::array< Vec3D, 3 > | vertex_ |
std::array< Vec3D, 3 > | vertexVelocity_ |
std::array< BaseParticle *, 3 > | vertexParticle_ = {{nullptr}} |
Vec3D | vertexMin_ |
Vec3D | vertexMax_ |
std::array< Vec3D, 3 > | edgeNormal_ |
std::array< Vec3D, 3 > | edge_ |
std::array< unsigned int, 3 > | vertexIds_ |
std::array< double, 3 > | edgeLength_ |
Vec3D | faceNormal_ |
Mdouble | area_ |
Mdouble | invMass_ = 0.0 |
bool | isActive = 0 |
Additional Inherited Members | |
Static Public Member Functions inherited from BaseWall | |
static void | addToVTK (const std::vector< Vec3D > &points, VTKContainer &vtk) |
Takes the points provided and adds a triangle strip connecting these points to the vtk container. More... | |
MeshTriangle implements a triangle whose vertex positions are defined by three particles.
It tracks the movement of the specified particles and updates its own potition every timestep. If neighboring objects along the edges and vertices are known, their contacts will be taken into account to consider if particle contacts should produce a force. Calculated contact forces will be transferred to the certex particles.
A triangle may e.g. be constructed with the following code.
For a longer example, please have a look at the class Membrane.
|
default |
Default constructor.
Referenced by copy().
|
default |
Copy constructor.
|
overridedefault |
Destructor.
|
overridevirtual |
actionsPerformed after the position update of (ghost-) particles.
After the particles get new positions, these need to be retrived to update the triangle.
Reimplemented from BaseWall.
References updateVerticesFromParticles().
Referenced by Membrane::buildMesh().
|
overridevirtual |
Actions executed on restart.
On restart, try to get all vertex particle pointers.
Reimplemented from BaseWall.
References retrieveVertexParticles().
void MeshTriangle::applyForce | ( | Vec3D | force | ) |
Apply the given force to the triangle.
[in] | force |
Applies a given force to the triangle, by splitting it between the vertex particles.
References isActive, and vertexParticle_.
void MeshTriangle::applyPressure | ( | Mdouble | pressure | ) |
Apply a force pointing in normal direction corresponding to the specified pressure.
[in] | pressure | The pressure value in units of 1 Pa |
Calculates the force acting on the triangle using the pressure and the triangles surface area. Applies the force to the vertex particles.
References getArea(), getFaceNormal(), isActive, and vertexParticle_.
void MeshTriangle::checkActive | ( | ) |
Check if the triangle is considered active.
Checks if the triangle is active. A triangle is considered active, if pointers to all references are known.
References isActive, and vertexParticle_.
Referenced by handleParticleAddition(), read(), retrieveVertexParticles(), and updateVerticesFromParticles().
|
overridevirtual |
Checks, if the forces of all interctions should be applied.
[in] | interactionHandler | Pointer to InteractionHandler that contains all the interactions. |
[in] | timeStamp | The time at which we want to look at the interactions. |
Determine, if a contact os valid, i.e. that the forces due to this contact should be applied to both the particle in the wall. The evaluation is done by looking at the interaction a specific particle has with the current wall as well as neighboring walls. If a particle has multiple contacts, the selection criteria noted in doi:10.1002/nme.4487 are applied. Note: At this time this leads to issues when the particles are much bigger than the triangles.
Reimplemented from BaseWall.
References BaseInteractable::addForce(), BaseInteractable::addTorque(), Vec3D::cross(), getBaricentricWeight(), Vec3D::getComponent(), InteractionHandler::getExistingInteraction(), BaseWall::getHandler(), BaseInteractable::getInteractions(), BaseHandler< T >::getObjectById(), constants::i, logger, neighbor, vertexNeighbors, vertexParticle_, and WARN.
|
inlineoverridevirtual |
Wall copy method. It calls the copy constructor of this Wall, useful for polymorphism.
Implements BaseWall.
References MeshTriangle().
|
inline |
Returns the area of the triangle.
References area_.
Referenced by applyPressure(), Membrane::buildMesh(), and Membrane::initializeEdgeBendingQuantities().
Calculates the barycentric weight of a specified point.
[in] | contact | The point, at which the weights should be calculated. |
Calculates baricentric weight of a given point in the triangle
References area_, Vec3D::cross(), Vec3D::dot(), getFaceNormal(), vertex_, Vec3D::X, Vec3D::Y, and Vec3D::Z.
Referenced by checkInteractions(), getVelocityAtContact(), and isInsideTriangle().
|
overridevirtual |
Compute the distance from the wall for a given BaseParticle and return if there is a collision. If there is a collision, also return the normal vector.
[in] | p | BaseParticle we want to calculate the distance and whether it collided of. |
[out] | distance | The distance of the BaseParticle to this wall. |
[out] | normal_return | If there was a collision, the normal vector to this wall will be placed here. |
This function computes whether or not there is a collision between a given BaseParticle and this MeshTriangle. If there is a collision, this function also computes the distance between the BaseParticle and MeshTriangle and the normal of the MeshTriangle at the intersection point. It does this by calling MeshTriangle::getDistanceNormalOverlapType. Since this function should be called before calculating any Particle-Wall interactions, it can also be used to set the normal vector in case of curved walls.
Implements BaseWall.
References getDistanceNormalOverlapType(), and isActive.
bool MeshTriangle::getDistanceNormalOverlapType | ( | const BaseParticle & | p, |
Mdouble & | distance, | ||
Vec3D & | normal, | ||
Mdouble & | overlap, | ||
unsigned int & | type | ||
) | const |
[in] | p | BaseParticle we want to calculate the distance and whether it collided of. |
[out] | distance | The distance of the BaseParticle to this wall. |
[out] | normal_return | If there was a collision, the normal vector to this wall will be placed here. |
[out] | overlap_return | If there was a collision, the overlap will be placed here. |
[out] | type_return | If there was a collision, the contact type will be placed here. |
This function computes whether or not there is a collision between a given BaseParticle and this MeshTriangle. If there is a collision, this function also computes the distance between the BaseParticle and MeshTriangle and the normal of the MeshTriangle at the intersection point as well as the contact overlap and type. The type is set to the following: 0: face contact 1, 2, 3: contact with type-1th edge 4, 5, 6; contact with the type-4th vertex
References Vec3D::dot(), edge_, edgeLength_, edgeNormal_, faceNormal_, BaseObject::getId(), Vec3D::getLength(), BaseInteractable::getPosition(), BaseParticle::getRadius(), BaseParticle::getWallInteractionRadius(), isActive, isInsideTriangle(), neighbor, vertex_, vertexIds_, and vertexNeighbors.
Referenced by getDistanceAndNormal(), and getInteractionWith().
|
inline |
Returns the face normal.
References faceNormal_.
Referenced by applyPressure(), and getBaricentricWeight().
|
overridevirtual |
[in] | p | Pointer to the BaseParticle which we want to check the interaction for. |
[in] | timeStamp | The time at which we want to look at the interaction. |
[in] | interactionHandler | A pointer to the InteractionHandler in which the interaction can be found. |
It is determined, if there is any contact between the particle and the triangular wall. If a contact exists, all neccesary quantities are determined and set. This includes the contact type is determined (corner, edge or face contact, see laos doi:10.1002/nme.4487) and set with setMultiContactIdentifier.
Reimplemented from BaseWall.
References DEBUG, ERROR, BaseInteraction::getContactPoint(), getDistanceNormalOverlapType(), BaseObject::getGroupId(), BaseObject::getId(), InteractionHandler::getInteraction(), BaseInteractable::getInteractions(), BaseWall::getInteractionWith(), BaseParticle::getName(), BaseInteraction::getNormal(), BaseInteraction::getOverlap(), BaseInteractable::getPosition(), BaseParticle::getRadius(), isActive, BaseParticle::isSphericalParticle(), logger, BaseInteraction::setContactPoint(), BaseInteraction::setDistance(), BaseInteraction::setMultiContactIdentifier(), BaseInteraction::setNormal(), BaseInteraction::setOverlap(), BaseInteraction::setWallInteraction(), and vertexIds_.
|
overridevirtual |
returns the inverse mass. This value is zero for walls and gets overridden for particles that have finite mass
Reimplemented from BaseInteractable.
References invMass_.
|
inlineoverridevirtual |
Returns the name of the object, here the string "MeshTriangle".
Implements BaseObject.
Calculates the local velocity at a specified point.
[in] | contact | The point, at which the velocity should be determined. |
Calculates the velocity at the contact position by interpolating the velocity of the triangle nodes using barycentric coordinates.
Reimplemented from BaseInteractable.
References getBaricentricWeight(), vertexVelocity_, Vec3D::x(), Vec3D::y(), and Vec3D::z().
|
inline |
Returns an array containing the ids of the vertex particles.
References vertexIds_.
Referenced by Membrane::initializeEdgeBendingQuantities(), and Membrane::updateFaceNeighbors().
|
inline |
|
overridevirtual |
Handles the addition of particles to the particle Handler.
[in] | id | The id of the added particle |
[in] | p | Pointer to the particle |
If thie given id is equal to one of the vertex Particles, the reference is added. If this added particle makes the triangle active, the vertex positions are uodated using updateVerticesFromParticles().
Reimplemented from BaseWall.
References checkActive(), constants::i, updateVerticesFromParticles(), vertexIds_, and vertexParticle_.
|
overridevirtual |
Handles the removal of particles to the particle Handler.
[in] | id | The id of the removed particle |
If the given id is equal to one of the vertexParticles, the reference to that particle is removed and the triangle is set inactive
Reimplemented from BaseWall.
References constants::i, isActive, vertexIds_, and vertexParticle_.
Determines if a given point is within the triangle.
[in] | point | Position to check |
References getBaricentricWeight(), Vec3D::X, Vec3D::Y, and Vec3D::Z.
Referenced by getDistanceNormalOverlapType().
Determines if the triangle is considered local.
[out] | min | the minimum of the triangle in all directions. |
[out] | max | the maximum of the triangle in all directions |
Reimplemented from BaseWall.
References vertexMax_, and vertexMin_.
|
overridevirtual |
Moves (displaces) the interacable a given distance. Note, this just updates the position by the move.
[in] | move | Reference to Vec3D which is the distance to move the interactable. |
Reimplemented from BaseInteractable.
References BaseInteractable::move(), and updateVertexAndNormal().
|
overridevirtual |
Reads an MeshTriangle from an input stream, for example a restart file.
[in] | is | The input stream from which the MeshTriangle is read, usually a restart file. |
Reimplemented from BaseWall.
References checkActive(), constants::i, invMass_, isActive, BaseWall::read(), updateVertexAndNormal(), vertex_, vertexIds_, and vertexNeighbors.
void MeshTriangle::retrieveVertexParticles | ( | ) |
Tries to get pointers to all vertex particles from the handler.
Tries to get the pointer to the vertex particles from the particleHandler. Afterwards it checks if the triangle is active and updates the vertex positions.
References checkActive(), BaseHandler< T >::getDPMBase(), BaseWall::getHandler(), BaseHandler< T >::getObjectById(), constants::i, DPMBase::particleHandler, updateVerticesFromParticles(), vertexIds_, and vertexParticle_.
Referenced by actionsOnRestart(), setHandler(), and setVertexIds().
|
overridevirtual |
Rotates this BaseInteractable.
Rotates the interacable a given solid angle. Note, this just updates the orientation by the angle.
This function has been declared virtual, so it can be overridden for IntersectionOfWalls.
[in] | angularVelocityDt | Reference to Vec3D which is the solid angle through which the interactable is rotated. |
Reimplemented from BaseInteractable.
References Vec3D::isZero(), BaseInteractable::rotate(), and updateVertexAndNormal().
|
overridevirtual |
Set the handler.
[in] | handler | Pointer to the wallHandler. |
Sets the wall handler and calls retrieveVertexParticles
Reimplemented from BaseWall.
References BaseHandler< T >::getDPMBase(), ParticleHandler::getNumberOfObjects(), DPMBase::particleHandler, retrieveVertexParticles(), and BaseWall::setHandler().
void MeshTriangle::setMass | ( | Mdouble | mass | ) |
[in] | mass | Value of the mass assigned to the triangle. |
The mass is neccesary for contact force determination. If not given, infinite mass is assumed.
References invMass_, and logger.
Referenced by Membrane::buildMesh().
void MeshTriangle::setVertexIds | ( | unsigned int | i, |
unsigned int | j, | ||
unsigned int | k | ||
) |
sets the ids of the vertex particles. Calls retrieveVertexParticles.
[in] | i,j,k | The ids of the particles representing the corners. |
References constants::i, retrieveVertexParticles(), and vertexIds_.
Referenced by Membrane::buildMesh().
Sets the velocity of the vertex points.
References A, and vertexVelocity_.
Referenced by updateVerticesFromParticles().
Sets member variables such that the wall represents a triangle with vertices A, B, C.
References A.
Referenced by Membrane::buildMesh(), and updateVerticesFromParticles().
Same as setVertices(A,B,C), but sets the position explicitly. The position is important when you rotate the wall, as the wall will be rotated around this position.
References A, BaseInteractable::setOrientation(), BaseInteractable::setPosition(), updateVertexAndNormal(), and vertex_.
|
private |
Update vertexMin_, vertexMax_ and faceNormal_ for an updated position.
This function should be called after setting either position_ or vertexInLabFrame_.
References area_, Vec3D::cross(), edge_, edgeLength_, edgeNormal_, faceNormal_, Vec3D::getLength(), constants::i, logger, Vec3D::max(), Vec3D::min(), Vec3D::normalise(), vertex_, vertexMax_, and vertexMin_.
Referenced by move(), read(), rotate(), and setVertices().
|
private |
Retrieve new positions from updated vertex particles.
Update the triangle position and velocity based on the vertex particles, if the triangle is active.
References checkActive(), BaseInteractable::getPosition(), BaseInteractable::getVelocity(), isActive, setVertexVelocities(), setVertices(), and vertexParticle_.
Referenced by actionsAfterParticleGhostUpdate(), handleParticleAddition(), and retrieveVertexParticles().
|
overridevirtual |
Writes an MeshTriangle to an output stream, for example a restart file.
[in] | os | The output stream where the MeshTriangle must be written to, usually a restart file. |
Reimplemented from BaseWall.
References constants::i, invMass_, isActive, vertex_, vertexIds_, vertexNeighbors, and BaseWall::write().
|
overridevirtual |
adds extra information to the points and triangleStrips vectors needed to plot the wall in vtk format
points | Coordinates of the vertices of the triangulated surfaces (in the VTK file this is called POINTS) |
triangleStrips | Indices of three vertices forming one triangulated surface (in the VTK file this is called CELL) |
Reimplemented from BaseWall.
References isActive, VTKContainer::points, VTKContainer::triangleStrips, and vertex_.
|
private |
Referenced by getArea(), getBaricentricWeight(), and updateVertexAndNormal().
|
private |
Referenced by getDistanceNormalOverlapType(), and updateVertexAndNormal().
|
private |
Referenced by getDistanceNormalOverlapType(), and updateVertexAndNormal().
|
private |
stores the wall normal n in n.x=p
Referenced by getDistanceNormalOverlapType(), and updateVertexAndNormal().
|
private |
stores the face normal, not rotated into the lab frame; thus, if the wall rotates, this normal has to be rotated as well
Referenced by getDistanceNormalOverlapType(), getFaceNormal(), and updateVertexAndNormal().
|
private |
Referenced by getInvMass(), read(), setMass(), and write().
|
private |
std::array<MeshTriangle*, 3> MeshTriangle::neighbor = {{nullptr}} |
stores references to the neighbors along the edges.
Referenced by checkInteractions(), getDistanceNormalOverlapType(), and Membrane::updateFaceNeighbors().
|
private |
stores the position of the vertices relative to the position of the wall but not rotated into the lab frame; thus, if the wall rotates, these vertices have to be rotated as well
Referenced by getBaricentricWeight(), getDistanceNormalOverlapType(), getVertices(), read(), setVertices(), updateVertexAndNormal(), write(), and writeVTK().
|
private |
|
private |
Referenced by isLocal(), and updateVertexAndNormal().
|
private |
stores the min and max coordinate values of the vertices (needed for hGrid)
Referenced by isLocal(), and updateVertexAndNormal().
std::vector<std::vector<unsigned int> > MeshTriangle::vertexNeighbors |
stores references to the neighbors on corners.
Referenced by checkInteractions(), getDistanceNormalOverlapType(), read(), Membrane::updateFaceNeighbors(), and write().
|
private |
|
private |
Referenced by getVelocityAtContact(), and setVertexVelocities().