15 using Tuple =
typename M::Tuple;
20 const std::vector<Tuple> &element_tuples,
21 const bool include_global_boundary);
24 static std::vector<Tuple>
n_ring(
28 static std::vector<Tuple>
n_ring(
30 const std::vector<Tuple> &one_ring,
42 const double rel_radius,
43 const int n_ring_size);
94 std::vector<polyfem::basis::ElementBases>
build_bases(
const std::string &formulation);
103 void write_mesh(
const std::string &path,
const Eigen::MatrixXd &sol)
const;
void write_mesh(const std::string &path, const Eigen::MatrixXd &sol) const
Write the local mesh to a VTU file.
const std::vector< int > & local_to_global() const
Map from local vertex index to global vertex index.
Eigen::MatrixXd m_positions
Deformed positions of the vertices.
Eigen::MatrixXd displacements() const
Displacements of the vertices.
std::vector< polyfem::basis::ElementBases > build_bases(const std::string &formulation)
Build the ElementBases for the local mesh.
void init_vertex_attributes(const M &m)
const Eigen::MatrixXd & projection_quantities() const
Projection quantaties for each vertex.
const Eigen::MatrixXd & rest_positions() const
Rest positions of the vertices.
Eigen::MatrixXd m_projection_quantities
Projection quantaties for each vertex.
int num_vertices() const
Number of vertices in the local mesh.
const std::unordered_map< int, int > & global_to_local() const
Map from global vertex index to local vertex index.
Remesher::BoundaryMap< int > m_boundary_ids
Map from boundary elements (all edges for TriMesh or faces in TetMesh) to their boundary id.
std::unordered_map< int, int > m_global_to_local
Map from global vertex index to local vertex index.
static std::vector< Tuple > n_ring(const M &m, const Tuple ¢er, const int n)
Construct a local mesh as an n-ring around a vertex.
const Remesher::BoundaryMap< int > & boundary_ids() const
Map from boundary elements (all edges for TriMesh or faces in TetMesh) to their boundary id.
static std::vector< Tuple > flood_fill_n_ring(const M &m, const Tuple ¢er, const double area)
Construct a local mesh as an n-ring around a vertex.
Eigen::MatrixXi & boundary_facets()
Get a reference to the boundary facets (edges in 2D or faces in 3D).
int m_num_local_vertices
Number of vertices in the local mesh (not including extra global boundary vertices).
Eigen::MatrixXi m_boundary_faces
Faces on the boundary (not set for TriMesh).
const std::vector< int > & fixed_vertices() const
Fixed vertices.
const Eigen::MatrixXd & positions() const
Deformed positions of the vertices.
void reorder_vertices(const Eigen::VectorXi &permutation)
Reorder the vertices of the local mesh.
std::vector< int > m_local_to_global
Map from local vertex index to global vertex index.
std::vector< int > m_body_ids
One body id per element.
const Eigen::MatrixXi & boundary_edges() const
Edged on the boundary.
int num_local_vertices() const
Number of vertices in the local mesh (not including extra global boundary vertices).
const Eigen::MatrixXi & boundary_faces() const
Faces on the boundary (not set for TriMesh).
Eigen::MatrixXd m_rest_positions
Rest positions of the vertices.
void remove_duplicate_fixed_vertices()
Eigen::MatrixXi m_boundary_edges
Edged on the boundary.
const Eigen::MatrixXi & elements() const
Elements in the local mesh.
int num_elements() const
Number of elements.
const std::vector< int > & body_ids() const
One body id per element.
void init_local_to_global()
Eigen::MatrixXi m_elements
Elements in the local mesh.
static std::vector< Tuple > ball_selection(const M &m, const VectorNd ¢er, const double rel_radius, const int n_ring_size)
std::vector< int > m_fixed_vertices
Fixed vertices.
std::variant< EdgeMap< T >, FaceMap< T > > BoundaryMap
Eigen::Matrix< double, Eigen::Dynamic, 1, 0, 3, 1 > VectorNd