PolyFEM
Loading...
Searching...
No Matches
polyfem::mesh::NCMesh3D Class Reference

#include <NCMesh3D.hpp>

Inheritance diagram for polyfem::mesh::NCMesh3D:
[legend]
Collaboration diagram for polyfem::mesh::NCMesh3D:
[legend]

Classes

struct  ArrayHasher2D
 
struct  ArrayHasher3D
 
struct  follower_edge
 
struct  follower_face
 
struct  ncBoundary
 
struct  ncElem
 
struct  ncVert
 

Public Member Functions

 NCMesh3D ()=default
 
virtual ~NCMesh3D ()=default
 
 NCMesh3D (NCMesh3D &&)=default
 
NCMesh3Doperator= (NCMesh3D &&)=default
 
 NCMesh3D (const NCMesh3D &)=default
 
NCMesh3Doperator= (const NCMesh3D &)=default
 
void refine (const int n_refinement, const double t) override
 refine the mesh
 
bool is_conforming () const override
 if the mesh is conforming
 
int n_cells () const override
 number of cells
 
int n_faces () const override
 number of faces
 
int n_edges () const override
 number of edges
 
int n_vertices () const override
 number of vertices
 
int n_face_vertices (const int f_id) const override
 number of vertices of a face
 
int n_face_cells (const int f_id) const
 
int n_edge_cells (const int e_id) const
 
int n_cell_vertices (const int c_id) const override
 number of vertices of a cell
 
int n_cell_edges (const int c_id) const override
 
int n_cell_faces (const int c_id) const override
 
int cell_vertex (const int f_id, const int lv_id) const override
 id of the vertex of a cell
 
int cell_face (const int c_id, const int lf_id) const override
 
int cell_edge (const int c_id, const int le_id) const override
 
int face_vertex (const int f_id, const int lv_id) const override
 id of the face vertex
 
int face_edge (const int f_id, const int le_id) const
 
int edge_vertex (const int e_id, const int lv_id) const override
 id of the edge vertex
 
int cell_ref_level (const int c_id) const
 
bool is_boundary_vertex (const int vertex_global_id) const override
 is vertex boundary
 
bool is_boundary_edge (const int edge_global_id) const override
 is edge boundary
 
bool is_boundary_face (const int face_global_id) const override
 is face boundary
 
bool is_boundary_element (const int element_global_id) const override
 is cell boundary
 
bool save (const std::string &path) const override
 
bool build_from_matrices (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F) override
 build a mesh from matrices
 
void attach_higher_order_nodes (const Eigen::MatrixXd &V, const std::vector< std::vector< int > > &nodes) override
 attach high order nodes
 
void normalize () override
 normalize the mesh
 
void compute_elements_tag () override
 compute element types, see ElementType
 
void update_elements_tag () override
 Update elements types.
 
double edge_length (const int gid) const override
 edge length
 
RowVectorNd point (const int global_index) const override
 point coordinates
 
void set_point (const int global_index, const RowVectorNd &p) override
 Set the point.
 
RowVectorNd edge_barycenter (const int e) const override
 edge barycenter
 
RowVectorNd face_barycenter (const int f) const override
 face barycenter
 
RowVectorNd cell_barycenter (const int c) const override
 cell barycenter
 
void bounding_box (RowVectorNd &min, RowVectorNd &max) const override
 computes the bbox of the mesh
 
void compute_boundary_ids (const std::function< int(const size_t, const std::vector< int > &, const RowVectorNd &, bool)> &marker) override
 computes boundary selections based on a function
 
void compute_body_ids (const std::function< int(const size_t, const std::vector< int > &, const RowVectorNd &)> &marker) override
 computes boundary selections based on a function
 
void set_boundary_ids (const std::vector< int > &boundary_ids) override
 Set the boundary selection from a vector.
 
void set_body_ids (const std::vector< int > &body_ids) override
 Set the volume sections.
 
int get_boundary_id (const int primitive) const override
 Get the boundary selection of an element (face in 3d, edge in 2d)
 
int get_body_id (const int primitive) const override
 Get the volume selection of an element (cell in 3d, face in 2d)
 
RowVectorNd kernel (const int cell_id) const override
 
Navigation3D::Index get_index_from_element (int hi, int lf, int lv) const override
 
Navigation3D::Index get_index_from_element (int hi) const override
 
Navigation3D::Index get_index_from_element_edge (int hi, int v0, int v1) const override
 
Navigation3D::Index get_index_from_element_face (int hi, int v0, int v1, int v2) const override
 
std::vector< uint32_t > vertex_neighs (const int v_gid) const override
 
std::vector< uint32_t > edge_neighs (const int e_gid) const override
 
int leader_edge_of_vertex (const int v_id) const
 
int leader_edge_of_edge (const int e_id) const
 
int leader_face_of_vertex (const int v_id) const
 
int leader_face_of_edge (const int e_id) const
 
int leader_face_of_face (const int f_id) const
 
int n_follower_edges (const int e_id) const
 
int n_follower_faces (const int e_id) const
 
Navigation3D::Index switch_vertex (Navigation3D::Index idx) const override
 
Navigation3D::Index switch_edge (Navigation3D::Index idx) const override
 
Navigation3D::Index switch_face (Navigation3D::Index idx) const override
 
Navigation3D::Index switch_element (Navigation3D::Index idx) const override
 
Navigation3D::Index next_around_edge (Navigation3D::Index idx) const override
 
Navigation3D::Index next_around_face (Navigation3D::Index idx) const override
 
void get_vertex_elements_neighs (const int v_id, std::vector< int > &ids) const override
 
void get_edge_elements_neighs (const int e_id, std::vector< int > &ids) const override
 
void get_face_elements_neighs (const int f_id, std::vector< int > &ids) const
 
void refine_element (int id_full)
 
void refine_elements (const std::vector< int > &ids)
 
void coarsen_element (int id_full)
 
void mark_boundary ()
 
void prepare_mesh () override
 method used to finalize the mesh.
 
void build_index_mapping ()
 
std::array< int, 4 > get_ordered_vertices_from_tet (const int element_index) const override
 
void append (const Mesh &mesh) override
 appends a new mesh to the end of this
 
std::unique_ptr< Meshcopy () const override
 Create a copy of the mesh.
 
- Public Member Functions inherited from polyfem::mesh::Mesh3D
 Mesh3D ()=default
 
virtual ~Mesh3D ()=default
 
 Mesh3D (Mesh3D &&)=default
 
Mesh3Doperator= (Mesh3D &&)=default
 
 Mesh3D (const Mesh3D &)=default
 
Mesh3Doperator= (const Mesh3D &)=default
 
bool is_volume () const override
 checks if mesh is volume
 
void elements_boxes (std::vector< std::array< Eigen::Vector3d, 2 > > &boxes) const override
 constructs a box around every element (3d cell, 2d face)
 
void barycentric_coords (const RowVectorNd &p, const int el_id, Eigen::MatrixXd &coord) const override
 constructs barycentric coodiantes for a point p.
 
void compute_cell_jacobian (const int el_id, const Eigen::MatrixXd &reference_map, Eigen::MatrixXd &jacobian) const
 
double tri_area (const int gid) const override
 area of a tri face of a tet mesh
 
std::pair< RowVectorNd, int > edge_node (const Navigation3D::Index &index, const int n_new_nodes, const int i) const
 
std::pair< RowVectorNd, int > face_node (const Navigation3D::Index &index, const int n_new_nodes, const int i, const int j) const
 
std::pair< RowVectorNd, int > cell_node (const Navigation3D::Index &index, const int n_new_nodes, const int i, const int j, const int k) const
 
void get_edges (Eigen::MatrixXd &p0, Eigen::MatrixXd &p1) const override
 Get all the edges.
 
void get_edges (Eigen::MatrixXd &p0, Eigen::MatrixXd &p1, const std::vector< bool > &valid_elements) const override
 Get all the edges according to valid_elements selection.
 
void to_face_functions (std::array< std::function< Navigation3D::Index(Navigation3D::Index)>, 6 > &to_face) const
 
void to_vertex_functions (std::array< std::function< Navigation3D::Index(Navigation3D::Index)>, 8 > &to_vertex) const
 
void to_edge_functions (std::array< std::function< Navigation3D::Index(Navigation3D::Index)>, 12 > &to_edge) const
 
std::array< int, 8 > get_ordered_vertices_from_hex (const int element_index) const
 
void compute_element_barycenters (Eigen::MatrixXd &barycenters) const override
 utility for 2d/3d.
 
- Public Member Functions inherited from polyfem::mesh::Mesh
virtual ~Mesh ()=default
 Destroy the Mesh object.
 
 Mesh (Mesh &&)=default
 Construct a new Mesh object.
 
Meshoperator= (Mesh &&)=default
 Copy constructor.
 
 Mesh (const Mesh &)=default
 Construct a new Mesh object.
 
Meshoperator= (const Mesh &)=default
 
int dimension () const
 utily for dimension
 
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
 
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
 
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 double quad_area (const int gid) const
 area of a quad face of an hex mesh
 
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
 
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 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_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 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
 
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.
 
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::HashPairedges_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::HashVectorfaces_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.
 
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\).
 

Protected Member Functions

bool load (const std::string &path) override
 loads a mesh from the path
 
bool load (const GEO::Mesh &M) override
 loads a mesh from a geo mesh
 
int all_to_valid_vertex (const int id) const
 
int valid_to_all_vertex (const int id) const
 
int all_to_valid_edge (const int id) const
 
int valid_to_all_edge (const int id) const
 
int all_to_valid_face (const int id) const
 
int valid_to_all_face (const int id) const
 
int all_to_valid_elem (const int id) const
 
int valid_to_all_elem (const int id) const
 
int find_vertex (Eigen::Vector2i v) const
 
int find_vertex (const int v1, const int v2) const
 
int get_vertex (Eigen::Vector2i v)
 
int find_edge (Eigen::Vector2i v) const
 
int find_edge (const int v1, const int v2) const
 
int get_edge (Eigen::Vector2i v)
 
int get_edge (const int v1, const int v2)
 
int find_face (Eigen::Vector3i v) const
 
int find_face (const int v1, const int v2, const int v3) const
 
int get_face (Eigen::Vector3i v)
 
int get_face (const int v1, const int v2, const int v3)
 
void traverse_edge (Eigen::Vector2i v, double p1, double p2, int depth, std::vector< follower_edge > &list) const
 
void build_edge_follower_chain ()
 
void traverse_face (int v1, int v2, int v3, Eigen::Vector2d p1, Eigen::Vector2d p2, Eigen::Vector2d p3, int depth, std::vector< follower_face > &face_list, std::vector< int > &edge_list) const
 
void build_face_follower_chain ()
 
void build_element_vertex_adjacency ()
 
int add_element (Eigen::Vector4i v, int parent=-1)
 
- Protected Member Functions inherited from polyfem::mesh::Mesh
 Mesh ()=default
 Construct a new Mesh object.
 

Protected Attributes

int n_elements = 0
 
bool index_prepared = false
 
bool adj_prepared = false
 
std::vector< ncElemelements
 
std::vector< ncVertvertices
 
std::vector< ncBoundaryedges
 
std::vector< ncBoundaryfaces
 
std::unordered_map< Eigen::Vector2i, int, ArrayHasher2DmidpointMap
 
std::unordered_map< Eigen::Vector2i, int, ArrayHasher2DedgeMap
 
std::unordered_map< Eigen::Vector3i, int, ArrayHasher3DfaceMap
 
std::vector< int > all_to_valid_elemMap
 
std::vector< int > valid_to_all_elemMap
 
std::vector< int > all_to_valid_vertexMap
 
std::vector< int > valid_to_all_vertexMap
 
std::vector< int > all_to_valid_edgeMap
 
std::vector< int > valid_to_all_edgeMap
 
std::vector< int > all_to_valid_faceMap
 
std::vector< int > valid_to_all_faceMap
 
std::vector< int > refineHistory
 
Eigen::SparseMatrix< bool, Eigen::RowMajor > elementAdj
 
- Protected Attributes inherited from polyfem::mesh::Mesh
std::vector< ElementTypeelements_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< EdgeNodesedge_nodes_
 high-order nodes associates to edges
 
std::vector< FaceNodesface_nodes_
 high-order nodes associates to faces
 
std::vector< CellNodescell_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.
 

Additional Inherited Members

- Static Public Member Functions inherited from polyfem::mesh::Mesh
static std::unique_ptr< Meshcreate (const std::string &path, const bool non_conforming=false)
 factory to build the proper mesh
 
static std::unique_ptr< Meshcreate (GEO::Mesh &M, const bool non_conforming=false)
 factory to build the proper mesh
 
static std::unique_ptr< Meshcreate (const Eigen::MatrixXd &vertices, const Eigen::MatrixXi &cells, const bool non_conforming=false)
 factory to build the proper mesh
 
static std::unique_ptr< Meshcreate (const int dim, const bool non_conforming=false)
 factory to build the proper empty mesh
 

Detailed Description

Definition at line 11 of file NCMesh3D.hpp.

Constructor & Destructor Documentation

◆ NCMesh3D() [1/3]

polyfem::mesh::NCMesh3D::NCMesh3D ( )
default

◆ ~NCMesh3D()

virtual polyfem::mesh::NCMesh3D::~NCMesh3D ( )
virtualdefault

◆ NCMesh3D() [2/3]

polyfem::mesh::NCMesh3D::NCMesh3D ( NCMesh3D &&  )
default

◆ NCMesh3D() [3/3]

polyfem::mesh::NCMesh3D::NCMesh3D ( const NCMesh3D )
default

Member Function Documentation

◆ add_element()

int polyfem::mesh::NCMesh3D::add_element ( Eigen::Vector4i  v,
int  parent = -1 
)
protected

Definition at line 1126 of file NCMesh3D.cpp.

References add_element(), edges, elements, faces, get_edge(), get_face(), n_elements, and vertices.

Referenced by add_element(), append(), build_from_matrices(), load(), and refine_element().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ all_to_valid_edge()

int polyfem::mesh::NCMesh3D::all_to_valid_edge ( const int  id) const
inlineprotected

Definition at line 397 of file NCMesh3D.hpp.

References all_to_valid_edgeMap, and index_prepared.

Referenced by cell_edge(), face_edge(), get_index_from_element_edge(), leader_edge_of_edge(), and leader_edge_of_vertex().

Here is the caller graph for this function:

◆ all_to_valid_elem()

int polyfem::mesh::NCMesh3D::all_to_valid_elem ( const int  id) const
inlineprotected

Definition at line 421 of file NCMesh3D.hpp.

References all_to_valid_elemMap, and index_prepared.

Referenced by edge_neighs(), get_edge_elements_neighs(), get_face_elements_neighs(), get_vertex_elements_neighs(), switch_element(), and vertex_neighs().

Here is the caller graph for this function:

◆ all_to_valid_face()

int polyfem::mesh::NCMesh3D::all_to_valid_face ( const int  id) const
inlineprotected

Definition at line 409 of file NCMesh3D.hpp.

References all_to_valid_faceMap, and index_prepared.

Referenced by cell_face(), get_index_from_element_face(), leader_face_of_edge(), leader_face_of_face(), and leader_face_of_vertex().

Here is the caller graph for this function:

◆ all_to_valid_vertex()

int polyfem::mesh::NCMesh3D::all_to_valid_vertex ( const int  id) const
inlineprotected

Definition at line 385 of file NCMesh3D.hpp.

References all_to_valid_vertexMap, and index_prepared.

Referenced by cell_vertex(), edge_vertex(), and face_vertex().

Here is the caller graph for this function:

◆ append()

void polyfem::mesh::NCMesh3D::append ( const Mesh mesh)
overridevirtual

appends a new mesh to the end of this

Parameters
[in]meshto append

Reimplemented from polyfem::mesh::Mesh.

Definition at line 802 of file NCMesh3D.cpp.

References add_element(), polyfem::mesh::Mesh::append(), elements, n_cells(), n_vertices(), prepare_mesh(), and vertices.

Here is the call graph for this function:

◆ attach_higher_order_nodes()

void polyfem::mesh::NCMesh3D::attach_higher_order_nodes ( const Eigen::MatrixXd &  V,
const std::vector< std::vector< int > > &  nodes 
)
overridevirtual

attach high order nodes

Parameters
[in]Vnodes
[in]nodeslist of nodes per element

Implements polyfem::mesh::Mesh.

Definition at line 80 of file NCMesh3D.cpp.

References n_cells().

Here is the call graph for this function:

◆ bounding_box()

void polyfem::mesh::NCMesh3D::bounding_box ( RowVectorNd min,
RowVectorNd max 
) const
overridevirtual

computes the bbox of the mesh

Parameters
[out]minmin coodiante
[out]maxmax coodiante

Implements polyfem::mesh::Mesh.

Definition at line 149 of file NCMesh3D.cpp.

References vertices.

Referenced by normalize().

Here is the caller graph for this function:

◆ build_edge_follower_chain()

void polyfem::mesh::NCMesh3D::build_edge_follower_chain ( )
protected

Definition at line 965 of file NCMesh3D.cpp.

References edges, and traverse_edge().

Referenced by prepare_mesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ build_element_vertex_adjacency()

void polyfem::mesh::NCMesh3D::build_element_vertex_adjacency ( )
protected

Definition at line 1071 of file NCMesh3D.cpp.

References edges, faces, and vertices.

Referenced by prepare_mesh().

Here is the caller graph for this function:

◆ build_face_follower_chain()

void polyfem::mesh::NCMesh3D::build_face_follower_chain ( )
protected

Definition at line 1034 of file NCMesh3D.cpp.

References edges, faces, and traverse_face().

Referenced by prepare_mesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ build_from_matrices()

bool polyfem::mesh::NCMesh3D::build_from_matrices ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  F 
)
overridevirtual

build a mesh from matrices

Parameters
[in]Vvertices
[in]Fconnectivity
Returns
if success

Implements polyfem::mesh::Mesh.

Definition at line 52 of file NCMesh3D.cpp.

References add_element(), adj_prepared, edgeMap, edges, elements, polyfem::F, faceMap, index_prepared, midpointMap, n_elements, prepare_mesh(), refineHistory, V, and vertices.

Here is the call graph for this function:

◆ build_index_mapping()

void polyfem::mesh::NCMesh3D::build_index_mapping ( )

Definition at line 748 of file NCMesh3D.cpp.

References all_to_valid_edgeMap, all_to_valid_elemMap, all_to_valid_faceMap, all_to_valid_vertexMap, edges, elements, faces, index_prepared, n_edges(), n_elements, n_faces(), n_vertices(), valid_to_all_edgeMap, valid_to_all_elemMap, valid_to_all_faceMap, valid_to_all_vertexMap, and vertices.

Referenced by prepare_mesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cell_barycenter()

RowVectorNd polyfem::mesh::NCMesh3D::cell_barycenter ( const int  c) const
overridevirtual

cell barycenter

Parameters
[in]cglobal cell index
Returns
cell barycenter

Implements polyfem::mesh::Mesh.

Definition at line 140 of file NCMesh3D.cpp.

References face_vertex(), and point().

Referenced by compute_body_ids().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cell_edge()

int polyfem::mesh::NCMesh3D::cell_edge ( const int  c_id,
const int  le_id 
) const
inlineoverridevirtual

Implements polyfem::mesh::Mesh3D.

Definition at line 222 of file NCMesh3D.hpp.

References all_to_valid_edge(), edges, elements, and valid_to_all_elem().

Here is the call graph for this function:

◆ cell_face()

int polyfem::mesh::NCMesh3D::cell_face ( const int  c_id,
const int  lf_id 
) const
inlineoverridevirtual

Implements polyfem::mesh::Mesh3D.

Definition at line 221 of file NCMesh3D.hpp.

References all_to_valid_face(), elements, faces, and valid_to_all_elem().

Referenced by get_index_from_element(), get_index_from_element(), get_index_from_element_edge(), get_index_from_element_face(), switch_element(), and switch_face().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cell_ref_level()

int polyfem::mesh::NCMesh3D::cell_ref_level ( const int  c_id) const
inline

Definition at line 227 of file NCMesh3D.hpp.

References elements, and valid_to_all_elem().

Here is the call graph for this function:

◆ cell_vertex()

int polyfem::mesh::NCMesh3D::cell_vertex ( const int  f_id,
const int  lv_id 
) const
inlineoverridevirtual

id of the vertex of a cell

Parameters
[in]f_idglobal cell id
[in]lv_idlocal vertex id
Returns
vertex id

Implements polyfem::mesh::Mesh.

Definition at line 220 of file NCMesh3D.hpp.

References all_to_valid_vertex(), elements, valid_to_all_elem(), and vertices.

Referenced by get_ordered_vertices_from_tet(), and is_boundary_element().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ coarsen_element()

void polyfem::mesh::NCMesh3D::coarsen_element ( int  id_full)

Definition at line 657 of file NCMesh3D.cpp.

References edges, elements, faces, n_elements, refineHistory, and vertices.

◆ compute_body_ids()

void polyfem::mesh::NCMesh3D::compute_body_ids ( const std::function< int(const size_t, const std::vector< int > &, const RowVectorNd &)> &  marker)
overridevirtual

computes boundary selections based on a function

Parameters
[in]markerlambda function that takes the id and barycenter and returns an integer

Implements polyfem::mesh::Mesh.

Definition at line 187 of file NCMesh3D.cpp.

References polyfem::mesh::Mesh::body_ids_, cell_barycenter(), polyfem::mesh::Mesh::element_vertices(), elements, n_cells(), and valid_to_all_elem().

Here is the call graph for this function:

◆ compute_boundary_ids()

void polyfem::mesh::NCMesh3D::compute_boundary_ids ( const std::function< int(const size_t, const std::vector< int > &, const RowVectorNd &, bool)> &  marker)
overridevirtual

computes boundary selections based on a function

Parameters
[in]markerlambda 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

Implements polyfem::mesh::Mesh.

Definition at line 166 of file NCMesh3D.cpp.

References polyfem::mesh::Mesh::boundary_ids_, face_barycenter(), face_vertex(), faces, is_boundary_face(), n_face_vertices(), n_faces(), and valid_to_all_face().

Here is the call graph for this function:

◆ compute_elements_tag()

void polyfem::mesh::NCMesh3D::compute_elements_tag ( )
overridevirtual

compute element types, see ElementType

Implements polyfem::mesh::Mesh.

Definition at line 99 of file NCMesh3D.cpp.

References polyfem::mesh::Mesh::elements_tag_, n_cells(), and polyfem::mesh::SIMPLEX.

Referenced by prepare_mesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copy()

std::unique_ptr< Mesh > polyfem::mesh::NCMesh3D::copy ( ) const
overridevirtual

Create a copy of the mesh.

Returns
pointer to the new copy mesh

Implements polyfem::mesh::Mesh.

Definition at line 827 of file NCMesh3D.cpp.

◆ edge_barycenter()

RowVectorNd polyfem::mesh::NCMesh3D::edge_barycenter ( const int  e) const
overridevirtual

edge barycenter

Parameters
[in]eglobal edge index
Returns
edge barycenter

Implements polyfem::mesh::Mesh.

Definition at line 125 of file NCMesh3D.cpp.

References edge_vertex(), and point().

Here is the call graph for this function:

◆ edge_length()

double polyfem::mesh::NCMesh3D::edge_length ( const int  gid) const
overridevirtual

edge length

Parameters
[in]gidglobal edge id
Returns
edge length

Reimplemented from polyfem::mesh::Mesh.

Definition at line 107 of file NCMesh3D.cpp.

References edge_vertex(), and point().

Here is the call graph for this function:

◆ edge_neighs()

std::vector< uint32_t > polyfem::mesh::NCMesh3D::edge_neighs ( const int  e_gid) const
overridevirtual

Implements polyfem::mesh::Mesh3D.

Definition at line 446 of file NCMesh3D.cpp.

References all_to_valid_elem(), edges, and valid_to_all_edge().

Here is the call graph for this function:

◆ edge_vertex()

int polyfem::mesh::NCMesh3D::edge_vertex ( const int  e_id,
const int  lv_id 
) const
inlineoverridevirtual

id of the edge vertex

Parameters
[in]e_idglobal edge id
[in]lv_idlocal vertex index
Returns
int id of the face vertex

Implements polyfem::mesh::Mesh.

Definition at line 225 of file NCMesh3D.hpp.

References all_to_valid_vertex(), edges, valid_to_all_edge(), and vertices.

Referenced by edge_barycenter(), edge_length(), get_index_from_element_face(), and switch_vertex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ face_barycenter()

RowVectorNd polyfem::mesh::NCMesh3D::face_barycenter ( const int  f) const
overridevirtual

face barycenter

Parameters
[in]fglobal face index
Returns
face barycenter

Implements polyfem::mesh::Mesh.

Definition at line 132 of file NCMesh3D.cpp.

References face_vertex(), and point().

Referenced by compute_boundary_ids().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ face_edge()

int polyfem::mesh::NCMesh3D::face_edge ( const int  f_id,
const int  le_id 
) const

Definition at line 18 of file NCMesh3D.cpp.

References all_to_valid_edge(), faces, find_edge(), and valid_to_all_face().

Referenced by get_index_from_element(), get_index_from_element(), get_index_from_element_edge(), get_index_from_element_face(), switch_edge(), and switch_face().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ face_vertex()

int polyfem::mesh::NCMesh3D::face_vertex ( const int  f_id,
const int  lv_id 
) const
inlineoverridevirtual

id of the face vertex

Parameters
[in]f_idglobal face id
[in]lv_idlocal vertex index
Returns
int id of the face vertex

Implements polyfem::mesh::Mesh.

Definition at line 223 of file NCMesh3D.hpp.

References all_to_valid_vertex(), faces, valid_to_all_face(), and vertices.

Referenced by cell_barycenter(), compute_boundary_ids(), face_barycenter(), get_index_from_element(), get_index_from_element(), get_index_from_element_edge(), get_index_from_element_face(), switch_face(), and switch_vertex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_edge() [1/2]

int polyfem::mesh::NCMesh3D::find_edge ( const int  v1,
const int  v2 
) const
inlineprotected

Definition at line 441 of file NCMesh3D.hpp.

References find_edge().

Referenced by find_edge().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_edge() [2/2]

int polyfem::mesh::NCMesh3D::find_edge ( Eigen::Vector2i  v) const
protected

Definition at line 898 of file NCMesh3D.cpp.

References edgeMap.

Referenced by face_edge(), get_edge(), get_index_from_element_edge(), mark_boundary(), refine_element(), traverse_edge(), and traverse_face().

Here is the caller graph for this function:

◆ find_face() [1/2]

int polyfem::mesh::NCMesh3D::find_face ( const int  v1,
const int  v2,
const int  v3 
) const
inlineprotected

Definition at line 449 of file NCMesh3D.hpp.

References find_face().

Referenced by find_face().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_face() [2/2]

int polyfem::mesh::NCMesh3D::find_face ( Eigen::Vector3i  v) const
protected

Definition at line 919 of file NCMesh3D.cpp.

References faceMap.

Referenced by get_face(), get_index_from_element_face(), refine_element(), and traverse_face().

Here is the caller graph for this function:

◆ find_vertex() [1/2]

int polyfem::mesh::NCMesh3D::find_vertex ( const int  v1,
const int  v2 
) const
inlineprotected

Definition at line 434 of file NCMesh3D.hpp.

References find_vertex().

Referenced by find_vertex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_vertex() [2/2]

int polyfem::mesh::NCMesh3D::find_vertex ( Eigen::Vector2i  v) const
protected

Definition at line 876 of file NCMesh3D.cpp.

References midpointMap.

Referenced by get_vertex(), refine_element(), traverse_edge(), and traverse_face().

Here is the caller graph for this function:

◆ get_body_id()

int polyfem::mesh::NCMesh3D::get_body_id ( const int  primitive) const
inlineoverridevirtual

Get the volume selection of an element (cell in 3d, face in 2d)

Parameters
[in]primitiveelement id
Returns
label of element

Reimplemented from polyfem::mesh::Mesh.

Definition at line 266 of file NCMesh3D.hpp.

References elements, and valid_to_all_elem().

Here is the call graph for this function:

◆ get_boundary_id()

int polyfem::mesh::NCMesh3D::get_boundary_id ( const int  primitive) const
inlineoverridevirtual

Get the boundary selection of an element (face in 3d, edge in 2d)

Parameters
[in]primitiveelement id
Returns
label of element

Reimplemented from polyfem::mesh::Mesh.

Definition at line 265 of file NCMesh3D.hpp.

References faces, and valid_to_all_face().

Here is the call graph for this function:

◆ get_edge() [1/2]

int polyfem::mesh::NCMesh3D::get_edge ( const int  v1,
const int  v2 
)
inlineprotected

Definition at line 445 of file NCMesh3D.hpp.

References get_edge().

Referenced by get_edge().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_edge() [2/2]

int polyfem::mesh::NCMesh3D::get_edge ( Eigen::Vector2i  v)
protected

Definition at line 907 of file NCMesh3D.cpp.

References edgeMap, edges, and find_edge().

Referenced by add_element(), and refine_element().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_edge_elements_neighs()

void polyfem::mesh::NCMesh3D::get_edge_elements_neighs ( const int  e_id,
std::vector< int > &  ids 
) const
overridevirtual

Implements polyfem::mesh::Mesh3D.

Definition at line 531 of file NCMesh3D.cpp.

References all_to_valid_elem(), edges, and valid_to_all_edge().

Here is the call graph for this function:

◆ get_face() [1/2]

int polyfem::mesh::NCMesh3D::get_face ( const int  v1,
const int  v2,
const int  v3 
)
inlineprotected

Definition at line 452 of file NCMesh3D.hpp.

References get_face().

Referenced by get_face().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_face() [2/2]

int polyfem::mesh::NCMesh3D::get_face ( Eigen::Vector3i  v)
protected

Definition at line 928 of file NCMesh3D.cpp.

References faceMap, faces, and find_face().

Referenced by add_element(), and refine_element().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_face_elements_neighs()

void polyfem::mesh::NCMesh3D::get_face_elements_neighs ( const int  f_id,
std::vector< int > &  ids 
) const

Definition at line 537 of file NCMesh3D.cpp.

References all_to_valid_elem(), faces, and valid_to_all_face().

Here is the call graph for this function:

◆ get_index_from_element() [1/2]

Navigation3D::Index polyfem::mesh::NCMesh3D::get_index_from_element ( int  hi) const
overridevirtual

◆ get_index_from_element() [2/2]

Navigation3D::Index polyfem::mesh::NCMesh3D::get_index_from_element ( int  hi,
int  lf,
int  lv 
) const
overridevirtual

◆ get_index_from_element_edge()

Navigation3D::Index polyfem::mesh::NCMesh3D::get_index_from_element_edge ( int  hi,
int  v0,
int  v1 
) const
overridevirtual

◆ get_index_from_element_face()

Navigation3D::Index polyfem::mesh::NCMesh3D::get_index_from_element_face ( int  hi,
int  v0,
int  v1,
int  v2 
) const
overridevirtual

◆ get_ordered_vertices_from_tet()

std::array< int, 4 > polyfem::mesh::NCMesh3D::get_ordered_vertices_from_tet ( const int  element_index) const
overridevirtual

Reimplemented from polyfem::mesh::Mesh3D.

Definition at line 1122 of file NCMesh3D.cpp.

References cell_vertex().

Here is the call graph for this function:

◆ get_vertex()

int polyfem::mesh::NCMesh3D::get_vertex ( Eigen::Vector2i  v)
protected

Definition at line 885 of file NCMesh3D.cpp.

References find_vertex(), midpointMap, and vertices.

Referenced by refine_element().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_vertex_elements_neighs()

void polyfem::mesh::NCMesh3D::get_vertex_elements_neighs ( const int  v_id,
std::vector< int > &  ids 
) const
overridevirtual

Implements polyfem::mesh::Mesh3D.

Definition at line 525 of file NCMesh3D.cpp.

References all_to_valid_elem(), valid_to_all_vertex(), and vertices.

Here is the call graph for this function:

◆ is_boundary_edge()

bool polyfem::mesh::NCMesh3D::is_boundary_edge ( const int  edge_global_id) const
inlineoverridevirtual

is edge boundary

Parameters
[in]edge_global_idglobal edge id
Returns
is edge boundary

Implements polyfem::mesh::Mesh.

Definition at line 230 of file NCMesh3D.hpp.

References edges, and valid_to_all_edge().

Here is the call graph for this function:

◆ is_boundary_element()

bool polyfem::mesh::NCMesh3D::is_boundary_element ( const int  element_global_id) const
overridevirtual

is cell boundary

Parameters
[in]element_global_idglobal cell id
Returns
is cell boundary

Implements polyfem::mesh::Mesh.

Definition at line 42 of file NCMesh3D.cpp.

References cell_vertex(), index_prepared, is_boundary_vertex(), and n_cell_edges().

Here is the call graph for this function:

◆ is_boundary_face()

bool polyfem::mesh::NCMesh3D::is_boundary_face ( const int  face_global_id) const
inlineoverridevirtual

is face boundary

Parameters
[in]face_global_idglobal face id
Returns
is face boundary

Implements polyfem::mesh::Mesh.

Definition at line 231 of file NCMesh3D.hpp.

References faces, and valid_to_all_face().

Referenced by compute_boundary_ids().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_boundary_vertex()

bool polyfem::mesh::NCMesh3D::is_boundary_vertex ( const int  vertex_global_id) const
inlineoverridevirtual

is vertex boundary

Parameters
[in]vertex_global_idglobal vertex id
Returns
is vertex boundary

Implements polyfem::mesh::Mesh.

Definition at line 229 of file NCMesh3D.hpp.

References valid_to_all_vertex(), and vertices.

Referenced by is_boundary_element().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_conforming()

bool polyfem::mesh::NCMesh3D::is_conforming ( ) const
inlineoverridevirtual

if the mesh is conforming

Returns
if the mesh is conforming

Implements polyfem::mesh::Mesh.

Definition at line 186 of file NCMesh3D.hpp.

◆ kernel()

RowVectorNd polyfem::mesh::NCMesh3D::kernel ( const int  cell_id) const
overridevirtual

Implements polyfem::mesh::Mesh3D.

Definition at line 320 of file NCMesh3D.cpp.

◆ leader_edge_of_edge()

int polyfem::mesh::NCMesh3D::leader_edge_of_edge ( const int  e_id) const
inline

Definition at line 286 of file NCMesh3D.hpp.

References adj_prepared, all_to_valid_edge(), edges, and valid_to_all_edge().

Here is the call graph for this function:

◆ leader_edge_of_vertex()

int polyfem::mesh::NCMesh3D::leader_edge_of_vertex ( const int  v_id) const
inline

Definition at line 281 of file NCMesh3D.hpp.

References adj_prepared, all_to_valid_edge(), valid_to_all_vertex(), and vertices.

Here is the call graph for this function:

◆ leader_face_of_edge()

int polyfem::mesh::NCMesh3D::leader_face_of_edge ( const int  e_id) const
inline

Definition at line 298 of file NCMesh3D.hpp.

References adj_prepared, all_to_valid_face(), edges, and valid_to_all_edge().

Here is the call graph for this function:

◆ leader_face_of_face()

int polyfem::mesh::NCMesh3D::leader_face_of_face ( const int  f_id) const
inline

Definition at line 304 of file NCMesh3D.hpp.

References adj_prepared, all_to_valid_face(), faces, and valid_to_all_face().

Here is the call graph for this function:

◆ leader_face_of_vertex()

int polyfem::mesh::NCMesh3D::leader_face_of_vertex ( const int  v_id) const
inline

Definition at line 292 of file NCMesh3D.hpp.

References adj_prepared, all_to_valid_face(), valid_to_all_vertex(), and vertices.

Here is the call graph for this function:

◆ load() [1/2]

bool polyfem::mesh::NCMesh3D::load ( const GEO::Mesh &  M)
overrideprotectedvirtual

loads a mesh from a geo mesh

Parameters
[in]Mgeo mesh
Returns
if success

Implements polyfem::mesh::Mesh.

Definition at line 842 of file NCMesh3D.cpp.

References add_element(), n_elements, prepare_mesh(), V, and vertices.

Here is the call graph for this function:

◆ load() [2/2]

bool polyfem::mesh::NCMesh3D::load ( const std::string &  path)
overrideprotectedvirtual

loads a mesh from the path

Parameters
[in]pathfile location
Returns
if success

Implements polyfem::mesh::Mesh.

Definition at line 832 of file NCMesh3D.cpp.

References polyfem::utils::StringUtils::endswith(), and load().

Referenced by load().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mark_boundary()

void polyfem::mesh::NCMesh3D::mark_boundary ( )

Definition at line 699 of file NCMesh3D.cpp.

References edges, faces, find_edge(), and vertices.

Referenced by prepare_mesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ n_cell_edges()

int polyfem::mesh::NCMesh3D::n_cell_edges ( const int  c_id) const
inlineoverridevirtual

Implements polyfem::mesh::Mesh3D.

Definition at line 218 of file NCMesh3D.hpp.

Referenced by is_boundary_element().

Here is the caller graph for this function:

◆ n_cell_faces()

int polyfem::mesh::NCMesh3D::n_cell_faces ( const int  c_id) const
inlineoverridevirtual

Implements polyfem::mesh::Mesh3D.

Definition at line 219 of file NCMesh3D.hpp.

Referenced by switch_element().

Here is the caller graph for this function:

◆ n_cell_vertices()

int polyfem::mesh::NCMesh3D::n_cell_vertices ( const int  c_id) const
inlineoverridevirtual

number of vertices of a cell

Parameters
[in]c_idglobal cell id (face for 2d meshes)
Returns
number of vertices

Implements polyfem::mesh::Mesh.

Definition at line 217 of file NCMesh3D.hpp.

◆ n_cells()

int polyfem::mesh::NCMesh3D::n_cells ( ) const
inlineoverridevirtual

number of cells

Returns
number of cells

Implements polyfem::mesh::Mesh.

Definition at line 188 of file NCMesh3D.hpp.

References n_elements.

Referenced by append(), attach_higher_order_nodes(), compute_body_ids(), compute_elements_tag(), set_body_ids(), and update_elements_tag().

Here is the caller graph for this function:

◆ n_edge_cells()

int polyfem::mesh::NCMesh3D::n_edge_cells ( const int  e_id) const
inline

Definition at line 216 of file NCMesh3D.hpp.

References edges, and valid_to_all_edge().

Here is the call graph for this function:

◆ n_edges()

int polyfem::mesh::NCMesh3D::n_edges ( ) const
inlineoverridevirtual

number of edges

Returns
number of edges

Implements polyfem::mesh::Mesh.

Definition at line 197 of file NCMesh3D.hpp.

References edges.

Referenced by build_index_mapping().

Here is the caller graph for this function:

◆ n_face_cells()

int polyfem::mesh::NCMesh3D::n_face_cells ( const int  f_id) const
inline

Definition at line 215 of file NCMesh3D.hpp.

References faces, and valid_to_all_face().

Here is the call graph for this function:

◆ n_face_vertices()

int polyfem::mesh::NCMesh3D::n_face_vertices ( const int  f_id) const
inlineoverridevirtual

number of vertices of a face

Parameters
[in]f_idglobal face id
Returns
number of vertices

Implements polyfem::mesh::Mesh.

Definition at line 214 of file NCMesh3D.hpp.

Referenced by compute_boundary_ids(), get_index_from_element_edge(), get_index_from_element_face(), switch_face(), and switch_vertex().

Here is the caller graph for this function:

◆ n_faces()

int polyfem::mesh::NCMesh3D::n_faces ( ) const
inlineoverridevirtual

number of faces

Returns
number of faces

Implements polyfem::mesh::Mesh.

Definition at line 189 of file NCMesh3D.hpp.

References faces.

Referenced by build_index_mapping(), compute_boundary_ids(), and set_boundary_ids().

Here is the caller graph for this function:

◆ n_follower_edges()

int polyfem::mesh::NCMesh3D::n_follower_edges ( const int  e_id) const
inline

Definition at line 312 of file NCMesh3D.hpp.

References adj_prepared, edges, and valid_to_all_edge().

Here is the call graph for this function:

◆ n_follower_faces()

int polyfem::mesh::NCMesh3D::n_follower_faces ( const int  e_id) const
inline

Definition at line 317 of file NCMesh3D.hpp.

References adj_prepared, faces, and valid_to_all_face().

Here is the call graph for this function:

◆ n_vertices()

int polyfem::mesh::NCMesh3D::n_vertices ( ) const
inlineoverridevirtual

number of vertices

Returns
number of vertices

Implements polyfem::mesh::Mesh.

Definition at line 205 of file NCMesh3D.hpp.

References vertices.

Referenced by append(), and build_index_mapping().

Here is the caller graph for this function:

◆ next_around_edge()

Navigation3D::Index polyfem::mesh::NCMesh3D::next_around_edge ( Navigation3D::Index  idx) const
overridevirtual

Implements polyfem::mesh::Mesh3D.

Definition at line 516 of file NCMesh3D.cpp.

References switch_element(), and switch_face().

Here is the call graph for this function:

◆ next_around_face()

Navigation3D::Index polyfem::mesh::NCMesh3D::next_around_face ( Navigation3D::Index  idx) const
overridevirtual

Implements polyfem::mesh::Mesh3D.

Definition at line 520 of file NCMesh3D.cpp.

References switch_edge(), and switch_vertex().

Here is the call graph for this function:

◆ normalize()

void polyfem::mesh::NCMesh3D::normalize ( )
overridevirtual

normalize the mesh

Implements polyfem::mesh::Mesh.

Definition at line 87 of file NCMesh3D.cpp.

References bounding_box(), and vertices.

Here is the call graph for this function:

◆ operator=() [1/2]

NCMesh3D & polyfem::mesh::NCMesh3D::operator= ( const NCMesh3D )
default

◆ operator=() [2/2]

NCMesh3D & polyfem::mesh::NCMesh3D::operator= ( NCMesh3D &&  )
default

◆ point()

RowVectorNd polyfem::mesh::NCMesh3D::point ( const int  global_index) const
overridevirtual

point coordinates

Parameters
[in]global_indexglobal vertex index
Returns
RowVectorNd

Implements polyfem::mesh::Mesh.

Definition at line 115 of file NCMesh3D.cpp.

References valid_to_all_vertex(), and vertices.

Referenced by cell_barycenter(), edge_barycenter(), edge_length(), and face_barycenter().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ prepare_mesh()

void polyfem::mesh::NCMesh3D::prepare_mesh ( )
inlineoverridevirtual

method used to finalize the mesh.

It computes the cached stuff used in navigation

Reimplemented from polyfem::mesh::Mesh.

Definition at line 344 of file NCMesh3D.hpp.

References adj_prepared, build_edge_follower_chain(), build_element_vertex_adjacency(), build_face_follower_chain(), build_index_mapping(), compute_elements_tag(), and mark_boundary().

Referenced by append(), build_from_matrices(), and load().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ refine()

void polyfem::mesh::NCMesh3D::refine ( const int  n_refinement,
const double  t 
)
overridevirtual

refine the mesh

Parameters
[in]n_refinementnumber of refinements
[in]tposition of the refinement location (0.5 for standard refinement)

Implements polyfem::mesh::Mesh.

Definition at line 26 of file NCMesh3D.cpp.

References elements, polyfem::utils::is_valid(), refine(), and refine_element().

Referenced by refine().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ refine_element()

void polyfem::mesh::NCMesh3D::refine_element ( int  id_full)

Definition at line 544 of file NCMesh3D.cpp.

References add_element(), edge_id, edges, elements, faces, find_edge(), find_face(), find_vertex(), get_edge(), get_face(), get_vertex(), polyfem::utils::is_valid(), n_elements, refineHistory, and vertices.

Referenced by refine(), and refine_elements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ refine_elements()

void polyfem::mesh::NCMesh3D::refine_elements ( const std::vector< int > &  ids)

Definition at line 647 of file NCMesh3D.cpp.

References refine_element(), and valid_to_all_elem().

Here is the call graph for this function:

◆ save()

bool polyfem::mesh::NCMesh3D::save ( const std::string &  path) const
inlineoverridevirtual

Implements polyfem::mesh::Mesh.

Definition at line 234 of file NCMesh3D.hpp.

◆ set_body_ids()

void polyfem::mesh::NCMesh3D::set_body_ids ( const std::vector< int > &  body_ids)
overridevirtual

Set the volume sections.

Parameters
[in]body_idsvector of labels, one per element

Reimplemented from polyfem::mesh::Mesh.

Definition at line 207 of file NCMesh3D.cpp.

References elements, n_cells(), and valid_to_all_elem().

Here is the call graph for this function:

◆ set_boundary_ids()

void polyfem::mesh::NCMesh3D::set_boundary_ids ( const std::vector< int > &  boundary_ids)
overridevirtual

Set the boundary selection from a vector.

Parameters
[in]boundary_idsvector one value per element

Reimplemented from polyfem::mesh::Mesh.

Definition at line 199 of file NCMesh3D.cpp.

References faces, n_faces(), and valid_to_all_face().

Here is the call graph for this function:

◆ set_point()

void polyfem::mesh::NCMesh3D::set_point ( const int  global_index,
const RowVectorNd p 
)
overridevirtual

Set the point.

Parameters
[in]global_indexglobal vertex index
[in]pvalue

Implements polyfem::mesh::Mesh.

Definition at line 120 of file NCMesh3D.cpp.

References valid_to_all_vertex(), and vertices.

Here is the call graph for this function:

◆ switch_edge()

Navigation3D::Index polyfem::mesh::NCMesh3D::switch_edge ( Navigation3D::Index  idx) const
overridevirtual

Implements polyfem::mesh::Mesh3D.

Definition at line 468 of file NCMesh3D.cpp.

References polyfem::mesh::Navigation3D::Index::edge, polyfem::mesh::Navigation3D::Index::face, polyfem::mesh::Navigation3D::Index::face_corner, and face_edge().

Referenced by get_index_from_element_face(), and next_around_face().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ switch_element()

Navigation3D::Index polyfem::mesh::NCMesh3D::switch_element ( Navigation3D::Index  idx) const
overridevirtual

Implements polyfem::mesh::Mesh3D.

Definition at line 497 of file NCMesh3D.cpp.

References all_to_valid_elem(), cell_face(), polyfem::mesh::Navigation3D::Index::element, polyfem::mesh::Navigation3D::Index::element_patch, polyfem::mesh::Navigation3D::Index::face, faces, n_cell_faces(), and valid_to_all_face().

Referenced by next_around_edge().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ switch_face()

Navigation3D::Index polyfem::mesh::NCMesh3D::switch_face ( Navigation3D::Index  idx) const
overridevirtual

Implements polyfem::mesh::Mesh3D.

Definition at line 476 of file NCMesh3D.cpp.

References cell_face(), polyfem::mesh::Navigation3D::Index::edge, polyfem::mesh::Navigation3D::Index::element, polyfem::mesh::Navigation3D::Index::element_patch, polyfem::mesh::Navigation3D::Index::face, polyfem::mesh::Navigation3D::Index::face_corner, face_edge(), face_vertex(), n_face_vertices(), and polyfem::mesh::Navigation3D::Index::vertex.

Referenced by next_around_edge().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ switch_vertex()

Navigation3D::Index polyfem::mesh::NCMesh3D::switch_vertex ( Navigation3D::Index  idx) const
overridevirtual

Implements polyfem::mesh::Mesh3D.

Definition at line 455 of file NCMesh3D.cpp.

References polyfem::mesh::Navigation3D::Index::edge, edge_vertex(), polyfem::mesh::Navigation3D::Index::face, polyfem::mesh::Navigation3D::Index::face_corner, face_vertex(), n_face_vertices(), and polyfem::mesh::Navigation3D::Index::vertex.

Referenced by get_index_from_element_edge(), get_index_from_element_face(), and next_around_face().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ traverse_edge()

void polyfem::mesh::NCMesh3D::traverse_edge ( Eigen::Vector2i  v,
double  p1,
double  p2,
int  depth,
std::vector< follower_edge > &  list 
) const
protected

Definition at line 940 of file NCMesh3D.cpp.

References edges, find_edge(), find_vertex(), and traverse_edge().

Referenced by build_edge_follower_chain(), and traverse_edge().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ traverse_face()

void polyfem::mesh::NCMesh3D::traverse_face ( int  v1,
int  v2,
int  v3,
Eigen::Vector2d  p1,
Eigen::Vector2d  p2,
Eigen::Vector2d  p3,
int  depth,
std::vector< follower_face > &  face_list,
std::vector< int > &  edge_list 
) const
protected

Definition at line 996 of file NCMesh3D.cpp.

References faces, find_edge(), find_face(), find_vertex(), and traverse_face().

Referenced by build_face_follower_chain(), and traverse_face().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_elements_tag()

void polyfem::mesh::NCMesh3D::update_elements_tag ( )
overridevirtual

Update elements types.

Reimplemented from polyfem::mesh::Mesh.

Definition at line 103 of file NCMesh3D.cpp.

References polyfem::mesh::Mesh::elements_tag_, n_cells(), and polyfem::mesh::SIMPLEX.

Here is the call graph for this function:

◆ valid_to_all_edge()

int polyfem::mesh::NCMesh3D::valid_to_all_edge ( const int  id) const
inlineprotected

Definition at line 402 of file NCMesh3D.hpp.

References index_prepared, and valid_to_all_edgeMap.

Referenced by edge_neighs(), edge_vertex(), get_edge_elements_neighs(), is_boundary_edge(), leader_edge_of_edge(), leader_face_of_edge(), n_edge_cells(), and n_follower_edges().

Here is the caller graph for this function:

◆ valid_to_all_elem()

int polyfem::mesh::NCMesh3D::valid_to_all_elem ( const int  id) const
inlineprotected

Definition at line 426 of file NCMesh3D.hpp.

References index_prepared, and valid_to_all_elemMap.

Referenced by cell_edge(), cell_face(), cell_ref_level(), cell_vertex(), compute_body_ids(), get_body_id(), refine_elements(), and set_body_ids().

Here is the caller graph for this function:

◆ valid_to_all_face()

int polyfem::mesh::NCMesh3D::valid_to_all_face ( const int  id) const
inlineprotected

Definition at line 414 of file NCMesh3D.hpp.

References index_prepared, and valid_to_all_faceMap.

Referenced by compute_boundary_ids(), face_edge(), face_vertex(), get_boundary_id(), get_face_elements_neighs(), is_boundary_face(), leader_face_of_face(), n_face_cells(), n_follower_faces(), set_boundary_ids(), and switch_element().

Here is the caller graph for this function:

◆ valid_to_all_vertex()

int polyfem::mesh::NCMesh3D::valid_to_all_vertex ( const int  id) const
inlineprotected

Definition at line 390 of file NCMesh3D.hpp.

References index_prepared, and valid_to_all_vertexMap.

Referenced by get_index_from_element_edge(), get_index_from_element_face(), get_vertex_elements_neighs(), is_boundary_vertex(), leader_edge_of_vertex(), leader_face_of_vertex(), point(), set_point(), and vertex_neighs().

Here is the caller graph for this function:

◆ vertex_neighs()

std::vector< uint32_t > polyfem::mesh::NCMesh3D::vertex_neighs ( const int  v_gid) const
overridevirtual

Implements polyfem::mesh::Mesh3D.

Definition at line 438 of file NCMesh3D.cpp.

References all_to_valid_elem(), valid_to_all_vertex(), and vertices.

Here is the call graph for this function:

Member Data Documentation

◆ adj_prepared

◆ all_to_valid_edgeMap

std::vector<int> polyfem::mesh::NCMesh3D::all_to_valid_edgeMap
protected

Definition at line 480 of file NCMesh3D.hpp.

Referenced by all_to_valid_edge(), and build_index_mapping().

◆ all_to_valid_elemMap

std::vector<int> polyfem::mesh::NCMesh3D::all_to_valid_elemMap
protected

Definition at line 478 of file NCMesh3D.hpp.

Referenced by all_to_valid_elem(), and build_index_mapping().

◆ all_to_valid_faceMap

std::vector<int> polyfem::mesh::NCMesh3D::all_to_valid_faceMap
protected

Definition at line 481 of file NCMesh3D.hpp.

Referenced by all_to_valid_face(), and build_index_mapping().

◆ all_to_valid_vertexMap

std::vector<int> polyfem::mesh::NCMesh3D::all_to_valid_vertexMap
protected

Definition at line 479 of file NCMesh3D.hpp.

Referenced by all_to_valid_vertex(), and build_index_mapping().

◆ edgeMap

std::unordered_map<Eigen::Vector2i, int, ArrayHasher2D> polyfem::mesh::NCMesh3D::edgeMap
protected

Definition at line 475 of file NCMesh3D.hpp.

Referenced by build_from_matrices(), find_edge(), and get_edge().

◆ edges

◆ elementAdj

Eigen::SparseMatrix<bool, Eigen::RowMajor> polyfem::mesh::NCMesh3D::elementAdj
protected

Definition at line 486 of file NCMesh3D.hpp.

◆ elements

◆ faceMap

std::unordered_map<Eigen::Vector3i, int, ArrayHasher3D> polyfem::mesh::NCMesh3D::faceMap
protected

Definition at line 476 of file NCMesh3D.hpp.

Referenced by build_from_matrices(), find_face(), and get_face().

◆ faces

◆ index_prepared

◆ midpointMap

std::unordered_map<Eigen::Vector2i, int, ArrayHasher2D> polyfem::mesh::NCMesh3D::midpointMap
protected

Definition at line 474 of file NCMesh3D.hpp.

Referenced by build_from_matrices(), find_vertex(), and get_vertex().

◆ n_elements

int polyfem::mesh::NCMesh3D::n_elements = 0
protected

◆ refineHistory

std::vector<int> polyfem::mesh::NCMesh3D::refineHistory
protected

Definition at line 483 of file NCMesh3D.hpp.

Referenced by build_from_matrices(), coarsen_element(), and refine_element().

◆ valid_to_all_edgeMap

std::vector<int> polyfem::mesh::NCMesh3D::valid_to_all_edgeMap
protected

Definition at line 480 of file NCMesh3D.hpp.

Referenced by build_index_mapping(), and valid_to_all_edge().

◆ valid_to_all_elemMap

std::vector<int> polyfem::mesh::NCMesh3D::valid_to_all_elemMap
protected

Definition at line 478 of file NCMesh3D.hpp.

Referenced by build_index_mapping(), and valid_to_all_elem().

◆ valid_to_all_faceMap

std::vector<int> polyfem::mesh::NCMesh3D::valid_to_all_faceMap
protected

Definition at line 481 of file NCMesh3D.hpp.

Referenced by build_index_mapping(), and valid_to_all_face().

◆ valid_to_all_vertexMap

std::vector<int> polyfem::mesh::NCMesh3D::valid_to_all_vertexMap
protected

Definition at line 479 of file NCMesh3D.hpp.

Referenced by build_index_mapping(), and valid_to_all_vertex().

◆ vertices


The documentation for this class was generated from the following files: