PolyFEM
|
Abstract mesh class to capture 2d/3d conforming and non-conforming meshes. More...
#include <Mesh.hpp>
Classes | |
class | CellNodes |
Class to store the high-order cells nodes. More... | |
class | EdgeNodes |
Class to store the high-order edge nodes. More... | |
class | FaceNodes |
Class to store the high-order face nodes. More... | |
Public Member Functions | |
virtual std::unique_ptr< Mesh > | copy () const =0 |
Create a copy of the mesh. | |
virtual | ~Mesh ()=default |
Destroy the Mesh object. | |
Mesh (Mesh &&)=default | |
Construct a new Mesh object. | |
Mesh & | operator= (Mesh &&)=default |
Copy constructor. | |
Mesh (const Mesh &)=default | |
Construct a new Mesh object. | |
Mesh & | operator= (const Mesh &)=default |
virtual void | refine (const int n_refinement, const double t)=0 |
refine the mesh | |
virtual bool | is_volume () const =0 |
checks if mesh is volume | |
int | dimension () const |
utily for dimension | |
virtual bool | is_conforming () const =0 |
if the mesh is conforming | |
int | n_elements () const |
utitlity to return the number of elements, cells or faces in 3d and 2d | |
int | n_boundary_elements () const |
utitlity to return the number of boundary elements, faces or edges in 3d and 2d | |
virtual int | n_cells () const =0 |
number of cells | |
virtual int | n_faces () const =0 |
number of faces | |
virtual int | n_edges () const =0 |
number of edges | |
virtual int | n_vertices () const =0 |
number of vertices | |
virtual int | n_face_vertices (const int f_id) const =0 |
number of vertices of a face | |
virtual int | n_cell_vertices (const int c_id) const =0 |
number of vertices of a cell | |
virtual int | edge_vertex (const int e_id, const int lv_id) const =0 |
id of the edge vertex | |
virtual int | face_vertex (const int f_id, const int lv_id) const =0 |
id of the face vertex | |
virtual int | cell_vertex (const int f_id, const int lv_id) const =0 |
id of the vertex of a cell | |
int | element_vertex (const int el_id, const int lv_id) const |
id of the vertex of a element | |
std::vector< int > | element_vertices (const int el_id) const |
list of vids of an element | |
int | boundary_element_vertex (const int primitive_id, const int lv_id) const |
virtual bool | is_boundary_vertex (const int vertex_global_id) const =0 |
is vertex boundary | |
virtual bool | is_boundary_edge (const int edge_global_id) const =0 |
is edge boundary | |
virtual bool | is_boundary_face (const int face_global_id) const =0 |
is face boundary | |
virtual bool | is_boundary_element (const int element_global_id) const =0 |
is cell boundary | |
virtual bool | save (const std::string &path) const =0 |
virtual void | attach_higher_order_nodes (const Eigen::MatrixXd &V, const std::vector< std::vector< int > > &nodes)=0 |
attach high order nodes | |
const Eigen::MatrixXi & | orders () const |
order of each element | |
bool | is_rational () const |
check if curved mesh has rational polynomials elements | |
void | set_is_rational (const bool in_is_rational) |
Set the is rational object. | |
virtual void | normalize ()=0 |
normalize the mesh | |
virtual void | compute_elements_tag ()=0 |
compute element types, see ElementType | |
virtual void | update_elements_tag () |
Update elements types. | |
virtual double | edge_length (const int gid) const |
edge length | |
virtual double | quad_area (const int gid) const |
area of a quad face of an hex mesh | |
virtual double | tri_area (const int gid) const |
area of a tri face of a tet mesh | |
virtual RowVectorNd | point (const int global_index) const =0 |
point coordinates | |
virtual void | set_point (const int global_index, const RowVectorNd &p)=0 |
Set the point. | |
virtual RowVectorNd | edge_barycenter (const int e) const =0 |
edge barycenter | |
virtual RowVectorNd | face_barycenter (const int f) const =0 |
face barycenter | |
virtual RowVectorNd | cell_barycenter (const int c) const =0 |
cell barycenter | |
void | edge_barycenters (Eigen::MatrixXd &barycenters) const |
all edges barycenters | |
void | face_barycenters (Eigen::MatrixXd &barycenters) const |
all face barycenters | |
void | cell_barycenters (Eigen::MatrixXd &barycenters) const |
all cells barycenters | |
virtual void | compute_element_barycenters (Eigen::MatrixXd &barycenters) const =0 |
utility for 2d/3d. | |
virtual void | elements_boxes (std::vector< std::array< Eigen::Vector3d, 2 > > &boxes) const =0 |
constructs a box around every element (3d cell, 2d face) | |
virtual void | barycentric_coords (const RowVectorNd &p, const int el_id, Eigen::MatrixXd &coord) const =0 |
constructs barycentric coodiantes for a point p. | |
virtual void | bounding_box (RowVectorNd &min, RowVectorNd &max) const =0 |
computes the bbox of the mesh | |
bool | is_spline_compatible (const int el_id) const |
checks if element is spline compatible | |
bool | is_cube (const int el_id) const |
checks if element is cube compatible | |
bool | is_polytope (const int el_id) const |
checks if element is polygon compatible | |
bool | is_simplex (const int el_id) const |
checks if element is simples compatible | |
const std::vector< ElementType > & | elements_tag () const |
Returns the elements types. | |
void | set_tag (const int el, const ElementType type) |
changes the element type | |
void | compute_node_ids (const std::function< int(const size_t, const RowVectorNd &, bool)> &marker) |
computes boundary selections based on a function | |
virtual void | load_boundary_ids (const std::string &path) |
loads the boundary selections for a file | |
virtual void | compute_boundary_ids (const std::function< int(const size_t, const std::vector< int > &, const RowVectorNd &, bool)> &marker)=0 |
computes boundary selections based on a function | |
virtual void | compute_body_ids (const std::function< int(const size_t, const std::vector< int > &, const RowVectorNd &)> &marker)=0 |
computes boundary selections based on a function | |
virtual void | set_boundary_ids (const std::vector< int > &boundary_ids) |
Set the boundary selection from a vector. | |
virtual void | set_body_ids (const std::vector< int > &body_ids) |
Set the volume sections. | |
virtual int | get_default_boundary_id (const int primitive) const |
Get the default boundary selection of an element (face in 3d, edge in 2d) | |
virtual int | get_boundary_id (const int primitive) const |
Get the boundary selection of an element (face in 3d, edge in 2d) | |
virtual int | get_node_id (const int node_id) const |
Get the boundary selection of a node. | |
void | update_nodes (const Eigen::VectorXi &in_node_to_node) |
Update the node ids to reorder them. | |
virtual int | get_body_id (const int primitive) const |
Get the volume selection of an element (cell in 3d, face in 2d) | |
virtual const std::vector< int > & | get_body_ids () const |
Get the volume selection of all elements (cells in 3d, faces in 2d) | |
bool | has_node_ids () const |
checks if points selections are available | |
bool | has_boundary_ids () const |
checks if surface selections are available | |
virtual bool | has_body_ids () const |
checks if volumes selections are available | |
virtual void | get_edges (Eigen::MatrixXd &p0, Eigen::MatrixXd &p1) const =0 |
Get all the edges. | |
virtual void | get_edges (Eigen::MatrixXd &p0, Eigen::MatrixXd &p1, const std::vector< bool > &valid_elements) const =0 |
Get all the edges according to valid_elements selection. | |
const std::vector< double > & | cell_weights (const int cell_index) const |
weights for rational polynomial meshes | |
void | set_cell_weights (const std::vector< std::vector< double > > &in_cell_weights) |
Set the cell weights for rational polynomial meshes. | |
virtual void | prepare_mesh () |
method used to finalize the mesh. | |
bool | has_poly () const |
checks if the mesh has polytopes | |
bool | is_simplicial () const |
checks if the mesh is simplicial | |
bool | is_linear () const |
check if the mesh is linear | |
std::vector< std::pair< int, int > > | edges () const |
list of sorted edges. | |
std::vector< std::vector< int > > | faces () const |
list of sorted faces. | |
std::unordered_map< std::pair< int, int >, size_t, polyfem::utils::HashPair > | edges_to_ids () const |
map from edge (pair of v id) to the id of the edge | |
std::unordered_map< std::vector< int >, size_t, polyfem::utils::HashVector > | faces_to_ids () const |
map from face (tuple of v id) to the id of the face | |
const Eigen::VectorXi & | in_ordered_vertices () const |
Order of the input vertices. | |
const Eigen::MatrixXi & | in_ordered_edges () const |
Order of the input edges. | |
const Eigen::MatrixXi & | in_ordered_faces () const |
Order of the input edges. | |
virtual void | append (const Mesh &mesh) |
appends a new mesh to the end of this | |
void | append (const std::unique_ptr< Mesh > &mesh) |
appends a new mesh to the end of this, utility that takes pointer, calls other one | |
void | apply_affine_transformation (const MatrixNd &A, const VectorNd &b) |
Apply an affine transformation \(Ax+b\) to the vertex positions \(x\). | |
Static Public Member Functions | |
static std::unique_ptr< Mesh > | create (const std::string &path, const bool non_conforming=false) |
factory to build the proper mesh | |
static std::unique_ptr< Mesh > | create (GEO::Mesh &M, const bool non_conforming=false) |
factory to build the proper mesh | |
static std::unique_ptr< Mesh > | create (const Eigen::MatrixXd &vertices, const Eigen::MatrixXi &cells, const bool non_conforming=false) |
factory to build the proper mesh | |
static std::unique_ptr< Mesh > | create (const int dim, const bool non_conforming=false) |
factory to build the proper empty mesh | |
Protected Member Functions | |
Mesh ()=default | |
Construct a new Mesh object. | |
virtual bool | load (const std::string &path)=0 |
loads a mesh from the path | |
virtual bool | load (const GEO::Mesh &M)=0 |
loads a mesh from a geo mesh | |
Protected Attributes | |
std::vector< ElementType > | elements_tag_ |
list of element types | |
std::vector< int > | node_ids_ |
list of node labels | |
std::vector< int > | boundary_ids_ |
list of surface labels | |
std::vector< int > | body_ids_ |
list of volume labels | |
Eigen::MatrixXi | orders_ |
list of geometry orders, one per cell | |
bool | is_rational_ = false |
stores if the mesh is rational | |
std::vector< EdgeNodes > | edge_nodes_ |
high-order nodes associates to edges | |
std::vector< FaceNodes > | face_nodes_ |
high-order nodes associates to faces | |
std::vector< CellNodes > | cell_nodes_ |
high-order nodes associates to cells | |
std::vector< std::vector< double > > | cell_weights_ |
weights associates to cells for rational polynomail meshes | |
Eigen::VectorXi | in_ordered_vertices_ |
Order of the input vertices. | |
Eigen::MatrixXi | in_ordered_edges_ |
Order of the input edges. | |
Eigen::MatrixXi | in_ordered_faces_ |
Order of the input faces, TODO: change to std::vector of Eigen::Vector. | |
Private Member Functions | |
virtual bool | build_from_matrices (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F)=0 |
build a mesh from matrices | |
Abstract mesh class to capture 2d/3d conforming and non-conforming meshes.
|
protecteddefault |
Construct a new Mesh object.
|
virtualdefault |
Destroy the Mesh object.
|
virtual |
appends a new mesh to the end of this
[in] | mesh | to append |
Reimplemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
Definition at line 494 of file Mesh.cpp.
References polyfem::utils::append_rows(), body_ids_, boundary_ids_, cell_nodes_, cell_weights_, edge_nodes_, elements_tag_, face_nodes_, get_boundary_id(), get_default_boundary_id(), get_node_id(), has_body_ids(), has_boundary_ids(), has_node_ids(), in_ordered_edges_, in_ordered_faces_, in_ordered_vertices_, is_rational_, n_boundary_elements(), n_elements(), n_vertices(), node_ids_, and orders_.
Referenced by polyfem::mesh::CMesh2D::append(), polyfem::mesh::NCMesh2D::append(), polyfem::mesh::CMesh3D::append(), polyfem::mesh::NCMesh3D::append(), and append().
|
inline |
Apply an affine transformation \(Ax+b\) to the vertex positions \(x\).
[in] | A | Multiplicative matrix component of transformation |
[in] | b | Additive translation component of transformation |
Definition at line 632 of file Mesh.cpp.
References cell_nodes_, edge_nodes_, face_nodes_, n_vertices(), point(), and set_point().
|
pure virtual |
attach high order nodes
[in] | V | nodes |
[in] | nodes | list of nodes per element |
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
|
pure virtual |
constructs barycentric coodiantes for a point p.
WARNING works only for simplices
[in] | p | query point |
[in] | el_id | element id |
[out] | coord | matrix containing the barycentric coodinates |
Implemented in polyfem::mesh::Mesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::Mesh3D.
Referenced by polyfem::io::OutGeometryData::build_grid().
|
inline |
Definition at line 238 of file Mesh.hpp.
References edge_vertex(), face_vertex(), and is_volume().
|
pure virtual |
computes the bbox of the mesh
[out] | min | min coodiante |
[out] | max | max coodiante |
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
Referenced by polyfem::io::OutGeometryData::build_grid(), polyfem::solver::OperatorSplittingSolver::initialize_mesh(), and polyfem::solver::LinearFilter::LinearFilter().
|
privatepure virtual |
build a mesh from matrices
[in] | V | vertices |
[in] | F | connectivity |
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
|
pure virtual |
cell barycenter
[in] | c | global cell index |
Implemented in polyfem::mesh::CMesh3D, polyfem::mesh::NCMesh3D, and polyfem::mesh::Mesh2D.
Referenced by cell_barycenters(), polyfem::mesh::Mesh3D::cell_node(), polyfem::solver::ElasticVariableToSimulation::inverse_eval(), and polyfem::mesh::MeshNodes::node_id_from_primitive().
void polyfem::mesh::Mesh::cell_barycenters | ( | Eigen::MatrixXd & | barycenters | ) | const |
all cells barycenters
[out] | barycenters |
Definition at line 320 of file Mesh.cpp.
References cell_barycenter(), dimension(), and n_cells().
Referenced by polyfem::mesh::Mesh3D::compute_element_barycenters(), and polyfem::solver::LinearFilter::LinearFilter().
|
pure virtual |
id of the vertex of a cell
[in] | f_id | global cell id |
[in] | lv_id | local vertex id |
Implemented in polyfem::mesh::CMesh3D, polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, and polyfem::mesh::NCMesh3D.
Referenced by polyfem::solver::OperatorSplittingSolver::advection_PIC(), element_vertex(), polyfem::mesh::Mesh3D::elements_boxes(), polyfem::solver::OperatorSplittingSolver::initialize_mesh(), polyfem::refinement::APriori::p_refine(), and polyfem::io::MshWriter::write().
|
inline |
weights for rational polynomial meshes
[in] | cell_index | index of the cell |
Definition at line 550 of file Mesh.hpp.
References cell_weights_.
|
pure virtual |
computes boundary selections based on a function
[in] | marker | lambda function that takes the id and barycenter and returns an integer |
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
|
pure virtual |
computes boundary selections based on a function
[in] | marker | lambda function that takes the id, the list of vertices, the barycenter, and true/false if the element is on the boundary and returns an integer |
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
|
pure virtual |
utility for 2d/3d.
In 2d it returns face_barycenters, in 3d it returns cell_barycenters
[out] | barycenters | the barycenters |
Implemented in polyfem::mesh::Mesh2D, and polyfem::mesh::Mesh3D.
|
pure virtual |
compute element types, see ElementType
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
void polyfem::mesh::Mesh::compute_node_ids | ( | const std::function< int(const size_t, const RowVectorNd &, bool)> & | marker | ) |
computes boundary selections based on a function
[in] | marker | lambda function that takes the node id, the position, and true/false if the element is on the boundary and returns an integer |
Definition at line 387 of file Mesh.cpp.
References is_boundary_vertex(), n_vertices(), node_ids_, and point().
|
pure virtual |
Create a copy of the mesh.
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
|
static |
|
static |
|
static |
factory to build the proper mesh
[in] | path | mesh path |
[in] | non_conforming | yes or no for non conforming mesh |
Definition at line 173 of file Mesh.cpp.
References create(), polyfem::utils::StringUtils::endswith(), polyfem::io::MshReader::load(), and polyfem::logger().
Referenced by polyfem::mesh::LocalMesh< M >::build_bases(), create(), create(), create(), polyfem::mesh::LocalRelaxationData< M >::init_mesh(), polyfem::State::load_mesh(), polyfem::State::load_mesh(), polyfem::mesh::Remesher::project_quantities(), polyfem::mesh::read_fem_mesh(), and polyfem::State::remesh().
|
static |
factory to build the proper mesh
[in] | M | geo mesh |
[in] | non_conforming | yes or no for non conforming mesh |
Definition at line 98 of file Mesh.cpp.
References create(), polyfem::mesh::generate_edges(), polyfem::mesh::is_planar(), and polyfem::logger().
|
inline |
utily for dimension
Definition at line 151 of file Mesh.hpp.
References is_volume().
Referenced by polyfem::io::Evaluator::average_grad_based_function(), polyfem::mesh::Remesher::build_bases(), polyfem::io::OutGeometryData::build_high_order_vis_mesh(), polyfem::io::OutGeometryData::build_vis_mesh(), cell_barycenters(), polyfem::io::OutStatsData::compute_errors(), polyfem::io::Evaluator::compute_stress_at_quadrature_points(), polyfem::io::Evaluator::compute_tensor_value(), polyfem::assembler::GenericTensorProblem::dirichlet_bc(), polyfem::problem::ElasticProblem::dirichlet_bc(), polyfem::problem::TorsionElasticProblem::dirichlet_bc(), polyfem::problem::DoubleTorsionElasticProblem::dirichlet_bc(), polyfem::problem::ElasticProblemZeroBC::dirichlet_bc(), polyfem::problem::WalkProblem::dirichlet_bc(), polyfem::problem::PointBasedTensorProblem::dirichlet_bc(), polyfem::assembler::GenericTensorProblem::dirichlet_nodal_value(), edge_barycenters(), polyfem::io::OutGeometryData::export_data(), face_barycenters(), polyfem::solver::BodyForm::force_shape_derivative(), polyfem::solver::OperatorSplittingSolver::initialize_mesh(), polyfem::io::Evaluator::interpolate_at_local_vals(), polyfem::io::Evaluator::interpolate_at_local_vals(), polyfem::io::Evaluator::interpolate_function(), polyfem::assembler::RhsAssembler::lsq_bc(), polyfem::io::Evaluator::mark_flipped_cells(), polyfem::mesh::MeshNodes::MeshNodes(), polyfem::assembler::GenericTensorProblem::neumann_bc(), polyfem::problem::ElasticCantileverExact::neumann_bc(), polyfem::problem::PointBasedTensorProblem::neumann_bc(), polyfem::assembler::RhsAssembler::sample_bc(), polyfem::io::OutGeometryData::save_contact_surface(), polyfem::io::OutStatsData::save_json(), polyfem::io::OutGeometryData::save_points(), polyfem::io::OutGeometryData::save_surface(), polyfem::io::OutGeometryData::save_volume(), polyfem::io::OutGeometryData::save_wire(), polyfem::assembler::Problem::setup_bc(), and polyfem::io::MshWriter::write().
|
pure virtual |
edge barycenter
[in] | e | global edge index |
Implemented in polyfem::mesh::CMesh3D, polyfem::mesh::NCMesh3D, polyfem::mesh::CMesh2D, and polyfem::mesh::NCMesh2D.
Referenced by edge_barycenters(), and polyfem::mesh::MeshNodes::node_id_from_primitive().
void polyfem::mesh::Mesh::edge_barycenters | ( | Eigen::MatrixXd & | barycenters | ) | const |
all edges barycenters
[out] | barycenters |
Definition at line 302 of file Mesh.cpp.
References dimension(), edge_barycenter(), and n_edges().
|
inlinevirtual |
edge length
[in] | gid | global edge id |
Reimplemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, and polyfem::mesh::NCMesh3D.
Definition at line 306 of file Mesh.hpp.
Referenced by polyfem::utils::BoundarySampler::quadrature_for_polygon_edge(), polyfem::utils::BoundarySampler::quadrature_for_quad_edge(), polyfem::utils::BoundarySampler::quadrature_for_tri_edge(), and polyfem::io::OutGeometryData::save_surface().
|
pure virtual |
id of the edge vertex
[in] | e_id | global edge id |
[in] | lv_id | local vertex index |
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
Referenced by boundary_element_vertex(), edges(), edges_to_ids(), polyfem::mesh::Mesh2D::get_edges(), polyfem::mesh::Mesh3D::get_edges(), and polyfem::mesh::Mesh3D::get_edges().
std::vector< std::pair< int, int > > polyfem::mesh::Mesh::edges | ( | ) | const |
list of sorted edges.
Used to map to input vertices
Definition at line 427 of file Mesh.cpp.
References edge_vertex(), and n_edges().
Referenced by create().
std::unordered_map< std::pair< int, int >, size_t, HashPair > polyfem::mesh::Mesh::edges_to_ids | ( | ) | const |
map from edge (pair of v id) to the id of the edge
Definition at line 459 of file Mesh.cpp.
References edge_vertex(), and n_edges().
|
inline |
id of the vertex of a element
[in] | el_id | global element id |
[in] | lv_id | local vertex id |
Definition at line 220 of file Mesh.hpp.
References cell_vertex(), face_vertex(), and is_volume().
Referenced by element_vertices().
|
inline |
list of vids of an element
[in] | el_id | global element id |
Definition at line 229 of file Mesh.hpp.
References element_vertex(), and n_cell_vertices().
Referenced by polyfem::mesh::CMesh2D::compute_body_ids(), polyfem::mesh::NCMesh2D::compute_body_ids(), polyfem::mesh::CMesh3D::compute_body_ids(), and polyfem::mesh::NCMesh3D::compute_body_ids().
|
pure virtual |
constructs a box around every element (3d cell, 2d face)
[out] | boxes | axis aligned bounding boxes |
Implemented in polyfem::mesh::Mesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::Mesh3D.
Referenced by polyfem::io::OutGeometryData::build_grid().
|
inline |
Returns the elements types.
Definition at line 415 of file Mesh.hpp.
References elements_tag_.
Referenced by polyfem::io::OutStatsData::compute_mesh_stats(), polyfem::io::OutStatsData::count_flipped_elements(), and polyfem::mesh::CMesh3D::refine().
|
pure virtual |
face barycenter
[in] | f | global face index |
Implemented in polyfem::mesh::CMesh3D, polyfem::mesh::NCMesh3D, and polyfem::mesh::Mesh2D.
Referenced by face_barycenters(), polyfem::io::Evaluator::interpolate_boundary_function(), and polyfem::mesh::MeshNodes::node_id_from_primitive().
void polyfem::mesh::Mesh::face_barycenters | ( | Eigen::MatrixXd & | barycenters | ) | const |
all face barycenters
[out] | barycenters |
Definition at line 311 of file Mesh.cpp.
References dimension(), face_barycenter(), and n_faces().
Referenced by polyfem::mesh::Mesh2D::compute_element_barycenters(), and polyfem::solver::LinearFilter::LinearFilter().
|
pure virtual |
id of the face vertex
[in] | f_id | global face id |
[in] | lv_id | local vertex index |
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
Referenced by boundary_element_vertex(), polyfem::basis::BarycentricBasis2d::build_bases(), element_vertex(), faces(), faces_to_ids(), polyfem::refinement::APriori::p_refine(), polyfem::mesh::to_geogram_mesh(), and polyfem::mesh::Mesh3D::tri_area().
std::vector< std::vector< int > > polyfem::mesh::Mesh::faces | ( | ) | const |
list of sorted faces.
Used to map to input vertices
Definition at line 443 of file Mesh.cpp.
References face_vertex(), n_face_vertices(), and n_faces().
Referenced by polyfem::mesh::CMesh3D::attach_higher_order_nodes().
std::unordered_map< std::vector< int >, size_t, HashVector > polyfem::mesh::Mesh::faces_to_ids | ( | ) | const |
map from face (tuple of v id) to the id of the face
Definition at line 475 of file Mesh.cpp.
References face_vertex(), n_face_vertices(), and n_faces().
|
inlinevirtual |
Get the volume selection of an element (cell in 3d, face in 2d)
[in] | primitive | element id |
Reimplemented in polyfem::mesh::NCMesh2D, and polyfem::mesh::NCMesh3D.
Definition at line 501 of file Mesh.hpp.
References body_ids_, and has_body_ids().
Referenced by polyfem::solver::PerBody2PerElem::apply_jacobian(), polyfem::solver::PerBody2PerElem::eval(), polyfem::assembler::GenericTensorProblem::initial_acceleration(), polyfem::assembler::GenericTensorProblem::initial_solution(), polyfem::assembler::GenericScalarProblem::initial_solution(), polyfem::assembler::GenericTensorProblem::initial_velocity(), polyfem::solver::PerBody2PerElem::PerBody2PerElem(), polyfem::solver::PerBody2PerNode::PerBody2PerNode(), polyfem::io::OutGeometryData::save_surface(), and polyfem::io::OutGeometryData::save_volume().
|
inlinevirtual |
Get the volume selection of all elements (cells in 3d, faces in 2d)
Definition at line 510 of file Mesh.hpp.
References body_ids_.
Referenced by polyfem::io::MshWriter::write().
|
inlinevirtual |
Get the boundary selection of an element (face in 3d, edge in 2d)
[in] | primitive | element id |
Reimplemented in polyfem::mesh::NCMesh2D, and polyfem::mesh::NCMesh3D.
Definition at line 475 of file Mesh.hpp.
References boundary_ids_, get_default_boundary_id(), and has_boundary_ids().
Referenced by append(), polyfem::assembler::RhsAssembler::compute_energy_hess(), polyfem::assembler::GenericTensorProblem::dirichlet_bc(), polyfem::assembler::GenericScalarProblem::dirichlet_bc(), polyfem::problem::ElasticProblem::dirichlet_bc(), polyfem::problem::TorsionElasticProblem::dirichlet_bc(), polyfem::problem::DoubleTorsionElasticProblem::dirichlet_bc(), polyfem::problem::ElasticProblemZeroBC::dirichlet_bc(), polyfem::problem::WalkProblem::dirichlet_bc(), polyfem::problem::NodeProblem::dirichlet_bc(), polyfem::problem::PointBasedTensorProblem::dirichlet_bc(), polyfem::problem::ConstantVelocity::dirichlet_bc(), polyfem::problem::DrivenCavity::dirichlet_bc(), polyfem::problem::DrivenCavityC0::dirichlet_bc(), polyfem::problem::DrivenCavitySmooth::dirichlet_bc(), polyfem::problem::Flow::dirichlet_bc(), polyfem::problem::FlowWithObstacle::dirichlet_bc(), polyfem::problem::CornerFlow::dirichlet_bc(), polyfem::problem::Lshape::dirichlet_bc(), polyfem::problem::UnitFlowWithObstacle::dirichlet_bc(), polyfem::problem::StokesLawProblem::dirichlet_bc(), polyfem::problem::Airfoil::dirichlet_bc(), polyfem::assembler::RhsAssembler::lsq_bc(), polyfem::assembler::GenericTensorProblem::neumann_bc(), polyfem::assembler::GenericScalarProblem::neumann_bc(), polyfem::problem::ElasticCantileverExact::neumann_bc(), polyfem::problem::NodeProblem::neumann_bc(), polyfem::problem::PointBasedTensorProblem::neumann_bc(), polyfem::assembler::GenericTensorProblem::pressure_bc(), polyfem::assembler::RhsAssembler::sample_bc(), polyfem::io::OutGeometryData::save_surface(), and polyfem::assembler::Problem::setup_bc().
|
inlinevirtual |
Get the default boundary selection of an element (face in 3d, edge in 2d)
[in] | primitive | element id |
Definition at line 463 of file Mesh.hpp.
References is_boundary_edge(), is_boundary_face(), and is_volume().
Referenced by append(), and get_boundary_id().
|
pure virtual |
Get all the edges.
[out] | p0 | edge first vertex |
[out] | p1 | edge second vertex |
Implemented in polyfem::mesh::Mesh2D, and polyfem::mesh::Mesh3D.
Referenced by polyfem::io::OutStatsData::compute_mesh_size(), and polyfem::solver::OperatorSplittingSolver::initialize_hashtable().
|
pure virtual |
Get all the edges according to valid_elements selection.
[out] | p0 | edge first vertex |
[out] | p1 | edge second vertex |
[in] | valid_elements | flag to compute the edge |
Implemented in polyfem::mesh::Mesh2D, and polyfem::mesh::Mesh3D.
|
inlinevirtual |
Get the boundary selection of a node.
[in] | node_id | node id |
Definition at line 484 of file Mesh.hpp.
References has_node_ids(), and node_ids_.
Referenced by append(), polyfem::assembler::GenericTensorProblem::dirichlet_nodal_value(), polyfem::assembler::GenericScalarProblem::dirichlet_nodal_value(), polyfem::io::OutGeometryData::save_points(), and polyfem::assembler::Problem::setup_bc().
|
inlinevirtual |
checks if volumes selections are available
Definition at line 525 of file Mesh.hpp.
References body_ids_.
Referenced by append(), and get_body_id().
|
inline |
checks if surface selections are available
Definition at line 521 of file Mesh.hpp.
References boundary_ids_.
Referenced by append(), and get_boundary_id().
|
inline |
checks if points selections are available
Definition at line 517 of file Mesh.hpp.
References node_ids_.
Referenced by append(), get_node_id(), and polyfem::assembler::Problem::setup_bc().
|
inline |
checks if the mesh has polytopes
Definition at line 563 of file Mesh.hpp.
References is_polytope(), and n_elements().
Referenced by polyfem::io::OutGeometryData::extract_boundary_mesh().
|
inline |
Order of the input edges.
Definition at line 618 of file Mesh.hpp.
References in_ordered_edges_.
|
inline |
Order of the input edges.
Definition at line 622 of file Mesh.hpp.
References in_ordered_faces_.
|
inline |
Order of the input vertices.
Definition at line 614 of file Mesh.hpp.
References in_ordered_vertices_.
|
pure virtual |
is edge boundary
[in] | edge_global_id | global edge id |
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
Referenced by get_default_boundary_id(), polyfem::mesh::MeshNodes::MeshNodes(), and polyfem::mesh::MeshNodes::node_ids_from_edge().
|
pure virtual |
is cell boundary
[in] | element_global_id | global cell id |
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
Referenced by polyfem::io::OutGeometryData::build_vis_mesh(), polyfem::io::Evaluator::check_scalar_value(), polyfem::io::Evaluator::compute_scalar_value(), polyfem::io::Evaluator::compute_tensor_value(), polyfem::io::Evaluator::interpolate_function(), and polyfem::io::Evaluator::mark_flipped_cells().
|
pure virtual |
is face boundary
[in] | face_global_id | global face id |
Implemented in polyfem::mesh::Mesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
Referenced by get_default_boundary_id(), polyfem::io::Evaluator::interpolate_boundary_function(), polyfem::mesh::MeshNodes::MeshNodes(), polyfem::mesh::MeshNodes::node_ids_from_face(), and polyfem::mesh::to_geogram_mesh().
|
pure virtual |
is vertex boundary
[in] | vertex_global_id | global vertex id |
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
Referenced by compute_node_ids(), and polyfem::mesh::MeshNodes::MeshNodes().
|
pure virtual |
if the mesh is conforming
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
Referenced by polyfem::io::OutGeometryData::extract_boundary_mesh().
bool polyfem::mesh::Mesh::is_cube | ( | const int | el_id | ) | const |
checks if element is cube compatible
[in] | el_id | element id |
Definition at line 352 of file Mesh.cpp.
References elements_tag_, polyfem::mesh::INTERFACE_CUBE, polyfem::mesh::MULTI_SINGULAR_BOUNDARY_CUBE, polyfem::mesh::MULTI_SINGULAR_INTERIOR_CUBE, polyfem::mesh::REGULAR_BOUNDARY_CUBE, polyfem::mesh::REGULAR_INTERIOR_CUBE, polyfem::mesh::SIMPLE_SINGULAR_BOUNDARY_CUBE, and polyfem::mesh::SIMPLE_SINGULAR_INTERIOR_CUBE.
Referenced by polyfem::io::Evaluator::average_grad_based_function(), polyfem::io::OutGeometryData::build_high_order_vis_mesh(), polyfem::io::OutGeometryData::build_vis_mesh(), polyfem::mesh::Mesh3D::cell_node(), polyfem::io::Evaluator::check_scalar_value(), polyfem::io::Evaluator::compute_scalar_value(), polyfem::io::Evaluator::compute_stress_at_quadrature_points(), polyfem::io::Evaluator::compute_tensor_value(), polyfem::io::OutGeometryData::extract_boundary_mesh(), polyfem::mesh::Mesh3D::face_node(), polyfem::mesh::CMesh2D::face_node(), polyfem::mesh::Mesh3D::get_ordered_vertices_from_hex(), polyfem::basis::LagrangeBasis3d::hex_face_local_nodes(), polyfem::io::Evaluator::interpolate_boundary_function(), polyfem::io::Evaluator::interpolate_function(), polyfem::io::Evaluator::mark_flipped_cells(), polyfem::basis::LagrangeBasis2d::quad_edge_local_nodes(), polyfem::io::OutGeometryData::save_surface(), polyfem::io::OutGeometryData::save_volume(), polyfem::io::OutGeometryData::save_wire(), and polyfem::mesh::to_geogram_mesh().
|
inline |
check if the mesh is linear
Definition at line 591 of file Mesh.hpp.
References orders_.
Referenced by polyfem::io::OutGeometryData::build_high_order_vis_mesh().
bool polyfem::mesh::Mesh::is_polytope | ( | const int | el_id | ) | const |
checks if element is polygon compatible
[in] | el_id | element id |
Definition at line 365 of file Mesh.cpp.
References polyfem::mesh::BOUNDARY_POLYTOPE, elements_tag_, and polyfem::mesh::INTERIOR_POLYTOPE.
Referenced by polyfem::basis::PolygonalBasis2d::build_bases(), polyfem::basis::PolygonalBasis3d::build_bases(), polyfem::basis::SplineBasis2d::build_bases(), polyfem::basis::SplineBasis3d::build_bases(), polyfem::basis::BarycentricBasis2d::build_bases(), polyfem::io::OutGeometryData::build_high_order_vis_mesh(), polyfem::basis::PolygonalBasis3d::compute_integral_constraints(), polyfem::basis::PolygonalBasis2d::compute_integral_constraints(), polyfem::io::OutStatsData::compute_mesh_size(), polyfem::io::OutStatsData::count_flipped_elements(), polyfem::mesh::extract_polyhedra(), and has_poly().
|
inline |
check if curved mesh has rational polynomials elements
Definition at line 287 of file Mesh.hpp.
References is_rational_.
bool polyfem::mesh::Mesh::is_simplex | ( | const int | el_id | ) | const |
checks if element is simples compatible
[in] | el_id | element id |
Definition at line 422 of file Mesh.cpp.
References elements_tag_, and polyfem::mesh::SIMPLEX.
Referenced by polyfem::io::Evaluator::average_grad_based_function(), polyfem::mesh::Mesh2D::barycentric_coords(), polyfem::mesh::CMesh3D::barycentric_coords(), polyfem::mesh::Mesh3D::barycentric_coords(), polyfem::io::OutGeometryData::build_grid(), polyfem::io::OutGeometryData::build_high_order_vis_mesh(), polyfem::io::OutGeometryData::build_vis_mesh(), polyfem::mesh::Mesh3D::cell_node(), polyfem::io::Evaluator::check_scalar_value(), polyfem::mesh::Mesh3D::compute_cell_jacobian(), polyfem::mesh::Mesh2D::compute_face_jacobian(), polyfem::io::OutStatsData::compute_mesh_size(), polyfem::io::Evaluator::compute_scalar_value(), polyfem::io::Evaluator::compute_stress_at_quadrature_points(), polyfem::io::Evaluator::compute_tensor_value(), polyfem::io::OutGeometryData::extract_boundary_mesh(), polyfem::mesh::Mesh3D::face_node(), polyfem::mesh::CMesh2D::face_node(), polyfem::io::Evaluator::interpolate_boundary_function(), polyfem::io::Evaluator::interpolate_function(), is_simplicial(), polyfem::io::Evaluator::mark_flipped_cells(), polyfem::mesh::MeshNodes::node_ids_from_cell(), polyfem::mesh::MeshNodes::node_ids_from_face(), polyfem::mesh::MeshNodes::node_ids_from_face(), polyfem::refinement::APriori::p_refine(), polyfem::refinement::APriori::p_refine(), polyfem::mesh::CMesh2D::refine(), polyfem::io::OutGeometryData::save_surface(), polyfem::io::OutGeometryData::save_volume(), polyfem::io::OutGeometryData::save_wire(), polyfem::basis::LagrangeBasis3d::tet_face_local_nodes(), and polyfem::basis::LagrangeBasis2d::tri_edge_local_nodes().
|
inline |
checks if the mesh is simplicial
Definition at line 577 of file Mesh.hpp.
References is_simplex(), and n_elements().
Referenced by polyfem::io::OutGeometryData::extract_boundary_mesh().
bool polyfem::mesh::Mesh::is_spline_compatible | ( | const int | el_id | ) | const |
checks if element is spline compatible
[in] | el_id | element id |
Definition at line 332 of file Mesh.cpp.
References elements_tag_, is_volume(), polyfem::mesh::REGULAR_BOUNDARY_CUBE, and polyfem::mesh::REGULAR_INTERIOR_CUBE.
Referenced by polyfem::basis::SplineBasis2d::build_bases(), and polyfem::basis::SplineBasis3d::build_bases().
|
pure virtual |
checks if mesh is volume
Implemented in polyfem::mesh::Mesh2D, and polyfem::mesh::Mesh3D.
Referenced by polyfem::assembler::RhsAssembler::assemble(), boundary_element_vertex(), polyfem::io::OutGeometryData::build_grid(), polyfem::io::OutGeometryData::build_high_order_vis_mesh(), polyfem::io::OutGeometryData::build_vis_boundary_mesh(), polyfem::io::OutGeometryData::build_vis_mesh(), polyfem::io::Evaluator::check_scalar_value(), polyfem::assembler::RhsAssembler::compute_energy(), polyfem::assembler::RhsAssembler::compute_energy_hess(), polyfem::io::OutStatsData::compute_errors(), polyfem::io::OutStatsData::compute_mesh_size(), polyfem::io::Evaluator::compute_scalar_value(), polyfem::io::Evaluator::compute_stress_at_quadrature_points(), polyfem::io::Evaluator::compute_tensor_value(), polyfem::io::OutStatsData::count_flipped_elements(), dimension(), element_vertex(), polyfem::io::OutGeometryData::extract_boundary_mesh(), polyfem::solver::BodyForm::force_shape_derivative(), get_default_boundary_id(), polyfem::problem::NodeValues::init(), polyfem::io::OutGeometryData::init_sampler(), polyfem::io::Evaluator::interpolate_at_local_vals(), polyfem::io::Evaluator::interpolate_boundary_function(), polyfem::io::Evaluator::interpolate_function(), is_spline_compatible(), polyfem::solver::LinearFilter::LinearFilter(), polyfem::io::Evaluator::mark_flipped_cells(), polyfem::mesh::MeshNodes::MeshNodes(), n_boundary_elements(), n_elements(), polyfem::utils::BoundarySampler::normal_for_polygon_edge(), polyfem::refinement::APriori::p_refine(), polyfem::utils::BoundarySampler::quadrature_for_polygon_edge(), polyfem::utils::BoundarySampler::sample_polygon_edge(), polyfem::io::OutGeometryData::save_surface(), polyfem::io::OutGeometryData::save_volume(), polyfem::io::OutGeometryData::save_wire(), polyfem::assembler::RhsAssembler::time_bc(), and polyfem::io::MshWriter::write().
|
protectedpure virtual |
loads a mesh from a geo mesh
[in] | M | geo mesh |
Implemented in polyfem::mesh::CMesh3D, polyfem::mesh::NCMesh3D, polyfem::mesh::CMesh2D, and polyfem::mesh::NCMesh2D.
|
protectedpure virtual |
loads a mesh from the path
[in] | path | file location |
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
|
virtual |
loads the boundary selections for a file
[in] | path | file's path |
Definition at line 399 of file Mesh.cpp.
References boundary_ids_, and n_boundary_elements().
|
inline |
utitlity to return the number of boundary elements, faces or edges in 3d and 2d
Definition at line 166 of file Mesh.hpp.
References is_volume(), n_edges(), and n_faces().
Referenced by append(), load_boundary_ids(), and set_boundary_ids().
|
pure virtual |
number of vertices of a cell
[in] | c_id | global cell id (face for 2d meshes) |
Implemented in polyfem::mesh::Mesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
Referenced by element_vertices(), polyfem::mesh::Mesh3D::elements_boxes(), polyfem::mesh::extract_polyhedra(), and polyfem::io::MshWriter::write().
|
pure virtual |
number of cells
Implemented in polyfem::mesh::Mesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
Referenced by cell_barycenters(), polyfem::mesh::extract_polyhedra(), polyfem::mesh::MeshNodes::MeshNodes(), n_elements(), polyfem::refinement::APriori::p_refine(), and polyfem::mesh::to_geogram_mesh().
|
pure virtual |
number of edges
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
Referenced by edge_barycenters(), edges(), edges_to_ids(), polyfem::mesh::Mesh2D::get_edges(), polyfem::mesh::Mesh3D::get_edges(), polyfem::problem::NodeValues::init(), polyfem::mesh::MeshNodes::MeshNodes(), and n_boundary_elements().
|
inline |
utitlity to return the number of elements, cells or faces in 3d and 2d
Definition at line 161 of file Mesh.hpp.
References is_volume(), n_cells(), and n_faces().
Referenced by append(), polyfem::solver::PerBody2PerElem::apply_jacobian(), polyfem::basis::PolygonalBasis2d::build_bases(), polyfem::basis::PolygonalBasis3d::build_bases(), polyfem::basis::SplineBasis2d::build_bases(), polyfem::basis::SplineBasis3d::build_bases(), polyfem::basis::BarycentricBasis2d::build_bases(), polyfem::mesh::CMesh2D::compute_body_ids(), polyfem::mesh::CMesh3D::compute_body_ids(), polyfem::basis::PolygonalBasis3d::compute_integral_constraints(), polyfem::basis::PolygonalBasis2d::compute_integral_constraints(), polyfem::compute_integral_constraints(), polyfem::io::OutStatsData::compute_mesh_stats(), polyfem::io::Evaluator::compute_stress_at_quadrature_points(), polyfem::mesh::Mesh2D::elements_boxes(), polyfem::mesh::CMesh3D::elements_boxes(), polyfem::mesh::Mesh3D::elements_boxes(), polyfem::solver::PerBody2PerElem::eval(), has_poly(), polyfem::io::OutGeometryData::init_sampler(), polyfem::io::Evaluator::interpolate_boundary_function(), is_simplicial(), polyfem::refinement::APriori::p_refine(), polyfem::solver::PerBody2PerElem::PerBody2PerElem(), polyfem::solver::PerBody2PerNode::PerBody2PerNode(), polyfem::mesh::CMesh2D::refine(), polyfem::io::OutStatsData::save_json(), set_body_ids(), and polyfem::io::MshWriter::write().
|
pure virtual |
number of vertices of a face
[in] | f_id | global face id |
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
Referenced by polyfem::basis::BarycentricBasis2d::build_bases(), polyfem::io::OutGeometryData::build_high_order_vis_mesh(), polyfem::basis::compute_epsilon(), polyfem::mesh::Mesh2D::elements_boxes(), polyfem::mesh::extract_polyhedra(), polyfem::mesh::Mesh2D::face_barycenter(), faces(), faces_to_ids(), polyfem::mesh::Mesh2D::get_edges(), polyfem::mesh::Mesh2D::n_cell_vertices(), polyfem::io::OutGeometryData::save_volume(), polyfem::mesh::to_geogram_mesh(), and polyfem::mesh::Mesh3D::tri_area().
|
pure virtual |
number of faces
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
Referenced by polyfem::io::OutGeometryData::extract_boundary_mesh(), polyfem::mesh::extract_polyhedra(), face_barycenters(), faces(), faces_to_ids(), polyfem::problem::NodeValues::init(), polyfem::mesh::MeshNodes::MeshNodes(), n_boundary_elements(), n_elements(), polyfem::refinement::APriori::p_refine(), and polyfem::mesh::to_geogram_mesh().
|
pure virtual |
number of vertices
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
Referenced by append(), apply_affine_transformation(), polyfem::mesh::Remesher::build_bases(), compute_node_ids(), polyfem::mesh::extract_polyhedra(), polyfem::mesh::Mesh2D::face_barycenter(), polyfem::solver::OperatorSplittingSolver::initialize_mesh(), polyfem::mesh::MeshNodes::MeshNodes(), polyfem::io::OutStatsData::save_json(), polyfem::mesh::to_geogram_mesh(), polyfem::mesh::Mesh3D::tri_area(), update_nodes(), and polyfem::io::MshWriter::write().
|
pure virtual |
normalize the mesh
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
|
inline |
order of each element
Definition at line 283 of file Mesh.hpp.
References orders_.
Referenced by polyfem::io::OutStatsData::save_json().
|
pure virtual |
point coordinates
[in] | global_index | global vertex index |
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::NCMesh3D, and polyfem::mesh::CMesh3D.
Referenced by polyfem::solver::OperatorSplittingSolver::advection_PIC(), apply_affine_transformation(), polyfem::mesh::Mesh2D::barycentric_coords(), polyfem::mesh::Mesh3D::barycentric_coords(), polyfem::mesh::Remesher::build_bases(), polyfem::basis::BarycentricBasis2d::build_bases(), polyfem::mesh::Mesh3D::cell_node(), polyfem::mesh::Mesh3D::compute_cell_jacobian(), polyfem::basis::compute_epsilon(), polyfem::mesh::Mesh2D::compute_face_jacobian(), compute_node_ids(), polyfem::mesh::Mesh3D::edge_node(), polyfem::mesh::Mesh2D::elements_boxes(), polyfem::mesh::Mesh3D::elements_boxes(), polyfem::mesh::extract_polyhedra(), polyfem::mesh::Mesh2D::face_barycenter(), polyfem::mesh::Mesh3D::face_node(), polyfem::mesh::Mesh2D::get_edges(), polyfem::mesh::Mesh3D::get_edges(), polyfem::mesh::Mesh2D::get_edges(), polyfem::mesh::Mesh3D::get_edges(), polyfem::solver::OperatorSplittingSolver::initialize_mesh(), polyfem::mesh::MeshNodes::node_id_from_primitive(), polyfem::refinement::APriori::p_refine(), polyfem::refinement::APriori::p_refine(), polyfem::mesh::to_geogram_mesh(), polyfem::mesh::Mesh3D::tri_area(), and polyfem::io::MshWriter::write().
|
inlinevirtual |
method used to finalize the mesh.
It computes the cached stuff used in navigation
Reimplemented in polyfem::mesh::NCMesh2D, and polyfem::mesh::NCMesh3D.
|
inlinevirtual |
area of a quad face of an hex mesh
[in] | gid | global face id |
Reimplemented in polyfem::mesh::CMesh3D.
Definition at line 315 of file Mesh.hpp.
Referenced by polyfem::utils::BoundarySampler::quadrature_for_quad_face(), and polyfem::io::OutGeometryData::save_surface().
|
pure virtual |
refine the mesh
[in] | n_refinement | number of refinements |
[in] | t | position of the refinement location (0.5 for standard refinement) |
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
|
pure virtual |
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
|
inlinevirtual |
Set the volume sections.
[in] | body_ids | vector of labels, one per element |
Reimplemented in polyfem::mesh::NCMesh2D, and polyfem::mesh::NCMesh3D.
Definition at line 453 of file Mesh.hpp.
References body_ids_, and n_elements().
|
inlinevirtual |
Set the boundary selection from a vector.
[in] | boundary_ids | vector one value per element |
Reimplemented in polyfem::mesh::NCMesh2D, and polyfem::mesh::NCMesh3D.
Definition at line 445 of file Mesh.hpp.
References boundary_ids_, and n_boundary_elements().
|
inline |
Set the cell weights for rational polynomial meshes.
[in] | in_cell_weights | vector of vector containing the weights, one per cell |
Definition at line 554 of file Mesh.hpp.
References cell_weights_.
|
inline |
Set the is rational object.
[in] | in_is_rational | flag to enable/disable rational polynomials |
Definition at line 291 of file Mesh.hpp.
References is_rational_.
|
pure virtual |
Set the point.
[in] | global_index | global vertex index |
[in] | p | value |
Implemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, polyfem::mesh::CMesh3D, and polyfem::mesh::NCMesh3D.
Referenced by apply_affine_transformation().
|
inline |
changes the element type
[in] | el | element id |
[in] | type | type of the element |
Definition at line 420 of file Mesh.hpp.
References elements_tag_.
|
inlinevirtual |
area of a tri face of a tet mesh
[in] | gid | global face id |
Reimplemented in polyfem::mesh::Mesh3D.
Definition at line 324 of file Mesh.hpp.
Referenced by polyfem::utils::BoundarySampler::quadrature_for_tri_face(), and polyfem::io::OutGeometryData::save_surface().
|
inlinevirtual |
Update elements types.
Reimplemented in polyfem::mesh::CMesh2D, polyfem::mesh::NCMesh2D, and polyfem::mesh::NCMesh3D.
void polyfem::mesh::Mesh::update_nodes | ( | const Eigen::VectorXi & | in_node_to_node | ) |
Update the node ids to reorder them.
[in] | in_node_to_node | mapping from input nodes to polyfem nodes |
Definition at line 371 of file Mesh.cpp.
References n_vertices(), and node_ids_.
|
protected |
list of volume labels
Definition at line 662 of file Mesh.hpp.
Referenced by append(), polyfem::mesh::CMesh2D::compute_body_ids(), polyfem::mesh::NCMesh2D::compute_body_ids(), polyfem::mesh::CMesh3D::compute_body_ids(), polyfem::mesh::NCMesh3D::compute_body_ids(), polyfem::mesh::CMesh2D::copy(), get_body_id(), get_body_ids(), has_body_ids(), and set_body_ids().
|
protected |
list of surface labels
Definition at line 660 of file Mesh.hpp.
Referenced by append(), polyfem::mesh::CMesh2D::compute_boundary_ids(), polyfem::mesh::NCMesh2D::compute_boundary_ids(), polyfem::mesh::CMesh3D::compute_boundary_ids(), polyfem::mesh::NCMesh3D::compute_boundary_ids(), polyfem::mesh::CMesh2D::copy(), get_boundary_id(), has_boundary_ids(), load_boundary_ids(), and set_boundary_ids().
|
protected |
high-order nodes associates to cells
Definition at line 673 of file Mesh.hpp.
Referenced by append(), apply_affine_transformation(), polyfem::mesh::CMesh2D::attach_higher_order_nodes(), polyfem::mesh::CMesh3D::attach_higher_order_nodes(), polyfem::mesh::CMesh2D::build_from_matrices(), polyfem::mesh::CMesh3D::build_from_matrices(), polyfem::mesh::Mesh3D::cell_node(), polyfem::mesh::CMesh2D::copy(), polyfem::mesh::CMesh3D::load(), polyfem::mesh::CMesh2D::load(), polyfem::mesh::CMesh3D::load(), and polyfem::mesh::CMesh3D::normalize().
|
protected |
weights associates to cells for rational polynomail meshes
Definition at line 675 of file Mesh.hpp.
Referenced by append(), cell_weights(), polyfem::mesh::CMesh2D::copy(), and set_cell_weights().
|
protected |
high-order nodes associates to edges
Definition at line 669 of file Mesh.hpp.
Referenced by append(), apply_affine_transformation(), polyfem::mesh::CMesh2D::attach_higher_order_nodes(), polyfem::mesh::CMesh3D::attach_higher_order_nodes(), polyfem::mesh::CMesh2D::build_from_matrices(), polyfem::mesh::CMesh3D::build_from_matrices(), polyfem::mesh::CMesh2D::copy(), polyfem::mesh::Mesh3D::edge_node(), polyfem::mesh::CMesh2D::edge_node(), polyfem::mesh::CMesh3D::load(), polyfem::mesh::CMesh2D::load(), polyfem::mesh::CMesh3D::load(), polyfem::mesh::CMesh2D::normalize(), and polyfem::mesh::CMesh3D::normalize().
|
protected |
list of element types
Definition at line 656 of file Mesh.hpp.
Referenced by append(), polyfem::mesh::CMesh2D::compute_elements_tag(), polyfem::mesh::NCMesh2D::compute_elements_tag(), polyfem::mesh::CMesh3D::compute_elements_tag(), polyfem::mesh::NCMesh3D::compute_elements_tag(), polyfem::mesh::CMesh2D::copy(), elements_tag(), is_cube(), is_polytope(), is_simplex(), is_spline_compatible(), set_tag(), polyfem::mesh::CMesh2D::update_elements_tag(), polyfem::mesh::NCMesh2D::update_elements_tag(), and polyfem::mesh::NCMesh3D::update_elements_tag().
|
protected |
high-order nodes associates to faces
Definition at line 671 of file Mesh.hpp.
Referenced by append(), apply_affine_transformation(), polyfem::mesh::CMesh2D::attach_higher_order_nodes(), polyfem::mesh::CMesh3D::attach_higher_order_nodes(), polyfem::mesh::CMesh2D::build_from_matrices(), polyfem::mesh::CMesh3D::build_from_matrices(), polyfem::mesh::CMesh2D::copy(), polyfem::mesh::Mesh3D::face_node(), polyfem::mesh::CMesh2D::face_node(), polyfem::mesh::CMesh3D::load(), polyfem::mesh::CMesh2D::load(), polyfem::mesh::CMesh3D::load(), polyfem::mesh::CMesh2D::normalize(), and polyfem::mesh::CMesh3D::normalize().
|
protected |
Order of the input edges.
Definition at line 680 of file Mesh.hpp.
Referenced by append(), polyfem::mesh::CMesh2D::copy(), in_ordered_edges(), polyfem::mesh::CMesh2D::refine(), and polyfem::mesh::CMesh3D::refine().
|
protected |
Order of the input faces, TODO: change to std::vector of Eigen::Vector.
Definition at line 682 of file Mesh.hpp.
Referenced by append(), polyfem::mesh::CMesh2D::copy(), in_ordered_faces(), polyfem::mesh::CMesh2D::refine(), and polyfem::mesh::CMesh3D::refine().
|
protected |
Order of the input vertices.
Definition at line 678 of file Mesh.hpp.
Referenced by append(), polyfem::mesh::CMesh2D::copy(), in_ordered_vertices(), polyfem::mesh::CMesh2D::refine(), and polyfem::mesh::CMesh3D::refine().
|
protected |
stores if the mesh is rational
Definition at line 666 of file Mesh.hpp.
Referenced by append(), polyfem::mesh::CMesh2D::copy(), is_rational(), and set_is_rational().
|
protected |
list of node labels
Definition at line 658 of file Mesh.hpp.
Referenced by append(), compute_node_ids(), polyfem::mesh::CMesh2D::copy(), get_node_id(), has_node_ids(), and update_nodes().
|
protected |
list of geometry orders, one per cell
Definition at line 664 of file Mesh.hpp.
Referenced by append(), polyfem::mesh::CMesh2D::attach_higher_order_nodes(), polyfem::mesh::CMesh3D::attach_higher_order_nodes(), polyfem::mesh::Mesh3D::cell_node(), polyfem::mesh::CMesh2D::copy(), polyfem::mesh::Mesh3D::edge_node(), polyfem::mesh::CMesh2D::edge_node(), polyfem::mesh::Mesh3D::face_node(), polyfem::mesh::CMesh2D::face_node(), is_linear(), orders(), polyfem::mesh::CMesh2D::refine(), and polyfem::mesh::CMesh3D::refine().