30#include <unordered_map>
61 std::array<double, 5>
assocAngles = {{0.0, 0.0, 0.0, 0.0, 0.0}};
94 std::array<double, 5>
assocAngles = {{0.0, 0.0, 0.0, 0.0, 0.0}};
152 Mesh(
const std::vector<Vertex> &srcVertices,
const std::vector<Face> &srcFaces,
Param &srcParam)
153 __attribute__((deprecated(
"Initialize with Mesh(Param &srcParam) and setup with setup_from_vertices_faces instead.")));
193 const std::vector<std::vector<int>>& facesData);
433 const double spontCurv,
528 double interpolateHeight(
double r,
const std::vector<double>& r_vals,
const std::vector<double>& h_vals);
532 std::vector<double>& r_vals,
533 std::vector<double>& h_vals);
654 const std::vector<GagSubunit> &subunits)
const;
This file defines the Energy class with scaffold extensions.
This file defines the face class, which is the triangular element defined by vertices.
The Force class defines corresponding force terms type. Note that all the forces are gsl matrices wit...
This file defines gauss quadrature and related functions.
This file defines essential parameters used in continuum membrane as well as membrane dynamics code....
This file defines the Vertex class which includes information of coordinate and forces exerted at a v...
A triangular mesh face element used in the membrane model.
Definition Face.hpp:29
Matrix used in continuum membrane model.
Definition Linear_algebra.hpp:65
A class representing a triangular mesh that defines a limit surface.
Definition Mesh.hpp:54
void set_scaffolding_insertion_curvature()
Sets insertion spontaneous curvature on faces adjacent to scaffold-bonded membrane vertices.
bool faces_share_edge(const Face &face1, const Face &face2)
Return true if two faces share edge.
Mesh(Param &srcParam)
Construct a new Mesh object with parameters. Initialize vertices and faces with other functions like ...
void calculate_element_area_volume()
Calculates the area and volume of each element in the mesh.
std::vector< GagSubunit > gagSubunits
Gag rigid subunits whose COMs are the scaffolding points.
Definition Mesh.hpp:128
double get_max_force_magnitude()
Get the max force scale of vertices.force.get_total_force_magnitude()
bool move_vertices_based_on_scaffolding(bool fixDir=true)
This method takes in the vector of spline point and calculate the average coordinates....
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 qua...
void update_previous_force_for_vertex()
Update the previous force vectors for each vertex 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 energy_force_regularization()
Calculates the regularization energy and force for each face.
void set_adjacent_vertices_of_vertices_sorted()
Set adjacentVertices of vertices based on current mesh.
void update_reference_coord_from_previous_coord()
Update the reference coordinates for each vertex in the mesh.
std::vector< Matrix > forceOnScaffoldingPoints
Per-point force used when propagating the scaffold.
Definition Mesh.hpp:123
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 t...
int findClosestRcap(double membraneCapRadius)
Matrix get_one_ring_vertex_matrix(const Face &face)
Private member used in calculating element area volume: Computes a matrix containing the coordinates ...
std::vector< Matrix > calculate_gag_subunit_translation_forces_fd()
Computes rigid-subunit COM translation forces from the Gag scaffold energy.
bool gagScaffoldingTopologyInitialized
Whether Gag-specific reference geometry has been initialized.
Definition Mesh.hpp:124
void manage_force_for_boundary_ghost_vertex()
Manages forces depending on different boundary conditions.
Matrix gagInitialAlignmentRotation
Initial lattice-to-membrane alignment rotation.
Definition Mesh.hpp:130
void write_faces_csv(const std::string &outfile_name)
Writes a csv file containing the adjacent vertices for each face in the mesh.
Matrix forceTotalOnScaffolding
Total force exerted on the scaffolding lattice.
Definition Mesh.hpp:121
std::vector< GagInteraction > gagInteractions
Gag pair interactions defined on rigid subunits.
Definition Mesh.hpp:129
std::vector< Vertex > vertices
Vector to store all vertices in the mesh.
Definition Mesh.hpp:116
void set_scaffolding_vertices_correspondence()
Get a vector of indexes of vertices that are closest to the scaffoldingPoints vector provided....
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.
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 f...
void determine_ghost_vertices_faces()
Iterate through vertices and faces and set the isGhost property of ghost vertices and face to true....
void update_previous_energy_for_face()
Update the previous energy values for each face in the mesh.
double interpolateHeight(double r, const std::vector< double > &r_vals, const std::vector< double > &h_vals)
std::vector< GagTorsion > gagTorsions
Gag-specific COM torsion list.
Definition Mesh.hpp:127
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 u...
friend std::ostream & operator<<(std::ostream &stream, const Mesh &mesh)
Overrides the operator << in ostream.
std::vector< GagAngle > gagAngles
Gag-specific COM angle list.
Definition Mesh.hpp:126
double calculate_gag_scaffolding_internal_energy() const
Calculates the internal Gag scaffold energy for the current COM positions.
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 ...
Matrix scaffoldingMovementVector
Vector representing the movement of scaffolding over the course of simulation.
Definition Mesh.hpp:122
void set_adjacent_faces_of_faces()
Set adjacentFaces properties of faces based on the current geometry of mesh.
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,...
double calculate_scaffolding_energy_force(bool doLocalSearch)
Calculates the energy and force due to the harmonic bond between scaffold points and membrane vertice...
std::vector< Face > faces
Vector to store all faces in the mesh.
Definition Mesh.hpp:117
void sort_vertices_on_faces()
Sort vertices on faces so that the unit normal vector indicates the orientation of the local patch of...
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 orientation...
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.
std::vector< GagBond > gagBonds
Gag-specific COM bond list.
Definition Mesh.hpp:125
Matrix centerScaffoldingSphere
Center of the scaffolding cap sphere.
Definition Mesh.hpp:120
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 m...
void loadMembraneShapeProfile(double membraneCapRadius, std::vector< double > &r_vals, std::vector< double > &h_vals)
bool propagate_scaffolding()
Propagate the scaffolding based on energy and force calculated from calculate_scaffolding_energy_forc...
bool pre_relax_gag_scaffolding()
Pre-relaxes the Gag scaffold using only internal Gag energy before membrane coupling is initialized.
double approximate_scaffolding_cap_radius(bool use_default)
Approximates the radius of the scaffolding cap.
void set_vertices_faces_flat()
Set vertices and faces according to mesh and face side lengths in param for flat mesh....
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 s...
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 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 face...
void update_previous_coord_for_vertex()
This function updates the coordPrev member variable for each vertex in the mesh. It does this by copy...
std::vector< Matrix > calculate_gag_scaffolding_forces_fd() const
Computes per-point Gag scaffold forces using finite differences on the internal energy.
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 ...
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.
Param & param
Object of the Param class containing all necessary parameters for building the Mesh object.
Definition Mesh.hpp:118
void set_spontaneous_curvature_for_face(const double &insertCurv, const double &spontCurv)
Sets the spontaneous curvature for each face in the mesh.
double calculate_mean_force()
Get the mean force magnitude on all vertices.
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...
std::vector< Matrix > calculate_gag_subunit_rotation_torques_fd()
Computes rigid-subunit rotational torques from the Gag scaffold energy.
void set_adjacent_faces_of_vertices_sorted()
Set adjacentFaces properties based on the current vertices and mesh. Sort the adjacent vertices so th...
void determine_boundary_vertices_faces()
Iterate through vertices and faces and set the isBoundary} property of boundary vertices and faces to...
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.
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.
void Compute_Energy_And_Force()
Computes the energy and force on each vertex and face of the mesh.
void setup_flat()
Initialize halfedges based on the mesh's vertices and faces.
Defines a vertex in Mesh.
Definition Vertex.hpp:45
int point1
Definition Mesh.hpp:99
double expectedAngle
Definition Mesh.hpp:102
int point2
Definition Mesh.hpp:100
int point3
Definition Mesh.hpp:101
int point2
Definition Mesh.hpp:67
std::string interface1
Definition Mesh.hpp:68
double expectedOmega
Definition Mesh.hpp:74
double expectedLength
Definition Mesh.hpp:70
int point1
Definition Mesh.hpp:66
std::string interface2
Definition Mesh.hpp:69
double thetaAtPoint2
Definition Mesh.hpp:72
double expectedPhi
Definition Mesh.hpp:73
double thetaAtPoint1
Definition Mesh.hpp:71
std::string interface1
Definition Mesh.hpp:91
std::array< double, 5 > assocAngles
Definition Mesh.hpp:94
int subunit1
Definition Mesh.hpp:89
int subunit2
Definition Mesh.hpp:90
std::string interface2
Definition Mesh.hpp:92
double expectedSigma
Definition Mesh.hpp:93
std::string interface1
Definition Mesh.hpp:58
std::string interface2
Definition Mesh.hpp:59
double sigma
Definition Mesh.hpp:60
std::array< double, 5 > assocAngles
Definition Mesh.hpp:61
std::unordered_map< std::string, Matrix > localInterfaces
Definition Mesh.hpp:82
Matrix localReferenceVector
Definition Mesh.hpp:83
int pointIndex
Definition Mesh.hpp:79
bool hasReferenceVector
Definition Mesh.hpp:84
int moleculeId
Definition Mesh.hpp:80
Matrix rotation
Definition Mesh.hpp:81
double expectedDihedral
Definition Mesh.hpp:111
int point1
Definition Mesh.hpp:107
double expectedOmega
Definition Mesh.hpp:113
int point2
Definition Mesh.hpp:108
int point4
Definition Mesh.hpp:110
double expectedPhi
Definition Mesh.hpp:112
int point3
Definition Mesh.hpp:109
Contains simulation parameters and physical constants.
Definition Parameters.hpp:117