PolyFEM
|
#include <NCMesh2D.hpp>
Classes | |
struct | ArrayHasher2D |
struct | follower_edge |
struct | follower_face |
struct | ncBoundary |
struct | ncElem |
struct | ncVert |
Public Member Functions | |
NCMesh2D ()=default | |
virtual | ~NCMesh2D ()=default |
NCMesh2D (NCMesh2D &&)=default | |
NCMesh2D & | operator= (NCMesh2D &&)=default |
NCMesh2D (const NCMesh2D &)=default | |
NCMesh2D & | operator= (const NCMesh2D &)=default |
bool | is_conforming () const override |
if the mesh is conforming | |
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 | face_ref_level (const int f_id) const |
int | face_vertex (const int f_id, const int lv_id) const override |
id of the face vertex | |
int | edge_vertex (const int e_id, const int lv_id) const override |
id of the edge vertex | |
int | cell_vertex (const int f_id, const int lv_id) const override |
id of the vertex of a cell | |
int | face_edge (const int f_id, const int le_id) const |
int | leader_edge_of_vertex (const int v_id) const |
int | leader_edge_of_edge (const int e_id) const |
int | n_follower_edges (const int e_id) const |
int | n_face_neighbors (const int e_id) const |
int | face_neighbor (const int e_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_element (const int element_global_id) const override |
is cell boundary | |
void | refine (const int n_refinement, const double t) override |
refine the mesh | |
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 | |
std::pair< RowVectorNd, int > | edge_node (const Navigation::Index &index, const int n_new_nodes, const int i) const override |
std::pair< RowVectorNd, int > | face_node (const Navigation::Index &index, const int n_new_nodes, const int i, const int j) const override |
void | normalize () override |
normalize the mesh | |
double | edge_length (const int gid) const override |
edge length | |
void | compute_elements_tag () override |
compute element types, see ElementType | |
void | update_elements_tag () override |
Update elements types. | |
void | set_point (const int global_index, const RowVectorNd &p) override |
Set the point. | |
RowVectorNd | point (const int global_index) const override |
point coordinates | |
RowVectorNd | edge_barycenter (const int index) const override |
edge 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) | |
Navigation::Index | get_index_from_face (int f, int lv=0) const override |
Navigation::Index | switch_vertex (Navigation::Index idx) const override |
Navigation::Index | switch_edge (Navigation::Index idx) const override |
Navigation::Index | switch_face (Navigation::Index idx) const override |
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 () |
void | append (const Mesh &mesh) override |
appends a new mesh to the end of this | |
std::unique_ptr< Mesh > | copy () const override |
Create a copy of the mesh. | |
Public Member Functions inherited from polyfem::mesh::Mesh2D | |
Mesh2D ()=default | |
virtual | ~Mesh2D ()=default |
Mesh2D (Mesh2D &&)=default | |
Mesh2D & | operator= (Mesh2D &&)=default |
Mesh2D (const Mesh2D &)=default | |
Mesh2D & | operator= (const Mesh2D &)=default |
bool | is_volume () const override |
checks if mesh is volume | |
int | n_cells () const override |
number of cells | |
int | n_cell_vertices (const int c_id) const override |
number of vertices of a cell | |
bool | is_boundary_face (const int face_global_id) const override |
is face boundary | |
RowVectorNd | cell_barycenter (const int index) const override |
cell barycenter | |
void | compute_face_jacobian (const int el_id, const Eigen::MatrixXd &reference_map, Eigen::MatrixXd &jacobian) const |
void | barycentric_coords (const RowVectorNd &p, const int el_id, Eigen::MatrixXd &coord) const override |
constructs barycentric coodiantes for a point p. | |
RowVectorNd | face_barycenter (const int index) const override |
face barycenter | |
void | compute_element_barycenters (Eigen::MatrixXd &barycenters) const override |
utility for 2d/3d. | |
void | elements_boxes (std::vector< std::array< Eigen::Vector3d, 2 > > &boxes) const override |
constructs a box around every element (3d cell, 2d face) | |
Navigation::Index | next_around_face (Navigation::Index idx) const |
Navigation::Index | next_around_vertex (Navigation::Index idx) 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. | |
Public Member Functions inherited from polyfem::mesh::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 |
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 | |
virtual double | tri_area (const int gid) const |
area of a tri face of a tet 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::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. | |
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 double | element_weight_to_edge_weight (const int l, const Eigen::Vector2d &pos) |
Static Public Member Functions inherited from polyfem::mesh::Mesh | |
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 | |
bool | load (const std::string &path) override |
loads a mesh from the path | |
bool | load (const GEO::Mesh &mesh) 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_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) |
void | traverse_edge (Eigen::Vector2i v, double p1, double p2, int depth, std::vector< follower_edge > &list) const |
void | build_edge_follower_chain () |
void | build_element_vertex_adjacency () |
int | add_element (Eigen::Vector3i 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< ncElem > | elements |
std::vector< ncVert > | vertices |
std::vector< ncBoundary > | edges |
std::unordered_map< Eigen::Vector2i, int, ArrayHasher2D > | midpointMap |
std::unordered_map< Eigen::Vector2i, int, ArrayHasher2D > | edgeMap |
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 > | refineHistory |
Eigen::SparseMatrix< bool, Eigen::RowMajor > | elementAdj |
Protected Attributes inherited from polyfem::mesh::Mesh | |
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. | |
Definition at line 9 of file NCMesh2D.hpp.
|
default |
|
virtualdefault |
|
default |
|
default |
|
protected |
Definition at line 148 of file NCMesh2D.cpp.
References adj_prepared, edges, elements, get_edge(), index_prepared, n_elements, and vertices.
Referenced by append(), build_from_matrices(), load(), and refine_element().
|
inlineprotected |
Definition at line 330 of file NCMesh2D.hpp.
References all_to_valid_edgeMap, and index_prepared.
Referenced by face_edge(), get_index_from_face(), leader_edge_of_edge(), leader_edge_of_vertex(), and switch_edge().
|
inlineprotected |
Definition at line 344 of file NCMesh2D.hpp.
References all_to_valid_elemMap, and index_prepared.
Referenced by face_neighbor().
|
inlineprotected |
Definition at line 318 of file NCMesh2D.hpp.
References all_to_valid_vertexMap, and index_prepared.
Referenced by cell_vertex(), edge_vertex(), face_vertex(), get_index_from_face(), and switch_vertex().
|
overridevirtual |
appends a new mesh to the end of this
[in] | mesh | to append |
Reimplemented from polyfem::mesh::Mesh.
Definition at line 492 of file NCMesh2D.cpp.
References add_element(), polyfem::mesh::Mesh::append(), elements, n_faces(), n_vertices(), prepare_mesh(), and vertices.
|
overridevirtual |
attach high order nodes
[in] | V | nodes |
[in] | nodes | list of nodes per element |
Implements polyfem::mesh::Mesh.
Definition at line 71 of file NCMesh2D.cpp.
References n_faces().
|
overridevirtual |
computes the bbox of the mesh
[out] | min | min coodiante |
[out] | max | max coodiante |
Implements polyfem::mesh::Mesh.
Definition at line 590 of file NCMesh2D.cpp.
References vertices.
Referenced by normalize().
|
protected |
Definition at line 299 of file NCMesh2D.cpp.
References edges, elements, and traverse_edge().
Referenced by prepare_mesh().
|
protected |
Definition at line 375 of file NCMesh2D.cpp.
References edges, elements, polyfem::mesh::find(), polyfem::mesh::line_weight(), and vertices.
Referenced by prepare_mesh().
|
overridevirtual |
build a mesh from matrices
[in] | V | vertices |
[in] | F | connectivity |
Implements polyfem::mesh::Mesh.
Definition at line 39 of file NCMesh2D.cpp.
References add_element(), adj_prepared, edgeMap, edges, elements, polyfem::F, index_prepared, midpointMap, n_elements, polyfem::mesh::orient_normals_2d(), prepare_mesh(), refineHistory, polyfem::mesh::to_geogram_mesh(), V, and vertices.
void polyfem::mesh::NCMesh2D::build_index_mapping | ( | ) |
Definition at line 450 of file NCMesh2D.cpp.
References all_to_valid_edgeMap, all_to_valid_elemMap, all_to_valid_vertexMap, edges, elements, index_prepared, n_edges(), n_elements, n_vertices(), valid_to_all_edgeMap, valid_to_all_elemMap, valid_to_all_vertexMap, and vertices.
Referenced by prepare_mesh().
|
inlineoverridevirtual |
id of the vertex of a cell
[in] | f_id | global cell id |
[in] | lv_id | local vertex id |
Implements polyfem::mesh::Mesh.
Definition at line 193 of file NCMesh2D.hpp.
References all_to_valid_vertex(), elements, valid_to_all_elem(), and vertices.
void polyfem::mesh::NCMesh2D::coarsen_element | ( | int | id_full | ) |
Definition at line 254 of file NCMesh2D.cpp.
References adj_prepared, edges, elements, index_prepared, n_elements, refineHistory, and vertices.
|
overridevirtual |
computes boundary selections based on a function
[in] | marker | lambda function that takes the id and barycenter and returns an integer |
Implements polyfem::mesh::Mesh.
Definition at line 800 of file NCMesh2D.cpp.
References polyfem::mesh::Mesh::body_ids_, polyfem::mesh::Mesh::element_vertices(), elements, polyfem::mesh::Mesh2D::face_barycenter(), n_faces(), and valid_to_all_elem().
|
overridevirtual |
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 |
Implements polyfem::mesh::Mesh.
Definition at line 813 of file NCMesh2D.cpp.
References polyfem::mesh::Mesh::boundary_ids_, edge_barycenter(), edge_vertex(), edges, is_boundary_edge(), n_edges(), and valid_to_all_edge().
|
overridevirtual |
compute element types, see ElementType
Implements polyfem::mesh::Mesh.
Definition at line 703 of file NCMesh2D.cpp.
References polyfem::mesh::Mesh::elements_tag_, n_faces(), and polyfem::mesh::SIMPLEX.
Referenced by prepare_mesh().
|
overridevirtual |
Create a copy of the mesh.
Implements polyfem::mesh::Mesh.
Definition at line 517 of file NCMesh2D.cpp.
|
overridevirtual |
edge barycenter
[in] | e | global edge index |
Implements polyfem::mesh::Mesh.
Definition at line 717 of file NCMesh2D.cpp.
References edge_vertex(), and point().
Referenced by compute_boundary_ids().
|
overridevirtual |
edge length
[in] | gid | global edge id |
Reimplemented from polyfem::mesh::Mesh.
Definition at line 695 of file NCMesh2D.cpp.
References edge_vertex(), and point().
|
overridevirtual |
Implements polyfem::mesh::Mesh2D.
Definition at line 77 of file NCMesh2D.cpp.
References point(), switch_vertex(), and polyfem::mesh::Navigation::Index::vertex.
|
inlineoverridevirtual |
id of the edge vertex
[in] | e_id | global edge id |
[in] | lv_id | local vertex index |
Implements polyfem::mesh::Mesh.
Definition at line 192 of file NCMesh2D.hpp.
References all_to_valid_vertex(), edges, valid_to_all_edge(), and vertices.
Referenced by compute_boundary_ids(), edge_barycenter(), and edge_length().
|
static |
Definition at line 427 of file NCMesh2D.cpp.
|
inline |
Definition at line 195 of file NCMesh2D.hpp.
References all_to_valid_edge(), edges, elements, and valid_to_all_elem().
Referenced by is_boundary_element().
|
inline |
Definition at line 216 of file NCMesh2D.hpp.
References all_to_valid_elem(), edges, and valid_to_all_edge().
|
overridevirtual |
Implements polyfem::mesh::Mesh2D.
Definition at line 86 of file NCMesh2D.cpp.
References point(), switch_edge(), switch_vertex(), and polyfem::mesh::Navigation::Index::vertex.
|
inline |
Definition at line 189 of file NCMesh2D.hpp.
References elements, and valid_to_all_elem().
|
inlineoverridevirtual |
id of the face vertex
[in] | f_id | global face id |
[in] | lv_id | local vertex index |
Implements polyfem::mesh::Mesh.
Definition at line 191 of file NCMesh2D.hpp.
References all_to_valid_vertex(), elements, valid_to_all_elem(), and vertices.
|
inlineprotected |
Definition at line 364 of file NCMesh2D.hpp.
References find_edge().
Referenced by find_edge().
|
protected |
Definition at line 125 of file NCMesh2D.cpp.
References edgeMap.
Referenced by get_edge(), refine_element(), and traverse_edge().
|
inlineprotected |
Definition at line 357 of file NCMesh2D.hpp.
References find_vertex().
Referenced by find_vertex().
|
protected |
Definition at line 101 of file NCMesh2D.cpp.
References midpointMap.
Referenced by get_vertex(), refine_element(), and traverse_edge().
|
inlineoverridevirtual |
Get the volume selection of an element (cell in 3d, face in 2d)
[in] | primitive | element id |
Reimplemented from polyfem::mesh::Mesh.
Definition at line 262 of file NCMesh2D.hpp.
References elements, and valid_to_all_elem().
|
inlineoverridevirtual |
Get the boundary selection of an element (face in 3d, edge in 2d)
[in] | primitive | element id |
Reimplemented from polyfem::mesh::Mesh.
Definition at line 261 of file NCMesh2D.hpp.
References edges, and valid_to_all_edge().
|
inlineprotected |
Definition at line 368 of file NCMesh2D.hpp.
References get_edge().
Referenced by get_edge().
|
protected |
Definition at line 135 of file NCMesh2D.cpp.
References edgeMap, edges, and find_edge().
Referenced by add_element(), and refine_element().
|
overridevirtual |
Implements polyfem::mesh::Mesh2D.
Definition at line 607 of file NCMesh2D.cpp.
References all_to_valid_edge(), all_to_valid_vertex(), polyfem::mesh::Navigation::Index::edge, elements, polyfem::mesh::Navigation::Index::face, polyfem::mesh::Navigation::Index::face_corner, valid_to_all_elem(), and polyfem::mesh::Navigation::Index::vertex.
|
protected |
Definition at line 111 of file NCMesh2D.cpp.
References find_vertex(), midpointMap, and vertices.
Referenced by refine_element().
|
inlineoverridevirtual |
is edge boundary
[in] | edge_global_id | global edge id |
Implements polyfem::mesh::Mesh.
Definition at line 219 of file NCMesh2D.hpp.
References edges, and valid_to_all_edge().
Referenced by compute_boundary_ids(), and is_boundary_element().
|
overridevirtual |
is cell boundary
[in] | element_global_id | global cell id |
Implements polyfem::mesh::Mesh.
Definition at line 13 of file NCMesh2D.cpp.
References face_edge(), index_prepared, is_boundary_edge(), and n_face_vertices().
|
inlineoverridevirtual |
is vertex boundary
[in] | vertex_global_id | global vertex id |
Implements polyfem::mesh::Mesh.
Definition at line 218 of file NCMesh2D.hpp.
References valid_to_all_vertex(), and vertices.
|
inlineoverridevirtual |
if the mesh is conforming
Implements polyfem::mesh::Mesh.
Definition at line 166 of file NCMesh2D.hpp.
|
inline |
Definition at line 201 of file NCMesh2D.hpp.
References adj_prepared, all_to_valid_edge(), edges, and valid_to_all_edge().
|
inline |
Definition at line 196 of file NCMesh2D.hpp.
References adj_prepared, all_to_valid_edge(), valid_to_all_vertex(), and vertices.
|
overrideprotectedvirtual |
loads a mesh from a geo mesh
[in] | M | geo mesh |
Implements polyfem::mesh::Mesh.
Definition at line 554 of file NCMesh2D.cpp.
References add_element(), polyfem::F, n_elements, polyfem::mesh::orient_normals_2d(), prepare_mesh(), V, and vertices.
|
overrideprotectedvirtual |
loads a mesh from the path
[in] | path | file location |
Implements polyfem::mesh::Mesh.
Definition at line 548 of file NCMesh2D.cpp.
void polyfem::mesh::NCMesh2D::mark_boundary | ( | ) |
Definition at line 332 of file NCMesh2D.cpp.
References edges, and vertices.
Referenced by prepare_mesh().
|
inlineoverridevirtual |
number of edges
Implements polyfem::mesh::Mesh.
Definition at line 169 of file NCMesh2D.hpp.
References edges.
Referenced by build_index_mapping(), compute_boundary_ids(), and set_boundary_ids().
|
inline |
Definition at line 214 of file NCMesh2D.hpp.
References edges, and valid_to_all_edge().
|
inlineoverridevirtual |
number of vertices of a face
[in] | f_id | global face id |
Implements polyfem::mesh::Mesh.
Definition at line 187 of file NCMesh2D.hpp.
Referenced by is_boundary_element().
|
inlineoverridevirtual |
number of faces
Implements polyfem::mesh::Mesh.
Definition at line 168 of file NCMesh2D.hpp.
References n_elements.
Referenced by append(), attach_higher_order_nodes(), compute_body_ids(), compute_elements_tag(), set_body_ids(), and update_elements_tag().
|
inline |
Definition at line 208 of file NCMesh2D.hpp.
References adj_prepared, edges, and valid_to_all_edge().
|
inlineoverridevirtual |
number of vertices
Implements polyfem::mesh::Mesh.
Definition at line 177 of file NCMesh2D.hpp.
References vertices.
Referenced by append(), and build_index_mapping().
|
overridevirtual |
normalize the mesh
Implements polyfem::mesh::Mesh.
Definition at line 683 of file NCMesh2D.cpp.
References bounding_box(), and vertices.
|
inlineoverridevirtual |
point coordinates
[in] | global_index | global vertex index |
Implements polyfem::mesh::Mesh.
Definition at line 245 of file NCMesh2D.hpp.
References index_prepared, valid_to_all_vertex(), and vertices.
Referenced by edge_barycenter(), edge_length(), edge_node(), and face_node().
|
inlineoverridevirtual |
method used to finalize the mesh.
It computes the cached stuff used in navigation
Reimplemented from polyfem::mesh::Mesh.
Definition at line 288 of file NCMesh2D.hpp.
References adj_prepared, build_edge_follower_chain(), build_element_vertex_adjacency(), build_index_mapping(), compute_elements_tag(), and mark_boundary().
Referenced by append(), build_from_matrices(), and load().
|
overridevirtual |
refine the mesh
[in] | n_refinement | number of refinements |
[in] | t | position of the refinement location (0.5 for standard refinement) |
Implements polyfem::mesh::Mesh.
Definition at line 23 of file NCMesh2D.cpp.
References elements, polyfem::utils::is_valid(), refine(), and refine_element().
Referenced by refine().
void polyfem::mesh::NCMesh2D::refine_element | ( | int | id_full | ) |
Definition at line 178 of file NCMesh2D.cpp.
References add_element(), adj_prepared, edge_id, edges, elements, find_edge(), find_vertex(), get_edge(), get_vertex(), index_prepared, n_elements, refineHistory, and vertices.
Referenced by refine(), and refine_elements().
void polyfem::mesh::NCMesh2D::refine_elements | ( | const std::vector< int > & | ids | ) |
Definition at line 244 of file NCMesh2D.cpp.
References refine_element(), and valid_to_all_elem().
|
inlineoverridevirtual |
Implements polyfem::mesh::Mesh.
Definition at line 224 of file NCMesh2D.hpp.
|
overridevirtual |
Set the volume sections.
[in] | body_ids | vector of labels, one per element |
Reimplemented from polyfem::mesh::Mesh.
Definition at line 782 of file NCMesh2D.cpp.
References elements, n_faces(), and valid_to_all_elem().
|
overridevirtual |
Set the boundary selection from a vector.
[in] | boundary_ids | vector one value per element |
Reimplemented from polyfem::mesh::Mesh.
Definition at line 791 of file NCMesh2D.cpp.
References edges, n_edges(), and valid_to_all_edge().
|
overridevirtual |
Set the point.
[in] | global_index | global vertex index |
[in] | p | value |
Implements polyfem::mesh::Mesh.
Definition at line 712 of file NCMesh2D.cpp.
References valid_to_all_vertex(), and vertices.
|
overridevirtual |
Implements polyfem::mesh::Mesh2D.
Definition at line 644 of file NCMesh2D.cpp.
References all_to_valid_edge(), polyfem::mesh::Navigation::Index::edge, edges, elements, polyfem::mesh::Navigation::Index::face, polyfem::mesh::Navigation::Index::face_corner, polyfem::mesh::find(), valid_to_all_elem(), and polyfem::mesh::Navigation::Index::vertex.
Referenced by face_node().
|
overridevirtual |
Implements polyfem::mesh::Mesh2D.
Definition at line 667 of file NCMesh2D.cpp.
References polyfem::mesh::Navigation::Index::edge, edges, polyfem::mesh::Navigation::Index::face, polyfem::mesh::Navigation::Index::face_corner, valid_to_all_edge(), valid_to_all_elem(), and polyfem::mesh::Navigation::Index::vertex.
|
overridevirtual |
Implements polyfem::mesh::Mesh2D.
Definition at line 620 of file NCMesh2D.cpp.
References all_to_valid_vertex(), polyfem::mesh::Navigation::Index::edge, edges, elements, polyfem::mesh::Navigation::Index::face, polyfem::mesh::Navigation::Index::face_corner, valid_to_all_edge(), valid_to_all_elem(), valid_to_all_vertex(), and polyfem::mesh::Navigation::Index::vertex.
Referenced by edge_node(), and face_node().
|
protected |
Definition at line 522 of file NCMesh2D.cpp.
References edges, find_edge(), find_vertex(), and traverse_edge().
Referenced by build_edge_follower_chain(), and traverse_edge().
|
overridevirtual |
Update elements types.
Reimplemented from polyfem::mesh::Mesh.
Definition at line 707 of file NCMesh2D.cpp.
References polyfem::mesh::Mesh::elements_tag_, n_faces(), and polyfem::mesh::SIMPLEX.
|
inlineprotected |
Definition at line 336 of file NCMesh2D.hpp.
References index_prepared, and valid_to_all_edgeMap.
Referenced by compute_boundary_ids(), edge_vertex(), face_neighbor(), get_boundary_id(), is_boundary_edge(), leader_edge_of_edge(), n_face_neighbors(), n_follower_edges(), set_boundary_ids(), switch_face(), and switch_vertex().
|
inlineprotected |
Definition at line 349 of file NCMesh2D.hpp.
References index_prepared, and valid_to_all_elemMap.
Referenced by cell_vertex(), compute_body_ids(), face_edge(), face_ref_level(), face_vertex(), get_body_id(), get_index_from_face(), refine_elements(), set_body_ids(), switch_edge(), switch_face(), and switch_vertex().
|
inlineprotected |
Definition at line 323 of file NCMesh2D.hpp.
References index_prepared, and valid_to_all_vertexMap.
Referenced by is_boundary_vertex(), leader_edge_of_vertex(), point(), set_point(), and switch_vertex().
|
protected |
Definition at line 386 of file NCMesh2D.hpp.
Referenced by add_element(), build_from_matrices(), coarsen_element(), leader_edge_of_edge(), leader_edge_of_vertex(), n_follower_edges(), prepare_mesh(), and refine_element().
|
protected |
Definition at line 397 of file NCMesh2D.hpp.
Referenced by all_to_valid_edge(), and build_index_mapping().
|
protected |
Definition at line 395 of file NCMesh2D.hpp.
Referenced by all_to_valid_elem(), and build_index_mapping().
|
protected |
Definition at line 396 of file NCMesh2D.hpp.
Referenced by all_to_valid_vertex(), and build_index_mapping().
|
protected |
Definition at line 393 of file NCMesh2D.hpp.
Referenced by build_from_matrices(), find_edge(), and get_edge().
|
protected |
Definition at line 390 of file NCMesh2D.hpp.
Referenced by add_element(), build_edge_follower_chain(), build_element_vertex_adjacency(), build_from_matrices(), build_index_mapping(), coarsen_element(), compute_boundary_ids(), edge_vertex(), face_edge(), face_neighbor(), get_boundary_id(), get_edge(), is_boundary_edge(), leader_edge_of_edge(), mark_boundary(), n_edges(), n_face_neighbors(), n_follower_edges(), refine_element(), set_boundary_ids(), switch_edge(), switch_face(), switch_vertex(), and traverse_edge().
|
protected |
Definition at line 402 of file NCMesh2D.hpp.
|
protected |
Definition at line 388 of file NCMesh2D.hpp.
Referenced by add_element(), append(), build_edge_follower_chain(), build_element_vertex_adjacency(), build_from_matrices(), build_index_mapping(), cell_vertex(), coarsen_element(), compute_body_ids(), face_edge(), face_ref_level(), face_vertex(), get_body_id(), get_index_from_face(), refine(), refine_element(), set_body_ids(), switch_edge(), and switch_vertex().
|
protected |
Definition at line 385 of file NCMesh2D.hpp.
Referenced by add_element(), all_to_valid_edge(), all_to_valid_elem(), all_to_valid_vertex(), build_from_matrices(), build_index_mapping(), coarsen_element(), is_boundary_element(), point(), refine_element(), valid_to_all_edge(), valid_to_all_elem(), and valid_to_all_vertex().
|
protected |
Definition at line 392 of file NCMesh2D.hpp.
Referenced by build_from_matrices(), find_vertex(), and get_vertex().
|
protected |
Definition at line 383 of file NCMesh2D.hpp.
Referenced by add_element(), build_from_matrices(), build_index_mapping(), coarsen_element(), load(), n_faces(), and refine_element().
|
protected |
Definition at line 399 of file NCMesh2D.hpp.
Referenced by build_from_matrices(), coarsen_element(), and refine_element().
|
protected |
Definition at line 397 of file NCMesh2D.hpp.
Referenced by build_index_mapping(), and valid_to_all_edge().
|
protected |
Definition at line 395 of file NCMesh2D.hpp.
Referenced by build_index_mapping(), and valid_to_all_elem().
|
protected |
Definition at line 396 of file NCMesh2D.hpp.
Referenced by build_index_mapping(), and valid_to_all_vertex().
|
protected |
Definition at line 389 of file NCMesh2D.hpp.
Referenced by add_element(), append(), bounding_box(), build_element_vertex_adjacency(), build_from_matrices(), build_index_mapping(), cell_vertex(), coarsen_element(), edge_vertex(), face_vertex(), get_vertex(), is_boundary_vertex(), leader_edge_of_vertex(), load(), mark_boundary(), n_vertices(), normalize(), point(), refine_element(), and set_point().