8#include <geogram/mesh/mesh.h>
30 void refine(
const int n_refinement,
const double t)
override;
47 void elements_boxes(std::vector<std::array<Eigen::Vector3d, 2>> &boxes)
const override;
55 bool save(
const std::string &path)
const override;
63 double quad_area(
const int gid)
const override;
84 inline std::vector<uint32_t>
edge_neighs(
const int e_gid)
const override {
return mesh_.
edges[e_gid].neighbor_hs; }
104 ids.insert(ids.begin(),
mesh_.
edges[e_id].neighbor_hs.begin(),
mesh_.
edges[e_id].neighbor_hs.end());
116 std::cerr <<
"never user this function" << std::endl;
123 std::unique_ptr<Mesh>
copy()
const override;
126 bool load(
const std::string &path)
override;
127 bool load(
const GEO::Mesh &M)
override;
void get_edge_elements_neighs(const int e_id, std::vector< int > &ids) const override
RowVectorNd cell_barycenter(const int c) const override
cell barycenter
RowVectorNd edge_barycenter(const int e) const override
edge barycenter
Navigation3D::Index get_index_from_element_face(int hi, int v0, int v1, int v2) const override
int n_cell_faces(const int c_id) const override
Navigation3D::Index get_index_from_element(int hi) const override
bool save(const std::string &path) const override
int cell_face(const int c_id, const int lf_id) const override
static void geomesh_2_mesh_storage(const GEO::Mesh &gm, Mesh3DStorage &m)
RowVectorNd point(const int vertex_id) const override
point coordinates
int cell_edge(const int c_id, const int le_id) const override
void normalize() override
normalize the mesh
bool is_conforming() const override
if the mesh is conforming
int edge_vertex(const int e_id, const int lv_id) const override
id of the edge vertex
int n_cell_edges(const int c_id) const override
Navigation3D::Index switch_element(Navigation3D::Index idx) const override
void refine(const int n_refinement, const double t) override
refine the mesh
int n_edges() const override
number of edges
int face_vertex(const int f_id, const int lv_id) const override
id of the face vertex
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
CMesh3D(CMesh3D &&)=default
RowVectorNd face_barycenter(const int f) const override
face barycenter
CMesh3D & operator=(CMesh3D &&)=default
int n_vertices() const override
number of vertices
bool is_boundary_face(const int face_global_id) const override
is face boundary
CMesh3D & operator=(const CMesh3D &)=default
bool is_boundary_edge(const int edge_global_id) const override
is edge boundary
double quad_area(const int gid) const override
area of a quad face of an hex mesh
std::vector< uint32_t > vertex_neighs(const int v_gid) const override
void get_vertex_elements_neighs(const int v_id, std::vector< int > &ids) const override
Navigation3D::Index next_around_face(Navigation3D::Index idx) const override
bool is_boundary_vertex(const int vertex_global_id) const override
is vertex boundary
Mesh3DStorage & mesh_storge()
RowVectorNd kernel(const int cell_id) const override
Navigation3D::Index next_around_edge(Navigation3D::Index idx) const override
void elements_boxes(std::vector< std::array< Eigen::Vector3d, 2 > > &boxes) const override
constructs a box around every element (3d cell, 2d face)
void attach_higher_order_nodes(const Eigen::MatrixXd &V, const std::vector< std::vector< int > > &nodes) override
attach high order nodes
void set_point(const int global_index, const RowVectorNd &p) override
Set the point.
void bounding_box(RowVectorNd &min, RowVectorNd &max) const override
computes the bbox of the mesh
virtual ~CMesh3D()=default
Navigation3D::Index get_index_from_element_edge(int hi, int v0, int v1) const override
void append(const Mesh &mesh) override
appends a new mesh to the end of this
int n_cells() const override
number of cells
int n_faces() const override
number of faces
Navigation3D::Index switch_vertex(Navigation3D::Index idx) const override
bool load(const std::string &path) override
loads a mesh from the path
std::vector< uint32_t > edge_neighs(const int e_gid) const override
Navigation3D::Index get_index_from_element(int hi, int lf, int lv) const override
std::unique_ptr< Mesh > copy() const override
Create a copy of the mesh.
void compute_elements_tag() override
compute element types, see ElementType
Navigation3D::Index switch_edge(Navigation3D::Index idx) const override
int n_cell_vertices(const int c_id) const override
number of vertices of a cell
Navigation3D::Index switch_face(Navigation3D::Index idx) const override
void barycentric_coords(const RowVectorNd &p, const int el_id, Eigen::MatrixXd &coord) const override
constructs barycentric coodiantes for a point p.
bool build_from_matrices(const Eigen::MatrixXd &V, const Eigen::MatrixXi &F) override
build a mesh from matrices
bool is_boundary_element(const int element_global_id) const override
is cell boundary
int n_face_vertices(const int f_id) const override
number of vertices of a face
int cell_vertex(const int c_id, const int lv_id) const override
id of the vertex of a cell
CMesh3D(const CMesh3D &)=default
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
std::vector< Element > elements
std::vector< Edge > edges
std::vector< Face > faces
std::vector< Vertex > vertices
Abstract mesh class to capture 2d/3d conforming and non-conforming meshes.
Index next_around_3Dedge(const Mesh3DStorage &M, Index idx)
Index switch_element(const Mesh3DStorage &M, Index idx)
Index get_index_from_element_tri(const Mesh3DStorage &M, int hi, int v0, int v1, int v2)
Index switch_vertex(const Mesh3DStorage &M, Index idx)
Index get_index_from_element_face(const Mesh3DStorage &M, int hi)
Index get_index_from_element_edge(const Mesh3DStorage &M, int hi, int v0, int v1)
Index switch_edge(const Mesh3DStorage &M, Index idx)
Index next_around_2Dface(const Mesh3DStorage &M, Index idx)
Index switch_face(const Mesh3DStorage &M, Index idx)
Eigen::Matrix< double, 1, Eigen::Dynamic, Eigen::RowMajor, 1, 3 > RowVectorNd