PolyFEM
|
#include <LocalMesh.hpp>
Public Member Functions | |
LocalMesh (const M &m, const std::vector< Tuple > &element_tuples, const bool include_global_boundary) | |
int | num_local_vertices () const |
Number of vertices in the local mesh (not including extra global boundary vertices). | |
int | num_vertices () const |
Number of vertices in the local mesh. | |
int | num_elements () const |
Number of elements. | |
const Eigen::MatrixXd & | rest_positions () const |
Rest positions of the vertices. | |
const Eigen::MatrixXd & | positions () const |
Deformed positions of the vertices. | |
Eigen::MatrixXd | displacements () const |
Displacements of the vertices. | |
const Eigen::MatrixXd & | projection_quantities () const |
Projection quantaties for each vertex. | |
const Eigen::MatrixXi & | elements () const |
Elements in the local mesh. | |
const Eigen::MatrixXi & | boundary_edges () const |
Edged on the boundary. | |
const Eigen::MatrixXi & | boundary_faces () const |
Faces on the boundary (not set for TriMesh). | |
const std::unordered_map< int, int > & | global_to_local () const |
Map from global vertex index to local vertex index. | |
const std::vector< int > & | local_to_global () const |
Map from local vertex index to global vertex index. | |
const std::vector< int > & | fixed_vertices () const |
Fixed vertices. | |
const Remesher::BoundaryMap< int > & | boundary_ids () const |
Map from boundary elements (all edges for TriMesh or faces in TetMesh) to their boundary id. | |
const std::vector< int > & | body_ids () const |
One body id per element. | |
Eigen::MatrixXi & | boundary_facets () |
Get a reference to the boundary facets (edges in 2D or faces in 3D). | |
const Eigen::MatrixXi & | boundary_facets () const |
std::vector< polyfem::basis::ElementBases > | build_bases (const std::string &formulation) |
Build the ElementBases for the local mesh. | |
void | reorder_vertices (const Eigen::VectorXi &permutation) |
Reorder the vertices of the local mesh. | |
void | write_mesh (const std::string &path, const Eigen::MatrixXd &sol) const |
Write the local mesh to a VTU file. | |
Static Public Member Functions | |
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. | |
static std::vector< Tuple > | n_ring (const M &m, const std::vector< Tuple > &one_ring, const int n) |
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. | |
static std::vector< Tuple > | ball_selection (const M &m, const VectorNd ¢er, const double rel_radius, const int n_ring_size) |
Protected Types | |
using | Tuple = typename M::Tuple |
Protected Member Functions | |
void | remove_duplicate_fixed_vertices () |
void | init_local_to_global () |
void | init_vertex_attributes (const M &m) |
Protected Attributes | |
Eigen::MatrixXd | m_rest_positions |
Rest positions of the vertices. | |
Eigen::MatrixXd | m_positions |
Deformed positions of the vertices. | |
Eigen::MatrixXd | m_projection_quantities |
Projection quantaties for each vertex. | |
Eigen::MatrixXi | m_elements |
Elements in the local mesh. | |
Eigen::MatrixXi | m_boundary_edges |
Edged on the boundary. | |
Eigen::MatrixXi | m_boundary_faces |
Faces on the boundary (not set for TriMesh). | |
int | m_num_local_vertices |
Number of vertices in the local mesh (not including extra global boundary vertices). | |
std::unordered_map< int, int > | m_global_to_local |
Map from global vertex index to local vertex index. | |
std::vector< int > | m_local_to_global |
Map from local vertex index to global vertex index. | |
std::vector< int > | m_fixed_vertices |
Fixed vertices. | |
Remesher::BoundaryMap< int > | m_boundary_ids |
Map from boundary elements (all edges for TriMesh or faces in TetMesh) to their boundary id. | |
std::vector< int > | m_body_ids |
One body id per element. | |
Definition at line 12 of file LocalMesh.hpp.
|
protected |
Definition at line 15 of file LocalMesh.hpp.
polyfem::mesh::LocalMesh< M >::LocalMesh | ( | const M & | m, |
const std::vector< Tuple > & | element_tuples, | ||
const bool | include_global_boundary | ||
) |
Definition at line 49 of file LocalMesh.cpp.
References polyfem::utils::append_rows(), polyfem::mesh::Obstacle::e(), polyfem::mesh::Obstacle::f(), polyfem::mesh::Obstacle::n_edges(), polyfem::mesh::Obstacle::n_faces(), polyfem::mesh::Obstacle::n_vertices(), POLYFEM_REMESHER_SCOPED_TIMER, POLYFEM_SCOPED_TIMER, polyfem::mesh::unique_facet_tuples(), and polyfem::mesh::Obstacle::v().
|
static |
Definition at line 331 of file LocalMesh.cpp.
References polyfem::utils::are_aabbs_intersecting(), POLYFEM_REMESHER_SCOPED_TIMER, polyfem::utils::tetrahedron_intersects_ball(), and polyfem::utils::triangle_intersects_disk().
Referenced by polyfem::mesh::PhysicsRemesher< WMTKMesh >::local_mesh_tuples().
|
inline |
One body id per element.
Definition at line 83 of file LocalMesh.hpp.
References polyfem::mesh::LocalMesh< M >::m_body_ids.
|
inline |
Edged on the boundary.
Definition at line 66 of file LocalMesh.hpp.
References polyfem::mesh::LocalMesh< M >::m_boundary_edges.
|
inline |
Faces on the boundary (not set for TriMesh).
Definition at line 68 of file LocalMesh.hpp.
References polyfem::mesh::LocalMesh< M >::m_boundary_faces.
Eigen::MatrixXi & polyfem::mesh::LocalMesh< M >::boundary_facets | ( | ) |
Get a reference to the boundary facets (edges in 2D or faces in 3D).
Definition at line 467 of file LocalMesh.cpp.
const Eigen::MatrixXi & polyfem::mesh::LocalMesh< M >::boundary_facets | ( | ) | const |
Definition at line 476 of file LocalMesh.cpp.
|
inline |
Map from boundary elements (all edges for TriMesh or faces in TetMesh) to their boundary id.
Definition at line 80 of file LocalMesh.hpp.
References polyfem::mesh::LocalMesh< M >::m_boundary_ids.
std::vector< polyfem::basis::ElementBases > polyfem::mesh::LocalMesh< M >::build_bases | ( | const std::string & | formulation | ) |
Build the ElementBases for the local mesh.
formulation | Energy formulation. |
Definition at line 573 of file LocalMesh.cpp.
References polyfem::mesh::Remesher::build_bases(), polyfem::mesh::Mesh::create(), and POLYFEM_REMESHER_SCOPED_TIMER.
|
inline |
Displacements of the vertices.
Definition at line 58 of file LocalMesh.hpp.
References polyfem::mesh::LocalMesh< M >::m_positions, and polyfem::mesh::LocalMesh< M >::m_rest_positions.
|
inline |
Elements in the local mesh.
Definition at line 64 of file LocalMesh.hpp.
References polyfem::mesh::LocalMesh< M >::m_elements.
|
inline |
Fixed vertices.
Definition at line 77 of file LocalMesh.hpp.
References polyfem::mesh::LocalMesh< M >::m_fixed_vertices.
|
static |
Construct a local mesh as an n-ring around a vertex.
Definition at line 279 of file LocalMesh.cpp.
References POLYFEM_REMESHER_SCOPED_TIMER.
|
inline |
Map from global vertex index to local vertex index.
Definition at line 71 of file LocalMesh.hpp.
References polyfem::mesh::LocalMesh< M >::m_global_to_local.
|
protected |
Definition at line 493 of file LocalMesh.cpp.
|
protected |
Definition at line 504 of file LocalMesh.cpp.
|
inline |
Map from local vertex index to global vertex index.
Definition at line 74 of file LocalMesh.hpp.
References polyfem::mesh::LocalMesh< M >::m_local_to_global.
|
static |
Definition at line 230 of file LocalMesh.cpp.
References POLYFEM_REMESHER_SCOPED_TIMER.
|
static |
Construct a local mesh as an n-ring around a vertex.
Definition at line 223 of file LocalMesh.cpp.
|
inline |
Number of elements.
Definition at line 50 of file LocalMesh.hpp.
References polyfem::mesh::LocalMesh< M >::m_elements.
|
inline |
Number of vertices in the local mesh (not including extra global boundary vertices).
Definition at line 46 of file LocalMesh.hpp.
References polyfem::mesh::LocalMesh< M >::m_num_local_vertices.
|
inline |
Number of vertices in the local mesh.
Definition at line 48 of file LocalMesh.hpp.
References polyfem::mesh::LocalMesh< M >::m_rest_positions.
|
inline |
Deformed positions of the vertices.
Definition at line 55 of file LocalMesh.hpp.
References polyfem::mesh::LocalMesh< M >::m_positions.
|
inline |
Projection quantaties for each vertex.
Definition at line 61 of file LocalMesh.hpp.
References polyfem::mesh::LocalMesh< M >::m_projection_quantities.
|
protected |
Definition at line 485 of file LocalMesh.cpp.
void polyfem::mesh::LocalMesh< M >::reorder_vertices | ( | const Eigen::VectorXi & | permutation | ) |
Reorder the vertices of the local mesh.
permutation | Map from old vertex index to new vertex index. |
Definition at line 523 of file LocalMesh.cpp.
References polyfem::utils::map_index_matrix(), and polyfem::utils::reorder_matrix().
|
inline |
Rest positions of the vertices.
Definition at line 53 of file LocalMesh.hpp.
References polyfem::mesh::LocalMesh< M >::m_rest_positions.
void polyfem::mesh::LocalMesh< M >::write_mesh | ( | const std::string & | path, |
const Eigen::MatrixXd & | sol | ||
) | const |
Write the local mesh to a VTU file.
path | Filename to write to. |
sol | Solution to write to the file. |
Definition at line 607 of file LocalMesh.cpp.
References polyfem::utils::unflatten().
|
protected |
One body id per element.
Definition at line 144 of file LocalMesh.hpp.
Referenced by polyfem::mesh::LocalMesh< M >::body_ids().
|
protected |
Edged on the boundary.
Definition at line 123 of file LocalMesh.hpp.
Referenced by polyfem::mesh::LocalMesh< M >::boundary_edges().
|
protected |
Faces on the boundary (not set for TriMesh).
Definition at line 126 of file LocalMesh.hpp.
Referenced by polyfem::mesh::LocalMesh< M >::boundary_faces().
|
protected |
Map from boundary elements (all edges for TriMesh or faces in TetMesh) to their boundary id.
Definition at line 141 of file LocalMesh.hpp.
Referenced by polyfem::mesh::LocalMesh< M >::boundary_ids().
|
protected |
Elements in the local mesh.
Definition at line 120 of file LocalMesh.hpp.
Referenced by polyfem::mesh::LocalMesh< M >::elements(), and polyfem::mesh::LocalMesh< M >::num_elements().
|
protected |
Fixed vertices.
Definition at line 138 of file LocalMesh.hpp.
Referenced by polyfem::mesh::LocalMesh< M >::fixed_vertices().
|
protected |
Map from global vertex index to local vertex index.
Definition at line 132 of file LocalMesh.hpp.
Referenced by polyfem::mesh::LocalMesh< M >::global_to_local().
|
protected |
Map from local vertex index to global vertex index.
Definition at line 135 of file LocalMesh.hpp.
Referenced by polyfem::mesh::LocalMesh< M >::local_to_global().
|
protected |
Number of vertices in the local mesh (not including extra global boundary vertices).
Definition at line 129 of file LocalMesh.hpp.
Referenced by polyfem::mesh::LocalMesh< M >::num_local_vertices().
|
protected |
Deformed positions of the vertices.
Definition at line 114 of file LocalMesh.hpp.
Referenced by polyfem::mesh::LocalMesh< M >::displacements(), and polyfem::mesh::LocalMesh< M >::positions().
|
protected |
Projection quantaties for each vertex.
Definition at line 117 of file LocalMesh.hpp.
Referenced by polyfem::mesh::LocalMesh< M >::projection_quantities().
|
protected |
Rest positions of the vertices.
Definition at line 111 of file LocalMesh.hpp.
Referenced by polyfem::mesh::LocalMesh< M >::displacements(), polyfem::mesh::LocalMesh< M >::num_vertices(), and polyfem::mesh::LocalMesh< M >::rest_positions().