NetDEM v1.0
Loading...
Searching...
No Matches
netdem::Membrane Class Reference

A class that simulates a membrane. More...

#include <membrane.hpp>

Inheritance diagram for netdem::Membrane:
netdem::MembraneWall

Public Member Functions

 Membrane (double radius, double height)
 Constructs a new Membrane object with the given radius and height.
 
 Membrane (double radius, double height, double mesh_size)
 Constructs a new Membrane object with the given radius, height, and element size.
 
 Membrane (double radius, double height, double mesh_size, double center_x, double center_y, double center_z)
 Constructs a new Membrane object with the given radius, height, element size, and center.
 
void Remesh (double ele_size)
 Remeshes the membrane.
 
void Init ()
 Initializes the membrane.
 
void SetBCNodalVelocity (int nid, double vx, double vy, double vz, bool use_prescribed_vx, bool use_prescribed_vy, bool use_prescribed_vz)
 Sets the nodal velocity and boundary condition for a given node.
 
void Solve (double dt)
 Solves the membrane motion for a given timestep.
 
void SaveAsVTK (std::string const &file_name)
 Saves the current state of the membrane as a VTK file.
 
 ~Membrane ()
 Destroys the Membrane object.
 

Public Attributes

double radius {0.25}
 The radius of the membrane.
 
double height {1.0}
 The height of the membrane.
 
double mesh_size {0.1}
 The size of the elements in the mesh used to represent the membrane.
 
Vec3d center {0, 0, 0}
 The center of the membrane.
 
double neo_k {6.94e5}
 Material properties of the membrane (neo-Hookean material model).
 
double neo_mu {5.21e5}
 Material properties of the membrane (neo-Hookean material model).
 
double density {500.0}
 Material properties of the membrane.
 
double thickness {0.3e-3}
 Material properties of the membrane.
 
double damp_coef {0.7}
 Damping coefficient for the membrane motion.
 
double timestep {1.0e-4}
 Timestep for the simulation.
 
VecXT< Vec3dnodes
 Triangle mesh representing the membrane: nodes.
 
VecXT< Vec3ielements
 Triangle mesh representing the membrane: elements.
 
VecXT< Vec3delemental_stress
 Elemental stress tensor for each element in the mesh.
 
VecXT< double > nodal_vols
 Nodal volumes for each node in the mesh (used for updating motion using a lumped mass approach).
 
VecXT< Vec3dnodal_vels
 Nodal velocities for each node in the mesh (used for updating motion using a lumped mass approach).
 
VecXT< double > bc_facet_pressure
 Facet pressures for the boundary conditions.
 
VecXT< Vec3dbc_facet_forces
 Facet forces for the boundary conditions.
 
VecXT< VecNT< double, 6 > > bc_nodal_vels
 Nodal velocities for the boundary conditions. The last three elements indicate if prescribed velocities are used.
 

Protected Member Functions

void Advance (double dt)
 Advances the membrane motion for a given timestep.
 
void InitMesh ()
 Initializes the mesh used to represent the membrane.
 
void InitInitialCondition ()
 Initializes the initial conditions for the simulation.
 
Mat2d GetDeformationGradient (Vec3d const &v0, Vec3d const &v1, Vec3d const &v2)
 Calculates the deformation gradient tensor for an element.
 
Mat2d GetCauchyStress (Mat2d const &def_grad)
 Calculates the Cauchy stress tensor for an element.
 
std::tuple< Mat3d, Mat3dGetGlobalForces (Mat2d const &cauchy_stress, double pressure, Vec3d const &v0, Vec3d const &v1, Vec3d const &v2)
 Calculates the global internal and external forces acting on an element.
 

Protected Attributes

double ref_ele_width {0.1}
 Reference width and height of each element.
 
double ref_ele_height {0.1}
 
double ref_ele_area {0.05}
 Reference area of each element.
 
VecXT< Vec3dnodal_forces_int
 Nodal internal forces.
 
VecXT< Vec3dnodal_forces_ext
 Nodal external forces.
 

Detailed Description

A class that simulates a membrane.

The Membrane class is responsible for simulating a membrane. It provides functionality to initialize the membrane, set up boundary conditions, remesh the membrane, and solve the simulation using a lumped mass approach.

Constructor & Destructor Documentation

◆ Membrane() [1/3]

Membrane::Membrane ( double radius,
double height )

Constructs a new Membrane object with the given radius and height.

This constructor creates a new Membrane object with the given radius and height, and initializes the center to the origin.

Parameters
radiusThe radius of the membrane.
heightThe height of the membrane.

◆ Membrane() [2/3]

Membrane::Membrane ( double radius,
double height,
double mesh_size )

Constructs a new Membrane object with the given radius, height, and element size.

This constructor creates a new Membrane object with the given radius, height, and element size, and initializes the center to the origin.

Parameters
radiusThe radius of the membrane.
heightThe height of the membrane.
mesh_sizeThe size of the elements in the mesh used to represent the membrane.

◆ Membrane() [3/3]

Membrane::Membrane ( double radius,
double height,
double mesh_size,
double center_x,
double center_y,
double center_z )

Constructs a new Membrane object with the given radius, height, element size, and center.

This constructor creates a new Membrane object with the given radius, height, element size, and center.

Parameters
radiusThe radius of the membrane.
heightThe height of the membrane.
mesh_sizeThe size of the elements in the mesh used to represent the membrane.
center_xThe x-coordinate of the center of the membrane.
center_yThe y-coordinate of the center of the membrane.
center_zThe z-coordinate of the center of the membrane.

◆ ~Membrane()

Membrane::~Membrane ( )

Destroys the Membrane object.

This destructor destroys the Membrane object and frees all the resources it allocated.

Member Function Documentation

◆ Advance()

void Membrane::Advance ( double dt)
protected

Advances the membrane motion for a given timestep.

This function advances the membrane motion for the given timestep dt.

Parameters
dtThe timestep for the simulation.

◆ GetCauchyStress()

Mat2d Membrane::GetCauchyStress ( Mat2d const & def_grad)
protected

Calculates the Cauchy stress tensor for an element.

This function calculates the Cauchy stress tensor for an element with deformation gradient tensor def_grad.

Parameters
def_gradThe deformation gradient tensor for the element.
Returns
The Cauchy stress tensor for the element.

◆ GetDeformationGradient()

Mat2d Membrane::GetDeformationGradient ( Vec3d const & v0,
Vec3d const & v1,
Vec3d const & v2 )
protected

Calculates the deformation gradient tensor for an element.

This function calculates the deformation gradient tensor for an element with vertices v0, v1, and v2.

Parameters
v0The first vertex of the element.
v1The second vertex of the element.
v2The third vertex of the element.
Returns
The deformation gradient tensor for the element.

◆ GetGlobalForces()

tuple< Mat3d, Mat3d > Membrane::GetGlobalForces ( Mat2d const & cauchy_stress,
double pressure,
Vec3d const & v0,
Vec3d const & v1,
Vec3d const & v2 )
protected

Calculates the global internal and external forces acting on an element.

This function calculates the global internal and external forces acting on an element with Cauchy stress tensor cauchy_stress, pressure pressure, and vertices v0, v1, and v2.

Parameters
cauchy_stressThe Cauchy stress tensor for the element.
pressureThe pressure acting on the element.
v0The first vertex of the element.
v1The second vertex of the element.
v2The third vertex of the element.
Returns
A tuple containing the global internal and external forces acting on the element.

◆ Init()

void Membrane::Init ( )

Initializes the membrane.

This function initializes the membrane by calling InitMesh() and InitInitialCondition().

◆ InitInitialCondition()

void Membrane::InitInitialCondition ( )
protected

Initializes the initial conditions for the simulation.

◆ InitMesh()

void Membrane::InitMesh ( )
protected

Initializes the mesh used to represent the membrane.

◆ Remesh()

void Membrane::Remesh ( double ele_size)

Remeshes the membrane.

This function remeshes the membrane with the given element size.

Parameters
ele_sizeThe new size for the elements in the mesh used to represent the membrane.

◆ SaveAsVTK()

void Membrane::SaveAsVTK ( std::string const & file_name)

Saves the current state of the membrane as a VTK file.

This function saves the current state of the membrane with the given filename as a VTK file.

Parameters
file_nameThe name of the file to save the membrane state to.

◆ SetBCNodalVelocity()

void Membrane::SetBCNodalVelocity ( int nid,
double vx,
double vy,
double vz,
bool use_prescribed_vx,
bool use_prescribed_vy,
bool use_prescribed_vz )

Sets the nodal velocity and boundary condition for a given node.

This function sets the nodal velocity and boundary condition for the given node. The nodal velocity is specified using vx, vy, and vz. The last three arguments (use_prescribed_vx, use_prescribed_vy, and use_prescribed_vz) indicate whether prescribed velocities are used in each respective dimension.

Parameters
nidThe index of the node to set the boundary condition for.
vxThe x-component of the nodal velocity.
vyThe y-component of the nodal velocity.
vzThe z-component of the nodal velocity.
use_prescribed_vxWhether prescribed velocities are used in the x-dimension.
use_prescribed_vyWhether prescribed velocities are used in the y-dimension.
use_prescribed_vzWhether prescribed velocities are used in the z-dimension.

◆ Solve()

void Membrane::Solve ( double dt)

Solves the membrane motion for a given timestep.

This function solves for the membrane motion for the given timestep dt.

Parameters
dtThe timestep for the simulation.

Member Data Documentation

◆ bc_facet_forces

VecXT<Vec3d> netdem::Membrane::bc_facet_forces

Facet forces for the boundary conditions.

◆ bc_facet_pressure

VecXT<double> netdem::Membrane::bc_facet_pressure

Facet pressures for the boundary conditions.

◆ bc_nodal_vels

VecXT<VecNT<double, 6> > netdem::Membrane::bc_nodal_vels

Nodal velocities for the boundary conditions. The last three elements indicate if prescribed velocities are used.

◆ center

Vec3d netdem::Membrane::center {0, 0, 0}

The center of the membrane.

◆ damp_coef

double netdem::Membrane::damp_coef {0.7}

Damping coefficient for the membrane motion.

◆ density

double netdem::Membrane::density {500.0}

Material properties of the membrane.

◆ elemental_stress

VecXT<Vec3d> netdem::Membrane::elemental_stress

Elemental stress tensor for each element in the mesh.

◆ elements

VecXT<Vec3i> netdem::Membrane::elements

Triangle mesh representing the membrane: elements.

◆ height

double netdem::Membrane::height {1.0}

The height of the membrane.

◆ mesh_size

double netdem::Membrane::mesh_size {0.1}

The size of the elements in the mesh used to represent the membrane.

◆ neo_k

double netdem::Membrane::neo_k {6.94e5}

Material properties of the membrane (neo-Hookean material model).

The material properties are based on Qu et al., "A continuum model for simulation of 3D cell migration with realistic biophysical constraints", Computer Graphics Forum, vol. 38, no. 6, pp. 283-294, 2019.

◆ neo_mu

double netdem::Membrane::neo_mu {5.21e5}

Material properties of the membrane (neo-Hookean material model).

◆ nodal_forces_ext

VecXT<Vec3d> netdem::Membrane::nodal_forces_ext
protected

Nodal external forces.

◆ nodal_forces_int

VecXT<Vec3d> netdem::Membrane::nodal_forces_int
protected

Nodal internal forces.

◆ nodal_vels

VecXT<Vec3d> netdem::Membrane::nodal_vels

Nodal velocities for each node in the mesh (used for updating motion using a lumped mass approach).

◆ nodal_vols

VecXT<double> netdem::Membrane::nodal_vols

Nodal volumes for each node in the mesh (used for updating motion using a lumped mass approach).

◆ nodes

VecXT<Vec3d> netdem::Membrane::nodes

Triangle mesh representing the membrane: nodes.

◆ radius

double netdem::Membrane::radius {0.25}

The radius of the membrane.

◆ ref_ele_area

double netdem::Membrane::ref_ele_area {0.05}
protected

Reference area of each element.

◆ ref_ele_height

double netdem::Membrane::ref_ele_height {0.1}
protected

◆ ref_ele_width

double netdem::Membrane::ref_ele_width {0.1}
protected

Reference width and height of each element.

◆ thickness

double netdem::Membrane::thickness {0.3e-3}

Material properties of the membrane.

◆ timestep

double netdem::Membrane::timestep {1.0e-4}

Timestep for the simulation.


The documentation for this class was generated from the following files: