9#include <geogram/mesh/mesh.h>
29 void refine(
const int n_refinement,
const double t)
override;
39 inline int face_vertex(
const int f_id,
const int lv_id)
const override {
return mesh_.facets.vertex(f_id, lv_id); }
40 inline int edge_vertex(
const int e_id,
const int lv_id)
const override {
return mesh_.edges.vertex(e_id, lv_id); }
41 inline int cell_vertex(
const int f_id,
const int lv_id)
const override {
return mesh_.facets.vertex(f_id, lv_id); }
56 bool save(
const std::string &path)
const override;
62 std::pair<RowVectorNd, int>
face_node(
const Navigation::Index &index,
const int n_new_nodes,
const int i,
const int j)
const override;
94 std::unique_ptr<Mesh>
copy()
const override;
97 bool load(
const std::string &path)
override;
98 bool load(
const GEO::Mesh &mesh)
override;
102 std::unique_ptr<GEO::Attribute<GEO::index_t>>
c2e_;
virtual RowVectorNd edge_barycenter(const int index) const override
edge barycenter
Navigation::Index switch_edge(Navigation::Index idx) const override
CMesh2D & operator=(const CMesh2D &)=delete
bool load(const std::string &path) override
loads a mesh from the path
void normalize() override
normalize the mesh
void compute_elements_tag() override
compute element types, see ElementType
virtual ~CMesh2D()=default
CMesh2D(CMesh2D &&)=delete
int n_faces() const override
number of faces
int n_face_vertices(const int f_id) const override
number of vertices of a face
int n_vertices() const override
number of vertices
int n_edges() const override
number of edges
Navigation::Index switch_face(Navigation::Index idx) const override
bool is_boundary_element(const int element_global_id) const override
is cell boundary
double edge_length(const int gid) const override
edge length
std::unique_ptr< GEO::Attribute< bool > > boundary_edges_
std::pair< RowVectorNd, int > edge_node(const Navigation::Index &index, const int n_new_nodes, const int i) const override
std::unique_ptr< Mesh > copy() const override
Create a copy of the mesh.
Navigation::Index switch_vertex(Navigation::Index idx) const override
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
void set_point(const int global_index, const RowVectorNd &p) override
Set the point.
CMesh2D(const CMesh2D &)=delete
bool is_boundary_edge(const int edge_global_id) const override
is edge boundary
std::unique_ptr< GEO::Attribute< GEO::index_t > > c2e_
std::unique_ptr< GEO::Attribute< bool > > boundary_vertices_
CMesh2D & operator=(CMesh2D &&)=delete
std::pair< RowVectorNd, int > face_node(const Navigation::Index &index, const int n_new_nodes, const int i, const int j) const override
void append(const Mesh &mesh) override
appends a new mesh to the end of this
int edge_vertex(const int e_id, const int lv_id) const override
id of the edge vertex
Navigation::Index get_index_from_face(int f, int lv=0) const override
virtual void bounding_box(RowVectorNd &min, RowVectorNd &max) const override
computes the bbox of the mesh
bool is_boundary_vertex(const int vertex_global_id) const override
is vertex boundary
int cell_vertex(const int f_id, const int lv_id) const override
id of the vertex of a cell
void attach_higher_order_nodes(const Eigen::MatrixXd &V, const std::vector< std::vector< int > > &nodes) override
attach high order nodes
bool build_from_matrices(const Eigen::MatrixXd &V, const Eigen::MatrixXi &F) override
build a mesh from matrices
void refine(const int n_refinement, const double t) override
refine the mesh
bool save(const std::string &path) const override
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
bool is_conforming() const override
if the mesh is conforming
virtual RowVectorNd point(const int global_index) const override
point coordinates
virtual void update_elements_tag() override
Update elements types.
Abstract mesh class to capture 2d/3d conforming and non-conforming meshes.
Index get_index_from_face(const GEO::Mesh &M, const GEO::Attribute< GEO::index_t > &c2e, int f, int lv)
Index switch_face(const GEO::Mesh &M, const GEO::Attribute< GEO::index_t > &c2e, Index idx)
Index switch_edge(const GEO::Mesh &M, const GEO::Attribute< GEO::index_t > &c2e, Index idx)
Index switch_vertex(const GEO::Mesh &M, Index idx)
Eigen::Matrix< double, 1, Eigen::Dynamic, Eigen::RowMajor, 1, 3 > RowVectorNd