|
Continuum Membrane 719025a62b1e384a6ff80e2f2a223ef4012153dc
|
A class representing a triangular mesh that defines a limit surface. More...
#include <Mesh.hpp>
Classes | |
| struct | GagAngle |
| struct | GagBond |
| struct | GagInteraction |
| struct | GagReactionTarget |
| struct | GagSubunit |
| struct | GagTorsion |
Public Member Functions | |
| Mesh (Param &srcParam) | |
| Construct a new Mesh object with parameters. Initialize vertices and faces with other functions like setVerticesFlat. | |
| Mesh (const std::vector< Vertex > &srcVertices, const std::vector< Face > &srcFaces, Param &srcParam) __attribute__((deprecated("Initialize with Mesh(Param &srcParam) and setup with setup_from_vertices_faces instead."))) | |
| Construct a new mesh object with given vertices, faces, and parameters. | |
| void | setup_flat () |
| Initialize halfedges based on the mesh's vertices and faces. | |
| void | setup_from_vertices_faces (const std::vector< std::vector< double > > &verticesData, const std::vector< std::vector< int > > &facesData) |
| Initialize membrane with arbitrary vertices and faces imported from files. Sets up the membrane from data and then call: (1) this->set_adjacent_faces_of_vertices_sorted (2) this->determine_ghost_vertices_faces. | |
| void | set_axes_division_flat () |
| Divide x,y axis to nx*dx (number of faces times length of each face) and ny*dy based on X, Y side length of the mesh and side length of faces in parameter. Note: | |
| void | set_vertices_faces_flat () |
| Set vertices and faces according to mesh and face side lengths in param for flat mesh. This also sets adjacent vertices of faces. | |
| void | set_adjacent_faces_of_vertices_sorted () |
| Set adjacentFaces properties based on the current vertices and mesh. Sort the adjacent vertices so that the adjacent vertices property of vertices follow the counterclockwise order and therefore the the adjacent faces with index number difference of one are adjacent to each other. This sorting streamlines the shapefunction calculation. | |
| bool | faces_share_edge (const Face &face1, const Face &face2) |
| Return true if two faces share edge. | |
| bool | faces_share_edge (const Face &face1, const Face &face2, std::vector< int > &commonElements) |
| Return true if two faces share edge. Store the vector of common elements in input commonElements. | |
| void | set_adjacent_faces_of_faces () |
| Set adjacentFaces properties of faces based on the current geometry of mesh. | |
| void | set_adjacent_vertices_of_vertices_sorted () |
| Set adjacentVertices of vertices based on current mesh. | |
| int | find_opposite_node_index (const int &node1, const int &node2, const int &node3) |
| Find the vertex that is adjacent to node1 and node2 but not node3. Particularly, when the three nodes are vertices of a triangle, then the function returns the the index of node4 that forms a parallegram with 1->3->2->4. | |
| void | set_one_ring_vertices_sorted () |
| find out the one-ring vertices aound face_i. It should be 12 for the flat surface because we set it up only with regular patch. The boundary faces do not have complete one-ring, neither it will be called in the code, so no need to store their one-ring-vertex | |
| void | determine_boundary_vertices_faces () |
| Iterate through vertices and faces and set the isBoundary} property of boundary vertices and faces to true}. | |
| void | determine_ghost_vertices_faces () |
| Iterate through vertices and faces and set the isGhost property of ghost vertices and face to true. The number of layers of ghost vertices in a flat membrane is dependent upon the boundary conditions: free boundary condition has 1 layer of ghost vertices and faces while periodic bounary condition has 3 layers of ghost vertices. | |
| void | sort_vertices_on_faces () |
| Sort vertices on faces so that the unit normal vector indicates the orientation of the local patch of the membrane. | |
| void | set_insertion_patch (const vector< vector< int > > &insertionPatch) |
| Sets the isInsertionPatch flag for each face in the insertion patch. This also sets with spontaneous curvature after setting the flag with set_spontaneous_curvature_for_face function. | |
| void | set_spontaneous_curvature_for_face (const double &insertCurv, const double &spontCurv) |
| Sets the spontaneous curvature for each face in the mesh. | |
| void | calculate_element_area_volume () |
| Calculates the area and volume of each element in the mesh. | |
| void | sum_membrane_area_and_volume (double &area, double &volume) |
| This function calculates the total membrane area and volume of non-ghost faces in a given set of faces. | |
| void | Compute_Energy_And_Force () |
| Computes the energy and force on each vertex and face of the mesh. | |
| void | element_energy_force_regular (const std::vector< Matrix > &coordOneRingVertices, Face &face, const double spontCurv, double &meanCurv, Matrix &normVector, double &eBend, Matrix &fBend, Matrix &fArea, Matrix &fVolume) |
| The purpose of this function is to calculate the energy and forces for a regular element of a given mesh using the provided information about the element and its one-ring neighborhood. | |
| void | energy_force_regularization () |
| Calculates the regularization energy and force for each face. | |
| void | manage_force_for_boundary_ghost_vertex () |
| Manages forces depending on different boundary conditions. | |
| double | get_max_force_magnitude () |
| Get the max force scale of vertices.force.get_total_force_magnitude() | |
| double | calculate_mean_force () |
| Get the mean force magnitude on all vertices. | |
| void | update_previous_coord_for_vertex () |
| This function updates the coordPrev member variable for each vertex in the mesh. It does this by copying the current value of coord to coordPrev. | |
| void | update_reference_coord_from_previous_coord () |
| Update the reference coordinates for each vertex in the mesh. | |
| void | update_previous_force_for_vertex () |
| Update the previous force vectors for each vertex in the mesh. | |
| void | update_previous_energy_for_face () |
| Update the previous energy values for each face in the mesh. | |
| void | clear_force_on_vertices_and_energy_on_faces () |
| this function sets the force member variable of each vertex, and the energy member variable of each face to their default values. This is useful to clear out any residual forces or energies before computing new ones. | |
| int | findClosestRcap (double membraneCapRadius) |
| double | interpolateHeight (double r, const std::vector< double > &r_vals, const std::vector< double > &h_vals) |
| void | loadMembraneShapeProfile (double membraneCapRadius, std::vector< double > &r_vals, std::vector< double > &h_vals) |
| bool | move_vertices_based_on_scaffolding (bool fixDir=true) |
| This method takes in the vector of spline point and calculate the average coordinates. Based on the difference between spline points and mesh vertices, a difference vector is calculated and compared to the target bond length. (Supposed only in Z direction). Afterwards, all the mesh points are moved in the direction of the target difference vector. | |
| Matrix & | find_center_of_scaffolding_sphere (bool use_default) |
| A function that finds the center of the scaffolding sphere. Currently the function assumes that the spherical cap is oriented in a way that the point with biggest z-coord corresponds to the x,y of the spherical center. | |
| double | approximate_scaffolding_cap_radius (bool use_default) |
| Approximates the radius of the scaffolding cap. | |
| void | set_scaffolding_vertices_correspondence () |
| Get a vector of indexes of vertices that are closest to the scaffoldingPoints vector provided. Then set the param.scaffoldingPoints_correspondingVertexIndex} to represent the vertices bonded with each scaffolding point. | |
| void | set_scaffolding_insertion_curvature () |
| Sets insertion spontaneous curvature on faces adjacent to scaffold-bonded membrane vertices. | |
| double | calculate_scaffolding_energy_force (bool doLocalSearch) |
| Calculates the energy and force due to the harmonic bond between scaffold points and membrane vertices. | |
| bool | initialize_gag_scaffolding_topology () |
| Initializes the Gag-specific reference geometry from the selected complex file. | |
| bool | orient_scaffolding_plane_to_membrane () |
| Orients the imported scaffold COM cloud so its best-fit plane is parallel to the membrane plane. | |
| double | calculate_gag_scaffolding_internal_energy () const |
| Calculates the internal Gag scaffold energy for the current COM positions. | |
| double | calculate_gag_scaffolding_internal_energy (const std::vector< Matrix > &scaffoldingPoints) const |
| Calculates the internal Gag scaffold energy for an arbitrary set of COM positions. | |
| double | calculate_gag_scaffolding_internal_energy (const std::vector< Matrix > &scaffoldingPoints, const std::vector< GagSubunit > &subunits) const |
| Calculates the internal Gag scaffold energy for arbitrary COM positions and rigid-subunit orientations. | |
| std::vector< Matrix > | calculate_gag_scaffolding_forces_fd () const |
| Computes per-point Gag scaffold forces using finite differences on the internal energy. | |
| std::vector< Matrix > | calculate_gag_subunit_translation_forces_fd () |
| Computes rigid-subunit COM translation forces from the Gag scaffold energy. | |
| std::vector< Matrix > | calculate_gag_subunit_rotation_torques_fd () |
| Computes rigid-subunit rotational torques from the Gag scaffold energy. | |
| bool | propagate_scaffolding () |
| Propagate the scaffolding based on energy and force calculated from calculate_scaffolding_energy_force(bool doLocalSearch). | |
| bool | pre_relax_gag_scaffolding () |
| Pre-relaxes the Gag scaffold using only internal Gag energy before membrane coupling is initialized. | |
| void | write_faces_csv (const std::string &outfile_name) |
| Writes a csv file containing the adjacent vertices for each face in the mesh. | |
| void | write_vertices_csv (const std::string &outfile_name) |
| Writes a csv file containing the coordinates of each vertex in the mesh. | |
| void | write_vertices_csv_with_type (const std::string &outfile_name) |
| Writes a csv file containing the coordinates and types of each vertex in the mesh. | |
| void | write_gag_scaffolding_state_dat (const std::string &outfile_name) const |
| Writes the current Gag scaffold state in a selected-complex style .dat layout. | |
Public Attributes | |
| std::vector< Vertex > | vertices |
| Vector to store all vertices in the mesh. | |
| std::vector< Face > | faces |
| Vector to store all faces in the mesh. | |
| Param & | param |
| Object of the Param class containing all necessary parameters for building the Mesh object. | |
| Matrix | centerScaffoldingSphere |
| Center of the scaffolding cap sphere. | |
| Matrix | forceTotalOnScaffolding |
| Total force exerted on the scaffolding lattice. | |
| Matrix | scaffoldingMovementVector |
| Vector representing the movement of scaffolding over the course of simulation. | |
| std::vector< Matrix > | forceOnScaffoldingPoints |
| Per-point force used when propagating the scaffold. | |
| bool | gagScaffoldingTopologyInitialized = false |
| Whether Gag-specific reference geometry has been initialized. | |
| std::vector< GagBond > | gagBonds |
| Gag-specific COM bond list. | |
| std::vector< GagAngle > | gagAngles |
| Gag-specific COM angle list. | |
| std::vector< GagTorsion > | gagTorsions |
| Gag-specific COM torsion list. | |
| std::vector< GagSubunit > | gagSubunits |
| Gag rigid subunits whose COMs are the scaffolding points. | |
| std::vector< GagInteraction > | gagInteractions |
| Gag pair interactions defined on rigid subunits. | |
| Matrix | gagInitialAlignmentRotation = Matrix(3, 3, true) |
| Initial lattice-to-membrane alignment rotation. | |
Protected Member Functions | |
| void | enumerate_gauss_quadrature_point_area_volume (const Matrix &dots, double &area, double &volume) |
| Private member used in calculating element area volume: Calculates the area and volume at a Gauss quadrature point for a given set of shape functions and dots. | |
| Matrix | get_one_ring_vertex_matrix (const Face &face) |
| Private member used in calculating element area volume: Computes a matrix containing the coordinates of the one-ring vertices for the input face. | |
| double | get_squared_distance_sp_and_v (const Matrix &scaffoldingPoint, const Vertex &vertex) |
| Private member used in calculating correspondence between scaffolding points and vertices Calculate the squared distance between two points denoted by (3,1) Matrix and Vertex respectively. | |
Friends | |
| std::ostream & | operator<< (std::ostream &stream, const Mesh &mesh) |
| Overrides the operator << in ostream. | |
A class representing a triangular mesh that defines a limit surface.
| Mesh::Mesh | ( | Param & | srcParam | ) |
Construct a new Mesh object with parameters. Initialize vertices and faces with other functions like setVerticesFlat.
| param |
| Mesh::Mesh | ( | const std::vector< Vertex > & | srcVertices, |
| const std::vector< Face > & | srcFaces, | ||
| Param & | srcParam | ||
| ) | & |
Construct a new mesh object with given vertices, faces, and parameters.
| double Mesh::approximate_scaffolding_cap_radius | ( | bool | use_default | ) |
Approximates the radius of the scaffolding cap.
This function approximates the radius of the scaffolding cap based on the furthest point from the center of the scaffolding sphere in terms of x and y coordinates.
| use_default | Flag indicating whether to use the default center of scaffolding sphere. If set to true, the default center (0,0,0) will be used. If set to false, the center will be determined based on the maximum z-coordinate of the scaffolding points. |
| void Mesh::calculate_element_area_volume | ( | ) |
Calculates the area and volume of each element in the mesh.
This method computes and sets the area and volume of each element in the mesh, where an "element" refers to a face in the mesh. The method uses Gaussian quadrature to calculate the area and volume of each element, with 3 points used for regular patches and multiple iterations of subdivision used for irregular patches.
The method first defines some matrices used for subdivision of the irregular patch, including M, M1, M2, M3, and M4. It then loops over all faces in the mesh in parallel using OpenMP.
For each face, the method checks whether it is a ghost face; if so, it skips to the next face. Otherwise, it initializes variables to accumulate the area and volume of the element and determines the number of one-ring vertices (nOneRingVertex) for the face.
If nOneRingVertex is equal to 12, the face corresponds to a regular patch, and the method calls the get_one_ring_vertex_matrix function to compute a matrix representing the coordinates of the one-ring vertices. It then uses Gaussian quadrature with 3 points to compute the area and volume of the element.
If nOneRingVertex is equal to 11, the face corresponds to an irregular patch. In this case, the method again calls get_one_ring_vertex_matrix to compute the matrix of one-ring vertex coordinates, but then performs multiple iterations of subdivision using the M, M1, M2, M3, and M4 matrices to estimate the area and volume of the element.
Finally, the method sets the elementArea and elementVolume member variables of the face to the computed area and volume, respectively.
| std::vector< Matrix > Mesh::calculate_gag_scaffolding_forces_fd | ( | ) | const |
Computes per-point Gag scaffold forces using finite differences on the internal energy.
| double Mesh::calculate_gag_scaffolding_internal_energy | ( | ) | const |
Calculates the internal Gag scaffold energy for the current COM positions.
| double Mesh::calculate_gag_scaffolding_internal_energy | ( | const std::vector< Matrix > & | scaffoldingPoints | ) | const |
Calculates the internal Gag scaffold energy for an arbitrary set of COM positions.
| scaffoldingPoints | The scaffold COM positions to evaluate. |
| double Mesh::calculate_gag_scaffolding_internal_energy | ( | const std::vector< Matrix > & | scaffoldingPoints, |
| const std::vector< GagSubunit > & | subunits | ||
| ) | const |
Calculates the internal Gag scaffold energy for arbitrary COM positions and rigid-subunit orientations.
| scaffoldingPoints | The scaffold COM positions to evaluate. |
| subunits | The rigid-subunit states to evaluate. |
| std::vector< Matrix > Mesh::calculate_gag_subunit_rotation_torques_fd | ( | ) |
Computes rigid-subunit rotational torques from the Gag scaffold energy.
| std::vector< Matrix > Mesh::calculate_gag_subunit_translation_forces_fd | ( | ) |
Computes rigid-subunit COM translation forces from the Gag scaffold energy.
| double Mesh::calculate_mean_force | ( | ) |
Get the mean force magnitude on all vertices.
| double Mesh::calculate_scaffolding_energy_force | ( | bool | doLocalSearch | ) |
Calculates the energy and force due to the harmonic bond between scaffold points and membrane vertices.
| doLocalSearch | Flag indicating whether or not to perform a local search for each vertex (default=false). |
The function iterates over each scaffold point, calculates the distance between the point and its corresponding vertex, and calculates the energy and force due to the harmonic bond between the two. If the energy flag is not set to include harmonic bonding, the function returns 0.
| [in] | doLocalSearch | Flag to indicate whether a local search should be performed for each vertex (default=false). |
| void Mesh::clear_force_on_vertices_and_energy_on_faces | ( | ) |
this function sets the force member variable of each vertex, and the energy member variable of each face to their default values. This is useful to clear out any residual forces or energies before computing new ones.
| void Mesh::Compute_Energy_And_Force | ( | ) |
Computes the energy and force on each vertex and face of the mesh.
This function performs the following steps: Calculates the area and volume of each element triangle and sums up the total area and volume of the membrane. Iterates through faces and calculates the energy and force on each triangular patch. Regularizes the force and energy. Sums up the energy and force on each vertex and face. Calculates the energy due to area constraint. Calculates the energy due to volume constraint. Calculates the energy due to scaffolding.
| void Mesh::determine_boundary_vertices_faces | ( | ) |
Iterate through vertices and faces and set the isBoundary} property of boundary vertices and faces to true}.
| void Mesh::determine_ghost_vertices_faces | ( | ) |
Iterate through vertices and faces and set the isGhost property of ghost vertices and face to true. The number of layers of ghost vertices in a flat membrane is dependent upon the boundary conditions: free boundary condition has 1 layer of ghost vertices and faces while periodic bounary condition has 3 layers of ghost vertices.
| void Mesh::element_energy_force_regular | ( | const std::vector< Matrix > & | coordOneRingVertices, |
| Face & | face, | ||
| const double | spontCurv, | ||
| double & | meanCurv, | ||
| Matrix & | normVector, | ||
| double & | eBend, | ||
| Matrix & | fBend, | ||
| Matrix & | fArea, | ||
| Matrix & | fVolume | ||
| ) |
The purpose of this function is to calculate the energy and forces for a regular element of a given mesh using the provided information about the element and its one-ring neighborhood.
| coordOneRingVertices | a constant reference to a vector of matrices representing the coordinates of the vertices in the mesh's one-ring neighborhood. |
| spontCurv | a constant double representing the spontaneous curvature. |
| meanCurv | a non-constant double reference representing the mean curvature of the element. |
| normVector | a non-constant matrix reference representing the normal vector of the element. |
| eBend | a non-constant double reference representing the bending energy of the element. |
| fBend | a non-constant matrix reference representing the bending force of the element. |
| fArea | a non-constant matrix reference representing the area constraint force of the element. |
| fVolume | a non-constant matrix reference representing the volume constraint force of the element. |
| void Mesh::energy_force_regularization | ( | ) |
Calculates the regularization energy and force for each face.
This function calculates the regularization energy and force for each face in the mesh. The regularization energy is calculated based on the deformation of the face's shape and area relative to an equilateral triangle with the same side length. The regularization force is then calculated based on the energy and applied to the vertices of the face. The function also updates the deformation counts for shapes and areas.
|
protected |
Private member used in calculating element area volume: Calculates the area and volume at a Gauss quadrature point for a given set of shape functions and dots.
| dots | The matrix of dots representing the coordinates of the quadrature point. |
| gaussQuadratureCoeff | The matrix of Gauss quadrature coefficients. |
| area | A reference to a double variable storing the accumulated area. |
| volume | A reference to a double variable storing the accumulated volume. |
Return true if two faces share edge.
| face1 | |
| face2 |
| bool Mesh::faces_share_edge | ( | const Face & | face1, |
| const Face & | face2, | ||
| std::vector< int > & | commonElements | ||
| ) |
Return true if two faces share edge. Store the vector of common elements in input commonElements.
| face1 | |
| face2 | |
| commonElements |
| Matrix & Mesh::find_center_of_scaffolding_sphere | ( | bool | use_default | ) |
A function that finds the center of the scaffolding sphere. Currently the function assumes that the spherical cap is oriented in a way that the point with biggest z-coord corresponds to the x,y of the spherical center.
| use_default | if set to true, the function with return the defautl center of scaffolding sphere (0, 0, 0) |
| int Mesh::find_opposite_node_index | ( | const int & | node1, |
| const int & | node2, | ||
| const int & | node3 | ||
| ) |
Find the vertex that is adjacent to node1 and node2 but not node3. Particularly, when the three nodes are vertices of a triangle, then the function returns the the index of node4 that forms a parallegram with 1->3->2->4.
| node1 | |
| node2 | |
| node3 |
| int Mesh::findClosestRcap | ( | double | membraneCapRadius | ) |
| double Mesh::get_max_force_magnitude | ( | ) |
Get the max force scale of vertices.force.get_total_force_magnitude()
Private member used in calculating element area volume: Computes a matrix containing the coordinates of the one-ring vertices for the input face.
| bool Mesh::initialize_gag_scaffolding_topology | ( | ) |
Initializes the Gag-specific reference geometry from the selected complex file.
| double Mesh::interpolateHeight | ( | double | r, |
| const std::vector< double > & | r_vals, | ||
| const std::vector< double > & | h_vals | ||
| ) |
| void Mesh::loadMembraneShapeProfile | ( | double | membraneCapRadius, |
| std::vector< double > & | r_vals, | ||
| std::vector< double > & | h_vals | ||
| ) |
| void Mesh::manage_force_for_boundary_ghost_vertex | ( | ) |
Manages forces depending on different boundary conditions.
This method sets the force of nodes that are part of the mesh's boundaries and ghost vertices to zero, based on the type of boundary condition specified in the input parameters.
| bool Mesh::move_vertices_based_on_scaffolding | ( | bool | fixDir = true | ) |
This method takes in the vector of spline point and calculate the average coordinates. Based on the difference between spline points and mesh vertices, a difference vector is calculated and compared to the target bond length. (Supposed only in Z direction). Afterwards, all the mesh points are moved in the direction of the target difference vector.
| fixDir | default to true; fix move vector to (0, 0, 50) if set to true; otherwise move vector is determined based on average scaffolding points |
| bool Mesh::orient_scaffolding_plane_to_membrane | ( | ) |
Orients the imported scaffold COM cloud so its best-fit plane is parallel to the membrane plane.
| bool Mesh::pre_relax_gag_scaffolding | ( | ) |
Pre-relaxes the Gag scaffold using only internal Gag energy before membrane coupling is initialized.
| bool Mesh::propagate_scaffolding | ( | ) |
Propagate the scaffolding based on energy and force calculated from calculate_scaffolding_energy_force(bool doLocalSearch).
| void Mesh::set_adjacent_faces_of_faces | ( | ) |
Set adjacentFaces properties of faces based on the current geometry of mesh.
This function iterates over the faces of the mesh and populates the adjacentFaces property of each face by finding neighboring faces that share an edge.
| void Mesh::set_adjacent_faces_of_vertices_sorted | ( | ) |
Set adjacentFaces properties based on the current vertices and mesh. Sort the adjacent vertices so that the adjacent vertices property of vertices follow the counterclockwise order and therefore the the adjacent faces with index number difference of one are adjacent to each other. This sorting streamlines the shapefunction calculation.
| void Mesh::set_adjacent_vertices_of_vertices_sorted | ( | ) |
Set adjacentVertices of vertices based on current mesh.
| void Mesh::set_axes_division_flat | ( | ) |
Divide x,y axis to nx*dx (number of faces times length of each face) and ny*dy based on X, Y side length of the mesh and side length of faces in parameter. Note:
(1) y-axis is in a zig-zag shape and in perpendicular direction, h(y) = sqrt(3)/2 * h(x) assuming equilateral triangles (2) number of vertices along axes = number of faces (edges) + 1
| void Mesh::set_insertion_patch | ( | const vector< vector< int > > & | insertionPatch | ) |
Sets the isInsertionPatch flag for each face in the insertion patch. This also sets with spontaneous curvature after setting the flag with set_spontaneous_curvature_for_face function.
| insertionPatch | A vector of vectors containing the indices of faces in the insertion patch |
| void Mesh::set_one_ring_vertices_sorted | ( | ) |
find out the one-ring vertices aound face_i. It should be 12 for the flat surface because we set it up only with regular patch. The boundary faces do not have complete one-ring, neither it will be called in the code, so no need to store their one-ring-vertex
| void Mesh::set_scaffolding_insertion_curvature | ( | ) |
Sets insertion spontaneous curvature on faces adjacent to scaffold-bonded membrane vertices.
| void Mesh::set_scaffolding_vertices_correspondence | ( | ) |
Get a vector of indexes of vertices that are closest to the scaffoldingPoints vector provided. Then set the param.scaffoldingPoints_correspondingVertexIndex} to represent the vertices bonded with each scaffolding point.
| void Mesh::set_spontaneous_curvature_for_face | ( | const double & | insertCurv, |
| const double & | spontCurv | ||
| ) |
Sets the spontaneous curvature for each face in the mesh.
This method sets the "spontaneous curvature" of each face in the mesh, which is a parameter used to describe the shape and behavior of lipid membranes. The spontaneous curvature can be different for faces inside and outside of an "insertion patch," which are specified by the insertCurv and spontCurv parameters, respectively.
The method takes two double parameters: insertCurv and spontCurv. The former specifies the spontaneous curvature for faces within the insertion patch, while the latter specifies the spontaneous curvature for faces outside of the insertion patch.
The method loops over all faces in the mesh and sets the spontCurvature member variable of each face to either insertCurv or spontCurv, depending on whether the face is part of the insertion patch or not.
| insertCurv | The spontaneous curvature for faces in the insertion patch |
| spontCurv | The spontaneous curvature for faces outside the insertion patch |
| void Mesh::set_vertices_faces_flat | ( | ) |
Set vertices and faces according to mesh and face side lengths in param for flat mesh. This also sets adjacent vertices of faces.
| void Mesh::setup_flat | ( | ) |
Initialize halfedges based on the mesh's vertices and faces.
Helper function to create a new halfedge.
| vertexIndex | Index of the vertex associated with the halfedge. |
| faceIndex | Index of the face associated with the halfedge. |
Initialize flat membrane with properities specified in the param} member variable. Equivalent to call: (1) this->set_axes_division_flat (2) this->set_vertices_faces_flat (3) this->set_adjacent_faces_of_vertices_sorted (4) this->determine_ghost_vertices_faces
| void Mesh::setup_from_vertices_faces | ( | const std::vector< std::vector< double > > & | verticesData, |
| const std::vector< std::vector< int > > & | facesData | ||
| ) |
Initialize membrane with arbitrary vertices and faces imported from files. Sets up the membrane from data and then call: (1) this->set_adjacent_faces_of_vertices_sorted (2) this->determine_ghost_vertices_faces.
| verticesData | 2D double vector containing the coordinates of vertices |
| facesData | 2D int vector containing the indices of vertices on each face |
| void Mesh::sort_vertices_on_faces | ( | ) |
Sort vertices on faces so that the unit normal vector indicates the orientation of the local patch of the membrane.
For example, if a face has vertices A->B->C, then the unit normal vector is calculated as AB x BC. This follows a "half-edge" data structure: if face ABC and face BCD shares edge BC, and ABC has vertices A->B->C, then on BCD, the edge sequence of BC needs to be reverse and therefore BCD has vertices C->B->D.
| void Mesh::sum_membrane_area_and_volume | ( | double & | area, |
| double & | volume | ||
| ) |
This function calculates the total membrane area and volume of non-ghost faces in a given set of faces.
| area | a reference to a double variable to store the computed area |
| volume | a reference to a double variable to store the computed volume |
| void Mesh::update_previous_coord_for_vertex | ( | ) |
This function updates the coordPrev member variable for each vertex in the mesh. It does this by copying the current value of coord to coordPrev.
| void Mesh::update_previous_energy_for_face | ( | ) |
Update the previous energy values for each face in the mesh.
The energyPrev member variable for each face is updated with the current value of energy.
| void Mesh::update_previous_force_for_vertex | ( | ) |
Update the previous force vectors for each vertex in the mesh.
The forcePrev member variable for each vertex is updated with the current value of force.
| void Mesh::update_reference_coord_from_previous_coord | ( | ) |
Update the reference coordinates for each vertex in the mesh.
The coordRef member variable for each vertex is updated with the current value of coordPrev.
| void Mesh::write_faces_csv | ( | const std::string & | outfile_name | ) |
Writes a csv file containing the adjacent vertices for each face in the mesh.
| outfile_name | The name of the output csv file |
| void Mesh::write_gag_scaffolding_state_dat | ( | const std::string & | outfile_name | ) | const |
Writes the current Gag scaffold state in a selected-complex style .dat layout.
| outfile_name | The name of the output .dat file |
| void Mesh::write_vertices_csv | ( | const std::string & | outfile_name | ) |
Writes a csv file containing the coordinates of each vertex in the mesh.
| outfile_name | The name of the output csv file |
| void Mesh::write_vertices_csv_with_type | ( | const std::string & | outfile_name | ) |
Writes a csv file containing the coordinates and types of each vertex in the mesh.
| outfile_name | The name of the output csv file |
|
friend |
Overrides the operator << in ostream.
| Matrix Mesh::centerScaffoldingSphere |
Center of the scaffolding cap sphere.
| std::vector<Face> Mesh::faces |
Vector to store all faces in the mesh.
| std::vector<Matrix> Mesh::forceOnScaffoldingPoints |
Per-point force used when propagating the scaffold.
| Matrix Mesh::forceTotalOnScaffolding |
Total force exerted on the scaffolding lattice.
| std::vector<GagAngle> Mesh::gagAngles |
Gag-specific COM angle list.
| std::vector<GagBond> Mesh::gagBonds |
Gag-specific COM bond list.
Initial lattice-to-membrane alignment rotation.
| std::vector<GagInteraction> Mesh::gagInteractions |
Gag pair interactions defined on rigid subunits.
| bool Mesh::gagScaffoldingTopologyInitialized = false |
Whether Gag-specific reference geometry has been initialized.
| std::vector<GagSubunit> Mesh::gagSubunits |
Gag rigid subunits whose COMs are the scaffolding points.
| std::vector<GagTorsion> Mesh::gagTorsions |
Gag-specific COM torsion list.
| Param& Mesh::param |
| Matrix Mesh::scaffoldingMovementVector |
Vector representing the movement of scaffolding over the course of simulation.
| std::vector<Vertex> Mesh::vertices |
Vector to store all vertices in the mesh.