|
#include <Membrane.h>
Public Member Functions | |
void | applyForce (Mdouble Kn, Mdouble critDampCoeff, Mdouble Ke, Mdouble Kd, bool bendingAreaConstant) |
Calculates and applies all neccesary forces. More... | |
void | applyStretchForce (Mdouble Kn, Mdouble critDampCoeff) |
Apply the force due to stretching only. More... | |
void | applyBendForce (Mdouble Kn, Mdouble Kd, bool bendingAreaConstant) |
Apply a force due to bending. More... | |
void | calculateUPre (Vec3D &state, Mdouble &length, std::array< Mdouble, 2 > &faceArea) |
Calculate some prefactors for the bending penalty. More... | |
Mdouble | getSineHalfTheta () |
Calculate the sine of half the bending angle. More... | |
void | handleParticleRemoval (unsigned int id) |
handle the partical removal More... | |
void | handleParticleAddition (unsigned int id, BaseParticle *p) |
Handle the particle addition. More... | |
void | checkActive () |
check if the edge should calculate bending or stretch forces More... | |
Public Attributes | |
std::array< unsigned int, 2 > | vertexId |
std::array< BaseParticle *, 2 > | vertex = {{nullptr}} |
std::array< unsigned int, 2 > | faceVertexId |
std::array< BaseParticle *, 2 > | faceVertex = {{nullptr}} |
std::array< MeshTriangle *, 2 > | face = {{nullptr}} |
std::array< Mdouble, 2 > | faceInitialArea |
std::array< Mdouble, 8 > | uPre |
Vec3D | initialState |
Mdouble | initialLength |
Mdouble | initialSineHalfTheta |
Mdouble | effectiveMass |
bool | isStretchActive |
bool | isBendActive |
A struct containing the information needed for calculations along one edge
Apply a force due to bending.
[in] | Ke | The spring constant used for bending. |
[in] | Kn | The dissipation constant used for bending. |
This function applies the forces due to bending of the triangles connected by the edge. The calculation is based on the model described in doi:10.1109/SIBGRAPI.2014.20.
References Vec3D::dot(), Vec3D::getLength(), and constants::i.
Referenced by applyForce().
void Membrane::Edge::applyForce | ( | Mdouble | Kn, |
Mdouble | critDampCoeff, | ||
Mdouble | Ke, | ||
Mdouble | Kd, | ||
bool | bendingAreaConstant | ||
) |
Calculates and applies all neccesary forces.
[in] | Kn | The spring constant used for stretching. |
[in] | critDampCoeff | The critical damping coefficient used for stretching. |
[in] | Ke | The spring constant used for bending. |
[in] | Kn | The dissipation constant used for bending. |
This function applies the forces due to the mass spring system.
References applyBendForce(), and applyStretchForce().
Apply the force due to stretching only.
[in] | Kn | The spring constant used for stretching. |
[in] | critDampCoeff | The critical damping coefficient used for stretching. |
This function applies the forces due to stretching of the edge
References Vec3D::dot(), Vec3D::getLength(), logger, and WARN.
Referenced by applyForce().
void Membrane::Edge::calculateUPre | ( | Vec3D & | state, |
Mdouble & | length, | ||
std::array< Mdouble, 2 > & | faceArea | ||
) |
Calculate some prefactors for the bending penalty.
References Vec3D::dot(), and constants::i.
void Membrane::Edge::checkActive | ( | ) |
check if the edge should calculate bending or stretch forces
This function checks if the edge knows al required pointers to calculate and apply stretch and/or bending forces.
Referenced by Membrane::read().
Mdouble Membrane::Edge::getSineHalfTheta | ( | ) |
Calculate the sine of half the bending angle.
This function calculates the sinus of half the angle between the two connected triangles.
References Vec3D::cross(), and Vec3D::dot().
void Membrane::Edge::handleParticleAddition | ( | unsigned int | id, |
BaseParticle * | p | ||
) |
Handle the particle addition.
[in] | id | The id of the added particle |
[in] | p | Pointer to the added particle |
This function handles the addition of a particle with the given id to the particle handler. If the particle is contained in the edge, the edge is potentially. reactivated. This function is potentially usable for MPI parallelization
References constants::i.
void Membrane::Edge::handleParticleRemoval | ( | unsigned int | id | ) |
handle the partical removal
[in] | id | The id of the removed particle |
This function handles the removal of a particle with the given id from the particle handler. If the particle was contained in the edge, the edge is disabled. This function is potentially usable for MPI parallelization
References constants::i.
Mdouble Membrane::Edge::effectiveMass |
Stores the effective mass of the edge
Referenced by Membrane::buildMesh(), and Membrane::read().
std::array<MeshTriangle*, 2> Membrane::Edge::face = {{nullptr}} |
Stores a pointer to the faces connected by the edge
Referenced by Membrane::read().
std::array<Mdouble, 2> Membrane::Edge::faceInitialArea |
Stores the initial area of the connected triangles
Referenced by Membrane::read().
std::array<BaseParticle*, 2> Membrane::Edge::faceVertex = {{nullptr}} |
Stores a pointer to the remaining particles of faces connected by the edge
Referenced by Membrane::read().
std::array<unsigned int, 2> Membrane::Edge::faceVertexId |
Stores the ids of the remaining particles of faces connected by the edge
Referenced by Membrane::read().
Mdouble Membrane::Edge::initialLength |
Stores initial length of the edge
Referenced by Membrane::buildMesh(), and Membrane::read().
Mdouble Membrane::Edge::initialSineHalfTheta |
Stores the initial sine of half the bending angle
Referenced by Membrane::read().
Vec3D Membrane::Edge::initialState |
Stores the initial difference between the edge particles
Referenced by Membrane::buildMesh(), and Membrane::read().
bool Membrane::Edge::isBendActive |
Stores if the edge should calculate the bending penalty forces
bool Membrane::Edge::isStretchActive |
Stores if the edge should calculate the disntance spring forces
std::array<Mdouble, 8> Membrane::Edge::uPre |
Stores values calculated for bending
Referenced by Membrane::read().
std::array<BaseParticle*, 2> Membrane::Edge::vertex = {{nullptr}} |
Stores a pointer to the particles of the edge
Referenced by Membrane::buildMesh(), and Membrane::read().
std::array<unsigned int, 2> Membrane::Edge::vertexId |
Stores the ids of the particles of the edge
Referenced by Membrane::buildMesh(), and Membrane::read().