HArD::Core2D
Hybrid Arbitrary Degree::Core 2D - Library to implement 2D schemes with edge and cell polynomials as unknowns
Public Member Functions | List of all members
HArDCore2D::Mesh Class Reference

The Mesh class provides description of a mesh. More...

#include <mesh.hpp>

Public Member Functions

 Mesh ()
 
void set_name (std::string name)
 set the name of the mesh
 
std::string get_name ()
 getter for the edge name
 
size_t n_cells () const
 number of cells in the mesh
 
size_t n_edges () const
 number of edges in the mesh
 
size_t n_vertices () const
 number of vertices in the mesh
 
double h_max () const
 max of diameter of cells
 
size_t dim () const
 dimension of the mesh (2)
 
size_t n_b_cells () const
 number of boundary cells
 
size_t n_b_edges () const
 number of boundary edges
 
size_t n_b_vertices () const
 number of boundary vertices
 
size_t n_i_cells () const
 number of boundary cells
 
size_t n_i_edges () const
 number of boundary edges
 
size_t n_i_vertices () const
 number of boundary vertices
 
std::vector< Cell * > get_cells () const
 lists the cells in the mesh.
 
std::vector< Edge * > get_edges () const
 lists the edges in the mesh.
 
std::vector< Vertex * > get_vertices () const
 lists the vertices in the mesh.
 
Cellcell (size_t iC) const
 get a constant pointer to a cell using its global index
 
Edgeedge (size_t iE) const
 get a constant pointer to an edge using its global index
 
Vertexvertex (size_t iV) const
 get a constant pointer to a vertex using its global index
 
std::vector< Cell * > get_b_cells () const
 lists the boundary cells in the mesh.
 
std::vector< Edge * > get_b_edges () const
 lists the boundary edges in the mesh.
 
std::vector< Vertex * > get_b_vertices () const
 lists the boundary vertices in the mesh.
 
Cellb_cell (size_t iC) const
 get a constant pointer to the iC-th boundary cell
 
Edgeb_edge (size_t iE) const
 get a constant pointer to the iE-th boundary edge
 
Vertexb_vertex (size_t iV) const
 get a constant pointer to the iV-th boundary vertex
 
std::vector< Cell * > get_i_cells () const
 lists the interior cells in the mesh.
 
std::vector< Edge * > get_i_edges () const
 lists the interior edges in the mesh.
 
std::vector< Vertex * > get_i_vertices () const
 lists the interior vertices in the mesh.
 
Celli_cell (size_t iC) const
 get a constant pointer to the iC-th interior cell
 
Edgei_edge (size_t iE) const
 get a constant pointer to the iE-th interior edge
 
Vertexi_vertex (size_t iV) const
 get a constant pointer to the iV-th interior vertex
 
bool add_cell (Cell *cell)
 adds a cell to the mesh
 
bool add_vertex (Vertex *vertex)
 adds a vertex to the mesh
 
Edgeadd_edge (std::vector< size_t > vertex_ids, Cell *cell)
 add an edge to the mesh
 
bool add_b_cell (Cell *cell)
 adds a boundary cell to the mesh
 
bool add_b_edge (Edge *edge)
 adds a boundary edge to the mesh
 
bool add_b_vertex (Vertex *vertex)
 adds a boundary vertex to the mesh
 
bool add_i_cell (Cell *cell)
 adds an interior cell to the mesh
 
bool add_i_edge (Edge *edge)
 adds an interior edge to the mesh
 
bool add_i_vertex (Vertex *vertex)
 adds an interior vertex to the mesh
 
size_t next_edge_idx ()
 gets the next global edge index
 
double regularity ()
 returns a regularity factor More...
 
void renum (const char B, const std::vector< size_t > new_to_old)
 Re-index the cells, edges or vertices. More...
 

Detailed Description

The Mesh class provides description of a mesh.

Constructor & Destructor Documentation

◆ Mesh()

Mesh::Mesh ( )

default constructor for an empty mesh

Member Function Documentation

◆ regularity()

double Mesh::regularity ( )

returns a regularity factor

Regularity factor = maximum of

  • diameter of cell / (measure of cell)^{1/2}
  • diameter of cell / diameter of edge [for each edge of the cell]

◆ renum()

void Mesh::renum ( const char  B,
const std::vector< size_t >  new_to_old 
)

Re-index the cells, edges or vertices.

Parameters
BT for cells, E for edges, V for vertices
new_to_oldVector of new indices to old ones (new_to_old[i]=j: the index formerly j will become i)

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