Class ComputeMesh#

Class Documentation#

class ComputeMesh

Class responsible for various mesh computations.

This class offers a variety of mesh-related calculations, ranging from vertex normals to mesh energy and stresses. It operates on a provided system of type SystemClass.

Energy and Force Measures

Provides methods to compute various energy, force, and stress-related properties for the mesh.

std::map<std::string, real> compute_mesh_energy(EvolverClass&)

Computes the total energy of the mesh.

Parameters:

evolver – Reference to the evolver object.

Returns:

A map containing different energy components and their respective values.

pymemb::vector<real3> compute_vertex_forces(EvolverClass&)

Computes forces on each vertex in the mesh.

Parameters:

evolver – Reference to the evolver object.

Returns:

A vector containing force vectors for each vertex.

realTensor compute_stresses(EvolverClass&, const bool&)

Computes the stress tensors for the mesh.

Parameters:
  • evolver – Reference to the evolver object.

  • flag – see cpp for more detail.

Returns:

Stress tensor for the mesh.

realTensor get_stresses(EvolverClass&, const bool&)

Retrieves the stress tensors for the mesh.

Parameters:
  • evolver – Reference to the evolver object.

  • flag – see cpp for more detail.

Returns:

Stress tensor for the mesh.

std::vector<real> compute_pressure(EvolverClass&)

Computes the pressure for the mesh using the provided evolver.

Parameters:

evolver – Reference to the evolver object.

Returns:

Vector containing pressure values.

realTensor compute_kinetic_energy_tensor(void)

Computes the kinetic energy tensor for the mesh.

Returns:

Kinetic energy tensor for the mesh.

real compute_kinetic_energy(void)

Computes the total kinetic energy of the mesh.

Returns:

Total kinetic energy of the mesh.

real compute_temperature(void)

Computes the temperature based on the current state of the mesh.

Returns:

Temperature of the mesh.

realTensor compute_stresses_virial(EvolverClass &evolver, const bool &computeForAllAtoms)

Computes the virial stresses for the mesh.

Parameters:
  • evolver – Reference to the evolver object guiding the mesh’s evolution.

  • computeForAllAtoms – Flag to determine whether to compute stresses for all atoms or a subset. Replace with actual flag description.

Returns:

Virial stress tensor for the mesh.

std::vector<realTensor> compute_stresses_atom(EvolverClass &evolver, const bool &computeForAllAtoms)

Computes the stresses for each atom in the mesh.

Parameters:
  • evolver – Reference to the evolver object guiding the mesh’s evolution.

  • computeForAllAtoms – Flag to determine whether to compute stresses for all atoms or a subset. Replace with actual flag description.

Returns:

Vector of stress tensors, one for each atom.

Public Functions

inline ComputeMesh(SystemClass &system)

Constructor that initializes the compute mesh with a system.

Parameters:

system – Reference to the system on which the computations will be made.

void compute_vertex_normals(bool vertex_normal_angle_weight = false)

Computes the normals for each vertex in the mesh.

Parameters:

vertex_normal_angle_weight – Flag to determine if the vertex normal should be angle weighted. Default is false.

void compute_face_normals(void)

Computes the normals for each face in the mesh.

pymemb::vector<real> compute_edge_lengths(void)

Computes the length of each edge in the mesh.

Returns:

A vector containing lengths for each edge.

real gaussiancurvature_vertex(const int &vertex_index)

Computes the Gaussian curvature at the vertex.

Computes the Gaussian curvature for the mesh.

real meancurvature_vertex(const int &vertex_index)

Computes the mean curvature at the vertex.

Computes the mean curvature for the mesh.

pymemb::vector<real> gaussiancurvature(void)

Computes the Gaussian curvature for the mesh.

pymemb::vector<real> meancurvature(void)

Computes the mean curvature for the mesh.

std::map<std::string, pymemb::vector<real>> compute_mesh_curvature(void)
pymemb::vector<pymemb::vector<real>> compute_face_metric(void)

Computes metrics related to each face in the mesh.

Returns:

A vector containing metrics for each face.

real compute_mesh_volume(void)

Computes the total volume of the mesh.

pymemb::vector<real> compute_face_area(void)

Computes the area of each face in the mesh.

Returns:

A vector containing areas for each face.

real compute_mesh_area(void)

Computes the total surface area of the mesh.

pymemb::vector<real> compute_vertex_area(void)

Computes the area associated with each vertex in the mesh.

Returns:

A vector containing areas for each vertex.