97 std::array<BaseParticle*, 2>
vertex = {{
nullptr}};
113 std::array<MeshTriangle*, 2>
face = {{
nullptr}};
230 void read(std::istream& is)
override;
235 void write(std::ostream& os)
const override;
240 std::string
getName()
const override;
352 void buildMesh(
BaseParticle& p0, std::vector<Vec3D> vertexPositions, std::vector<unsigned int> edgeVertices, std::vector<unsigned int> faceVertices);
415 bool addEdge(std::vector<unsigned int>& edges, std::map<std::pair<unsigned int, unsigned int>,
int>& map,
unsigned int v0,
unsigned int v1);
double Mdouble
Definition: GeneralDefine.h:34
It is an abstract base class due to the purely virtual functions declared below. Even if the function...
Definition: BaseObject.h:51
Definition: BaseParticle.h:54
The DPMBase header includes quite a few header files, defining all the handlers, which are essential....
Definition: DPMBase.h:77
A Membrane consists of masses connected by springs.
Definition: Membrane.h:80
void write(std::ostream &os) const override
Writes a Membrane to an output stream, for example a restart file.
Definition: Membrane.cc:204
Mdouble getKe()
Definition: Membrane.h:283
std::vector< MeshTriangle * > getFaces()
Returns a vecter with pointers to the mesh triangles.
Definition: Membrane.h:316
void read(std::istream &is) override
Reads a Membrane from an input stream, for example a restart file.
Definition: Membrane.cc:89
std::vector< unsigned int > vertexParticleId_
Definition: Membrane.h:425
void updateEdgeMass()
Set the correct edge mass by taking the mass from the conencted vertices.
Definition: Membrane.cc:940
void setKnAndCrittDampCoeff(Mdouble Kn, Mdouble critDampCoeff)
Set the parameters needed for the stretching forces.
Definition: Membrane.cc:286
void computeAdditionalForces()
Compute the forces due to the mass spring system.
Definition: Membrane.cc:966
DPMBase * DPMBase_
Definition: Membrane.h:497
unsigned int addVertex(std::vector< Vec3D > &vertices, Vec3D pos, Mdouble eps)
Helper function to check if a given vertex already exists.
Definition: Membrane.cc:563
void updateFaceNeighbors()
Update the faces to have the correct neighbors.
Definition: Membrane.cc:789
Mdouble thickness_
Definition: Membrane.h:477
Mdouble critDampCoeff_
Definition: Membrane.h:462
Mdouble getKn()
Definition: Membrane.h:281
void saveAsOFF(unsigned int d)
Save the Membrane as a .off file.
Definition: Membrane.cc:416
void loadVertexPositions(std::istream &is)
Load the positions of the vertex particles from a stream and apply them to existing particles.
Definition: Membrane.cc:383
void setSpringConstant(Mdouble k)
Set the spring constant of the membrane.
Definition: Membrane.cc:297
ParticleSpecies * membraneSpecies_
Definition: Membrane.h:487
Mdouble Ke_
Definition: Membrane.h:467
ParticleSpecies * membraneParticleSpecies_
Definition: Membrane.h:492
std::vector< BaseParticle * > vertexParticle_
Definition: Membrane.h:420
Mdouble getThickness()
Definition: Membrane.h:285
void setElasticModulusAndThickness(Mdouble E, Mdouble thickness)
Set the elastic modulus and thickness of the membrane \deltails The supplied values are used to calcu...
Definition: Membrane.cc:291
void loadFromSTL(BaseParticle &p0, std::string fileName)
Load the Membrane geometry from a .stl file.
Definition: Membrane.cc:486
std::vector< MeshTriangle * > face_
Definition: Membrane.h:436
void createVertexParticles(BaseParticle &p0, std::vector< Vec3D > vertexPositions)
Handles the actual creation of vertex particles.
Definition: Membrane.cc:705
unsigned int vertexInitId_
Definition: Membrane.h:431
void setThickness(Mdouble thickness)
Set the thickness of the membrane.
Definition: Membrane.cc:317
void handleParticleRemoval(unsigned int id)
Handles the removal of vertex particles from the particle handler.
Definition: Membrane.cc:999
void adjustVertexParticleSize()
Calculates an updated radius for every vertex particle in order to account for the correct mass.
Definition: Membrane.cc:906
Mdouble getKd()
Definition: Membrane.h:284
void setParticleRadius(Mdouble radius)
Set the radius of the vertex particles.
Definition: Membrane.cc:328
std::string getName() const override
Returns the name of the object, here the string "Membrane".
Definition: Membrane.cc:281
std::vector< Edge > edge_
Definition: Membrane.h:447
void buildMesh(BaseParticle &p0, std::vector< Vec3D > vertexPositions, std::vector< unsigned int > edgeVertices, std::vector< unsigned int > faceVertices)
Build the geometry from specified positions and their connectivity.
Definition: Membrane.cc:613
bool bendingAreaConstant_
Definition: Membrane.h:482
Mdouble Kn_
Definition: Membrane.h:457
Membrane * copy() const
Copy method. It calls the copy constructor of this Object.
Definition: Membrane.cc:80
Mdouble particleRadius_
Definition: Membrane.h:452
bool addEdge(std::vector< unsigned int > &edges, std::map< std::pair< unsigned int, unsigned int >, int > &map, unsigned int v0, unsigned int v1)
Helper function to check if a given edge already exists.
Definition: Membrane.cc:588
void saveVertexPositions(std::ostream &os)
save the current positions of the vertex particles to a stream
Definition: Membrane.cc:334
void saveAsSTL(std::string fileName)
Save the Membrane as a .stl file.
Definition: Membrane.cc:453
void initializeEdgeBendingQuantities()
Compute the forces due to the mass spring system.
Definition: Membrane.cc:727
DPMBase * getDPMBase()
Get the stored pointer to DPMBase.
Definition: Membrane.h:306
std::vector< unsigned int > faceVertices_
Definition: Membrane.h:442
Mdouble getBendingAreaConstant()
Definition: Membrane.h:286
Mdouble Kd_
Definition: Membrane.h:472
std::vector< BaseParticle * > getVertexParticles()
Returns a vector with pointers to the vertex particles.
Definition: Membrane.h:311
~Membrane() override
Copy constructor.
Membrane()
Default constructor.
Definition: Membrane.cc:39
Mdouble getCriticalDampingCoefficient()
Definition: Membrane.h:282
Mdouble getParticleRadius()
Returns the radius of the vertex particles.
Definition: Membrane.h:296
Mdouble getVolume()
Calculate the volume of the membrane.
Definition: Membrane.cc:1066
void handleParticleAddition(unsigned int id, BaseParticle *p)
Handles the addition of vertex particles to the particle handler.
Definition: Membrane.cc:1033
void setCriticalDampingCoefficient(Mdouble coeff)
Set damping coefficient for the distance springs.
Definition: Membrane.cc:303
void setDPMBase(DPMBase *dpm)
Set a pointer to DPMBase.
Definition: Membrane.h:301
void setKeAndKd(Mdouble Ke, Mdouble Kd)
Set the parameters needed for the bending forces.
Definition: Membrane.cc:311
void setBendingAreaConstant(bool areaConstant)
Definition: Membrane.cc:323
void applyPressure(Mdouble pressure)
Apply a surface pressure to the membrane.
Definition: Membrane.cc:978
Definition: ParticleSpecies.h:37
double E
Elastic modulus.
Definition: TwenteMeshGluing.cpp:64
Definition: Membrane.h:87
void calculateUPre(Vec3D &state, Mdouble &length, std::array< Mdouble, 2 > &faceArea)
Calculate some prefactors for the bending penalty.
Definition: Membrane.cc:1200
std::array< Mdouble, 8 > uPre
Definition: Membrane.h:123
bool isBendActive
Definition: Membrane.h:153
Mdouble effectiveMass
Definition: Membrane.h:143
std::array< BaseParticle *, 2 > vertex
Definition: Membrane.h:97
Mdouble initialLength
Definition: Membrane.h:133
void applyForce(Mdouble Kn, Mdouble critDampCoeff, Mdouble Ke, Mdouble Kd, bool bendingAreaConstant)
Calculates and applies all neccesary forces.
Definition: Membrane.cc:1088
void handleParticleAddition(unsigned int id, BaseParticle *p)
Handle the particle addition.
Definition: Membrane.cc:1280
void applyBendForce(Mdouble Kn, Mdouble Kd, bool bendingAreaConstant)
Apply a force due to bending.
Definition: Membrane.cc:1136
Mdouble initialSineHalfTheta
Definition: Membrane.h:138
std::array< BaseParticle *, 2 > faceVertex
Definition: Membrane.h:108
std::array< Mdouble, 2 > faceInitialArea
Definition: Membrane.h:118
void applyStretchForce(Mdouble Kn, Mdouble critDampCoeff)
Apply the force due to stretching only.
Definition: Membrane.cc:1099
std::array< unsigned int, 2 > faceVertexId
Definition: Membrane.h:103
Mdouble getSineHalfTheta()
Calculate the sine of half the bending angle.
Definition: Membrane.cc:1227
void checkActive()
check if the edge should calculate bending or stretch forces
Definition: Membrane.cc:1302
std::array< MeshTriangle *, 2 > face
Definition: Membrane.h:113
bool isStretchActive
Definition: Membrane.h:148
std::array< unsigned int, 2 > vertexId
Definition: Membrane.h:92
void handleParticleRemoval(unsigned int id)
handle the partical removal
Definition: Membrane.cc:1254
Vec3D initialState
Definition: Membrane.h:128