HArD::Core2D
Hybrid Arbitrary Degree::Core 2D - Library to implement 2D schemes with edge and cell polynomials as unknowns
|
Classes to construct and describe a 2D mesh. More...
Classes | |
class | Mesh2D::Mesh |
class | Mesh2D::MeshBuilder |
The MeshBuilder class provides build tools to create a full mesh with all connectivities. More... | |
class | Mesh2D::MeshReaderTyp2 |
The MeshReaderTyp2 class provides functions to read a typ2 mesh file. More... | |
class | Mesh2D::Polytope< object_dim > |
A Vertex is a Polytope with object_dim = 0. More... | |
Typedefs | |
typedef std::function< std::array< double, 2 >(const std::array< double, 2 > &)> | Mesh2D::MeshBuilder::TransformationType |
using | Mesh2D::Vertex = Polytope< 0 > |
An Edge is a Polytope with object_dim = 1. | |
using | Mesh2D::Edge = Polytope< 1 > |
A Face is a Polytope with object_dim = DIMENSION - 1. | |
using | Mesh2D::Face = Polytope< DIMENSION - 1 > |
A Cell is a Polytope with object_dim = DIMENSION. | |
using | Mesh2D::Cell = Polytope< DIMENSION > |
Functions | |
Mesh2D::Mesh::Mesh () | |
Mesh2D::Mesh::~Mesh () | |
void | Mesh2D::Mesh::set_name (std::string name) |
set the name of the mesh | |
std::string | Mesh2D::Mesh::get_name () |
getter for the mesh name | |
double | Mesh2D::Mesh::h_max () const |
< max diameter of cells | |
std::size_t | Mesh2D::Mesh::dim () const |
dimension of the mesh | |
std::size_t | Mesh2D::Mesh::n_vertices () const |
number of vertices in the mesh. | |
std::size_t | Mesh2D::Mesh::n_edges () const |
number of edges in the mesh. | |
std::size_t | Mesh2D::Mesh::n_faces () const |
number of faces in the mesh. | |
std::size_t | Mesh2D::Mesh::n_cells () const |
number of cells in the mesh. | |
std::size_t | Mesh2D::Mesh::n_b_vertices () const |
number of boundary vertices in the mesh. | |
std::size_t | Mesh2D::Mesh::n_b_edges () const |
number of boundary edges in the mesh. | |
std::size_t | Mesh2D::Mesh::n_b_faces () const |
number of boundary faces in the mesh. | |
std::size_t | Mesh2D::Mesh::n_b_cells () const |
number of boundary cells in the mesh. | |
std::size_t | Mesh2D::Mesh::n_i_vertices () const |
number of internal vertices in the mesh. | |
std::size_t | Mesh2D::Mesh::n_i_edges () const |
number of internal edges in the mesh. | |
std::size_t | Mesh2D::Mesh::n_i_faces () const |
number of internal faces in the mesh. | |
std::size_t | Mesh2D::Mesh::n_i_cells () const |
number of internal cells in the mesh. | |
std::vector< Vertex * > | Mesh2D::Mesh::get_vertices () const |
lists the vertices in the mesh. | |
std::vector< Edge * > | Mesh2D::Mesh::get_edges () const |
lists the edges in the mesh. | |
std::vector< Face * > | Mesh2D::Mesh::get_faces () const |
lists the faces in the mesh. | |
std::vector< Cell * > | Mesh2D::Mesh::get_cells () const |
lists the cells in the mesh. | |
std::vector< Vertex * > | Mesh2D::Mesh::get_b_vertices () const |
lists the boundary vertices in the mesh. | |
std::vector< Edge * > | Mesh2D::Mesh::get_b_edges () const |
lists the boundary edges in the mesh. | |
std::vector< Face * > | Mesh2D::Mesh::get_b_faces () const |
lists the boundary faces in the mesh. | |
std::vector< Cell * > | Mesh2D::Mesh::get_b_cells () const |
lists the boundary cells in the mesh. | |
std::vector< Vertex * > | Mesh2D::Mesh::get_i_vertices () const |
lists the internal vertices in the mesh. | |
std::vector< Edge * > | Mesh2D::Mesh::get_i_edges () const |
lists the internal edges in the mesh. | |
std::vector< Face * > | Mesh2D::Mesh::get_i_faces () const |
lists the internal faces in the mesh. | |
std::vector< Cell * > | Mesh2D::Mesh::get_i_cells () const |
lists the internal cells in the mesh. | |
void | Mesh2D::Mesh::add_vertex (Vertex *vertex) |
void | Mesh2D::Mesh::add_edge (Edge *edge) |
void | Mesh2D::Mesh::add_face (Face *face) |
void | Mesh2D::Mesh::add_cell (Cell *cell) |
void | Mesh2D::Mesh::add_b_vertex (Vertex *vertex) |
void | Mesh2D::Mesh::add_b_edge (Edge *edge) |
void | Mesh2D::Mesh::add_b_face (Face *face) |
void | Mesh2D::Mesh::add_b_cell (Cell *cell) |
void | Mesh2D::Mesh::add_i_vertex (Vertex *vertex) |
void | Mesh2D::Mesh::add_i_edge (Edge *edge) |
void | Mesh2D::Mesh::add_i_face (Face *face) |
void | Mesh2D::Mesh::add_i_cell (Cell *cell) |
Vertex * | Mesh2D::Mesh::vertex (std::size_t index) const |
get a constant pointer to a vertex using its global index | |
Edge * | Mesh2D::Mesh::edge (std::size_t index) const |
get a constant pointer to a edge using its global index | |
Face * | Mesh2D::Mesh::face (std::size_t index) const |
get a constant pointer to a face using its global index | |
Cell * | Mesh2D::Mesh::cell (std::size_t index) const |
get a constant pointer to a cell using its global index | |
Vertex * | Mesh2D::Mesh::b_vertex (std::size_t index) const |
get a constant pointer to a boundary vertex using an index | |
Edge * | Mesh2D::Mesh::b_edge (std::size_t index) const |
get a constant pointer to boundary a edge using an index | |
Face * | Mesh2D::Mesh::b_face (std::size_t index) const |
get a constant pointer to boundary a face using an index | |
Cell * | Mesh2D::Mesh::b_cell (std::size_t index) const |
get a constant pointer to boundary a cell using an index | |
Vertex * | Mesh2D::Mesh::i_vertex (std::size_t index) const |
get a constant pointer to an internal vertex using an index | |
Edge * | Mesh2D::Mesh::i_edge (std::size_t index) const |
get a constant pointer to an internal edge using an index | |
Face * | Mesh2D::Mesh::i_face (std::size_t index) const |
get a constant pointer to an internal face using an index | |
Cell * | Mesh2D::Mesh::i_cell (std::size_t index) const |
get a constant pointer to an internal cell using an index | |
std::vector< double > | Mesh2D::Mesh::regularity () |
void | Mesh2D::Mesh::renum (const char B, const std::vector< size_t > new_to_old) |
size_t | Mesh2D::Mesh::find_cell (const VectorRd x) const |
< returns the index of the cell containing the point x | |
void | Mesh2D::Mesh::plot_simplices (std::ofstream *out) |
void | Mesh2D::Mesh::plot_mesh (std::ofstream *out) |
Mesh2D::MeshBuilder::MeshBuilder () | |
Mesh2D::MeshBuilder::MeshBuilder (const std::string mesh_file) | |
std::unique_ptr< Mesh > | Mesh2D::MeshBuilder::build_the_mesh (const TransformationType &transformation=[](const std::array< double, 2 > &x) { return x;}) |
Mesh2D::MeshReaderTyp2::MeshReaderTyp2 (std::string file_name) | |
Mesh2D::MeshReaderTyp2::~MeshReaderTyp2 () | |
void | Mesh2D::MeshReaderTyp2::read_mesh (std::vector< std::array< double, 2 > > &vertices, std::vector< std::vector< std::size_t > > &cells) |
Mesh2D::Polytope< object_dim >::Polytope (size_t index, Simplices< object_dim > simplices) | |
< Constructor for a Polytope defined by its simplices | |
Mesh2D::Polytope< object_dim >::Polytope (size_t index, Simplex< object_dim > simplex) | |
Constructor for a Polytope defined by a single coordinate (Vertex) | |
Mesh2D::Polytope< object_dim >::Polytope (size_t index, VectorRd vertex) | |
Null constructor. | |
Mesh2D::Polytope< object_dim >::Polytope () | |
Destructor. | |
Mesh2D::Polytope< object_dim >::~Polytope () | |
size_t | Mesh2D::Polytope< object_dim >::global_index () const |
Return the global index of the Polytope. | |
double | Mesh2D::Polytope< object_dim >::diam () const |
Return the diameter of the Polytope. | |
VectorRd | Mesh2D::Polytope< object_dim >::center_mass () const |
Return the center mass of the Polytope. | |
double | Mesh2D::Polytope< object_dim >::measure () const |
Return the Lebesgue measure of the Polytope. | |
Simplices< object_dim > | Mesh2D::Polytope< object_dim >::get_simplices () const |
Return the simplices making up the Polytope. | |
void | Mesh2D::Polytope< object_dim >::set_global_index (const size_t idx) |
Set the global index. | |
bool | Mesh2D::Polytope< object_dim >::is_boundary () const |
Return true if Polytope is a boundary object, false otherwise. | |
void | Mesh2D::Polytope< object_dim >::set_boundary (bool val) |
Set the boundary value of the Polytope. | |
std::vector< Polytope< 0 > * > | Mesh2D::Polytope< object_dim >::get_vertices () const |
Return the vertices of the Polytope. | |
std::vector< Polytope< 1 > * > | Mesh2D::Polytope< object_dim >::get_edges () const |
Return the edges of the Polytope. | |
std::vector< Polytope< DIMENSION - 1 > * > | Mesh2D::Polytope< object_dim >::get_faces () const |
Return the faces of the Polytope. | |
std::vector< Polytope< DIMENSION > * > | Mesh2D::Polytope< object_dim >::get_cells () const |
Return the cells of the Polytope. | |
size_t | Mesh2D::Polytope< object_dim >::n_vertices () const |
Return the number of vertices of the Polytope. | |
size_t | Mesh2D::Polytope< object_dim >::n_edges () const |
Return the number of edges of the Polytope. | |
size_t | Mesh2D::Polytope< object_dim >::n_faces () const |
Return the number of faces of the Polytope. | |
size_t | Mesh2D::Polytope< object_dim >::n_cells () const |
Return the number of cells of the Polytope. | |
Polytope< 0 > * | Mesh2D::Polytope< object_dim >::vertex (const size_t i) const |
Return the i-th vertex of the Polytope. | |
Polytope< 1 > * | Mesh2D::Polytope< object_dim >::edge (const size_t i) const |
Return the i-th edge of the Polytope. | |
Polytope< DIMENSION - 1 > * | Mesh2D::Polytope< object_dim >::face (const size_t i) const |
Return the i-th face of the Polytope. | |
Polytope< DIMENSION > * | Mesh2D::Polytope< object_dim >::cell (const size_t i) const |
Return the i-th cell of the Polytope. | |
void | Mesh2D::Polytope< object_dim >::add_vertex (Polytope< 0 > *vertex) |
Add a vertex to the Polytope. | |
void | Mesh2D::Polytope< object_dim >::add_edge (Polytope< 1 > *edge) |
Add an edge to the Polytope. | |
void | Mesh2D::Polytope< object_dim >::add_face (Polytope< DIMENSION - 1 > *face) |
Add a face to the Polytope. | |
void | Mesh2D::Polytope< object_dim >::add_cell (Polytope< DIMENSION > *cell) |
Add a cell to the Polytope. | |
int | Mesh2D::Polytope< object_dim >::index_vertex (const Polytope< 0 > *vertex) const |
Returns the local index of a vertex. | |
int | Mesh2D::Polytope< object_dim >::index_edge (const Polytope< 1 > *edge) const |
Returns the local index of an edge. | |
int | Mesh2D::Polytope< object_dim >::index_face (const Polytope< DIMENSION - 1 > *face) const |
Returns the local index of a face. | |
int | Mesh2D::Polytope< object_dim >::index_cell (const Polytope< DIMENSION > *cell) const |
Returns the local index of a cell. | |
VectorRd | Mesh2D::Polytope< object_dim >::coords () const |
Return the coordinates of a Vertex. | |
VectorRd | Mesh2D::Polytope< object_dim >::face_normal (const size_t face_index) const |
Return the outer normal of a Cell towards the Face located at face_index. | |
VectorRd | Mesh2D::Polytope< object_dim >::edge_normal (const size_t edge_index) const |
Return the edge normal of a 2D object. | |
int | Mesh2D::Polytope< object_dim >::face_orientation (const size_t face_index) const |
Return the orientation of a Face. | |
int | Mesh2D::Polytope< object_dim >::edge_orientation (const size_t edge_index) const |
Return the orientation of a Edge. | |
int | Mesh2D::Polytope< object_dim >::vertex_orientation (const size_t vertex_index) const |
Return the orientation of a Vertex. | |
VectorRd | Mesh2D::Polytope< object_dim >::normal () const |
Return the normal of a Face. | |
VectorRd | Mesh2D::Polytope< object_dim >::tangent () const |
Return the tangent of a Edge. | |
void | Mesh2D::Polytope< object_dim >::construct_face_normals () |
Set the directions of the face normals of a cell. | |
void | Mesh2D::Polytope< object_dim >::plot_simplices (std::ofstream *out) const |
Plot the simplices to out. | |
void | Mesh2D::Polytope< object_dim >::plot (std::ofstream *out) const |
Plot the polytope to out. | |
template<size_t object_dim> | |
VectorRd | Mesh2D::simplex_center_mass (Simplex< object_dim > simplex) |
Method to find the Lebesgue measure of an arbitrary simplex in arbitrary space. | |
template<size_t object_dim> | |
double | Mesh2D::simplex_measure (Simplex< object_dim > simplex) |
Classes to construct and describe a 2D mesh.
Class providing a template for all objects (Vertex, Edge, Face, Cell) that appear in a Mesh.
using Mesh2D::Cell = typedef Polytope<DIMENSION> |
using Mesh2D::Edge = typedef Polytope<1> |
A Face is a Polytope with object_dim = DIMENSION - 1.
using Mesh2D::Face = typedef Polytope<DIMENSION - 1> |
A Cell is a Polytope with object_dim = DIMENSION.
typedef std::function<std::array<double, 2>(const std::array<double, 2> &)> Mesh2D::MeshBuilder::TransformationType |
using Mesh2D::Vertex = typedef Polytope<0> |
An Edge is a Polytope with object_dim = 1.
|
inline |
cell | adds a boundary cell to the mesh |
|
inline |
edge | adds a boundary edge to the mesh |
|
inline |
face | adds a boundary face to the mesh |
|
inline |
vertex | adds a boundary vertex to the mesh |
|
inline |
cell | adds a cell to the mesh |
void Mesh2D::Polytope< object_dim >::add_cell | ( | Polytope< DIMENSION > * | cell | ) |
Add a cell to the Polytope.
|
inline |
edge | adds a edge to the mesh |
void Mesh2D::Polytope< object_dim >::add_edge | ( | Polytope< 1 > * | edge | ) |
Add an edge to the Polytope.
|
inline |
face | adds a face to the mesh |
void Mesh2D::Polytope< object_dim >::add_face | ( | Polytope< DIMENSION - 1 > * | face | ) |
Add a face to the Polytope.
|
inline |
cell | adds an internal cell to the mesh |
|
inline |
edge | adds an internal edge to the mesh |
|
inline |
face | adds an internal face to the mesh |
|
inline |
vertex | adds an internal vertex to the mesh |
void Mesh2D::Polytope< object_dim >::add_vertex | ( | Polytope< 0 > * | vertex | ) |
Add a vertex to the Polytope.
|
inline |
vertex | adds a vertex to the mesh |
|
inline |
get a constant pointer to boundary a cell using an index
|
inline |
get a constant pointer to boundary a edge using an index
|
inline |
get a constant pointer to boundary a face using an index
|
inline |
get a constant pointer to a boundary vertex using an index
|
inline |
Build mesh
Polytope< DIMENSION > * Mesh2D::Polytope< object_dim >::cell | ( | const size_t | i | ) | const |
Return the i-th cell of the Polytope.
|
inline |
get a constant pointer to a cell using its global index
|
inline |
Return the center mass of the Polytope.
void Mesh2D::Polytope< object_dim >::construct_face_normals | ( | ) |
Set the directions of the face normals of a cell.
VectorRd Mesh2D::Polytope< object_dim >::coords | ( | ) | const |
Return the coordinates of a Vertex.
|
inline |
Return the diameter of the Polytope.
|
inline |
dimension of the mesh
Polytope< 1 > * Mesh2D::Polytope< object_dim >::edge | ( | const size_t | i | ) | const |
Return the i-th edge of the Polytope.
|
inline |
get a constant pointer to a edge using its global index
VectorRd Mesh2D::Polytope< object_dim >::edge_normal | ( | const size_t | edge_index | ) | const |
Return the edge normal of a 2D object.
int Mesh2D::Polytope< object_dim >::edge_orientation | ( | const size_t | edge_index | ) | const |
Return the orientation of a Edge.
Polytope< DIMENSION - 1 > * Mesh2D::Polytope< object_dim >::face | ( | const size_t | i | ) | const |
Return the i-th face of the Polytope.
|
inline |
get a constant pointer to a face using its global index
VectorRd Mesh2D::Polytope< object_dim >::face_normal | ( | const size_t | face_index | ) | const |
Return the outer normal of a Cell towards the Face located at face_index.
int Mesh2D::Polytope< object_dim >::face_orientation | ( | const size_t | face_index | ) | const |
Return the orientation of a Face.
|
inline |
< returns the index of the cell containing the point x
|
inline |
lists the boundary cells in the mesh.
|
inline |
lists the boundary edges in the mesh.
|
inline |
lists the boundary faces in the mesh.
|
inline |
lists the boundary vertices in the mesh.
|
inline |
lists the cells in the mesh.
|
inline |
Return the cells of the Polytope.
|
inline |
lists the edges in the mesh.
|
inline |
Return the edges of the Polytope.
|
inline |
lists the faces in the mesh.
|
inline |
Return the faces of the Polytope.
|
inline |
lists the internal cells in the mesh.
|
inline |
lists the internal edges in the mesh.
|
inline |
lists the internal faces in the mesh.
|
inline |
lists the internal vertices in the mesh.
|
inline |
getter for the mesh name
|
inline |
Return the simplices making up the Polytope.
|
inline |
lists the vertices in the mesh.
|
inline |
Return the vertices of the Polytope.
|
inline |
Return the global index of the Polytope.
|
inline |
< max diameter of cells
|
inline |
get a constant pointer to an internal cell using an index
|
inline |
get a constant pointer to an internal edge using an index
|
inline |
get a constant pointer to an internal face using an index
|
inline |
get a constant pointer to an internal vertex using an index
int Mesh2D::Polytope< object_dim >::index_cell | ( | const Polytope< DIMENSION > * | cell | ) | const |
Returns the local index of a cell.
int Mesh2D::Polytope< object_dim >::index_edge | ( | const Polytope< 1 > * | edge | ) | const |
Returns the local index of an edge.
int Mesh2D::Polytope< object_dim >::index_face | ( | const Polytope< DIMENSION - 1 > * | face | ) | const |
Returns the local index of a face.
int Mesh2D::Polytope< object_dim >::index_vertex | ( | const Polytope< 0 > * | vertex | ) | const |
Returns the local index of a vertex.
|
inline |
Return true if Polytope is a boundary object, false otherwise.
|
inline |
Return the Lebesgue measure of the Polytope.
|
inline |
|
inline |
Constructor for MeshBuilder.
|
inline |
Overloaded constructor for MeshBuilder so read_mesh can be called from build_the_mesh().
|
inline |
Constructor for mesh reader
file_name | name of the file name, needs to include the full path |
|
inline |
number of boundary cells in the mesh.
|
inline |
number of boundary edges in the mesh.
|
inline |
number of boundary faces in the mesh.
|
inline |
number of boundary vertices in the mesh.
|
inline |
number of cells in the mesh.
|
inline |
Return the number of cells of the Polytope.
|
inline |
number of edges in the mesh.
|
inline |
Return the number of edges of the Polytope.
|
inline |
number of faces in the mesh.
|
inline |
Return the number of faces of the Polytope.
|
inline |
number of internal cells in the mesh.
|
inline |
number of internal edges in the mesh.
|
inline |
number of internal faces in the mesh.
|
inline |
number of internal vertices in the mesh.
|
inline |
number of vertices in the mesh.
|
inline |
Return the number of vertices of the Polytope.
VectorRd Mesh2D::Polytope< object_dim >::normal | ( | ) | const |
Return the normal of a Face.
void Mesh2D::Polytope< object_dim >::plot | ( | std::ofstream * | out | ) | const |
Plot the polytope to out.
|
inline |
|
inline |
void Mesh2D::Polytope< object_dim >::plot_simplices | ( | std::ofstream * | out | ) | const |
Plot the simplices to out.
Mesh2D::Polytope< object_dim >::Polytope | ( | ) |
Destructor.
Mesh2D::Polytope< object_dim >::Polytope | ( | size_t | index, |
Simplex< object_dim > | simplex | ||
) |
Constructor for a Polytope defined by a single coordinate (Vertex)
Mesh2D::Polytope< object_dim >::Polytope | ( | size_t | index, |
Simplices< object_dim > | simplices | ||
) |
< Constructor for a Polytope defined by its simplices
Constructor for a Simplex
Mesh2D::Polytope< object_dim >::Polytope | ( | size_t | index, |
VectorRd | vertex | ||
) |
Null constructor.
|
inline |
Reads the file into the specified containers
vertices | reference to a vector to hold the vertices coordinates |
cells | reference to a vector to hold the cell vertices |
|
inline |
Regularity factor = 1st component: maximum of
2nd component: evaluation of max of ratio "diam of cell / radius ball inscribed in cell"
|
inline |
|
inline |
Set the boundary value of the Polytope.
|
inline |
Set the global index.
|
inline |
set the name of the mesh
Method to find the Lebesgue measure of an arbitrary simplex in arbitrary space.
double Mesh2D::simplex_measure | ( | Simplex< object_dim > | simplex | ) |
VectorRd Mesh2D::Polytope< object_dim >::tangent | ( | ) | const |
Return the tangent of a Edge.
Polytope< 0 > * Mesh2D::Polytope< object_dim >::vertex | ( | const size_t | i | ) | const |
Return the i-th vertex of the Polytope.
|
inline |
get a constant pointer to a vertex using its global index
int Mesh2D::Polytope< object_dim >::vertex_orientation | ( | const size_t | vertex_index | ) | const |
Return the orientation of a Vertex.
|
inline |
|
inline |
Mesh2D::Polytope< object_dim >::~Polytope | ( | ) |