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
Mesh2D::Polytope< object_dim > Class Template Reference

A Vertex is a Polytope with object_dim = 0. More...

#include <Polytope2D.hpp>

Public Member Functions

 Polytope (size_t index, Simplices< object_dim > simplices)
 < Constructor for a Polytope defined by its simplices More...
 
 Polytope (size_t index, Simplex< object_dim > simplex)
 Constructor for a Polytope defined by a single coordinate (Vertex) More...
 
 Polytope (size_t index, VectorRd vertex)
 Null constructor. More...
 
 Polytope ()
 Destructor. More...
 
 ~Polytope ()
 
size_t global_index () const
 Return the global index of the Polytope. More...
 
double diam () const
 Return the diameter of the Polytope. More...
 
VectorRd center_mass () const
 Return the center mass of the Polytope. More...
 
double measure () const
 Return the Lebesgue measure of the Polytope. More...
 
Simplices< object_dim > get_simplices () const
 Return the simplices making up the Polytope. More...
 
void set_global_index (const size_t idx)
 Set the global index. More...
 
bool is_boundary () const
 Return true if Polytope is a boundary object, false otherwise. More...
 
void set_boundary (bool val)
 Set the boundary value of the Polytope. More...
 
std::vector< Polytope< 0 > * > get_vertices () const
 Return the vertices of the Polytope. More...
 
std::vector< Polytope< 1 > * > get_edges () const
 Return the edges of the Polytope. More...
 
std::vector< Polytope< DIMENSION - 1 > * > get_faces () const
 Return the faces of the Polytope. More...
 
std::vector< Polytope< DIMENSION > * > get_cells () const
 Return the cells of the Polytope. More...
 
size_t n_vertices () const
 Return the number of vertices of the Polytope. More...
 
size_t n_edges () const
 Return the number of edges of the Polytope. More...
 
size_t n_faces () const
 Return the number of faces of the Polytope. More...
 
size_t n_cells () const
 Return the number of cells of the Polytope. More...
 
Polytope< 0 > * vertex (const size_t i) const
 Return the i-th vertex of the Polytope. More...
 
Polytope< 1 > * edge (const size_t i) const
 Return the i-th edge of the Polytope. More...
 
Polytope< DIMENSION - 1 > * face (const size_t i) const
 Return the i-th face of the Polytope. More...
 
Polytope< DIMENSION > * cell (const size_t i) const
 Return the i-th cell of the Polytope. More...
 
void add_vertex (Polytope< 0 > *vertex)
 Add a vertex to the Polytope. More...
 
void add_edge (Polytope< 1 > *edge)
 Add an edge to the Polytope. More...
 
void add_face (Polytope< DIMENSION - 1 > *face)
 Add a face to the Polytope. More...
 
void add_cell (Polytope< DIMENSION > *cell)
 Add a cell to the Polytope. More...
 
int index_vertex (const Polytope< 0 > *vertex) const
 Returns the local index of a vertex. More...
 
int index_edge (const Polytope< 1 > *edge) const
 Returns the local index of an edge. More...
 
int index_face (const Polytope< DIMENSION - 1 > *face) const
 Returns the local index of a face. More...
 
int index_cell (const Polytope< DIMENSION > *cell) const
 Returns the local index of a cell. More...
 
VectorRd coords () const
 Return the coordinates of a Vertex. More...
 
VectorRd face_normal (const size_t face_index) const
 Return the outer normal of a Cell towards the Face located at face_index. More...
 
VectorRd edge_normal (const size_t edge_index) const
 Return the edge normal of a 2D object. More...
 
int face_orientation (const size_t face_index) const
 Return the orientation of a Face. More...
 
int edge_orientation (const size_t edge_index) const
 Return the orientation of a Edge. More...
 
int vertex_orientation (const size_t vertex_index) const
 Return the orientation of a Vertex. More...
 
VectorRd normal () const
 Return the normal of a Face. More...
 
VectorRd tangent () const
 Return the tangent of a Edge. More...
 
void construct_face_normals ()
 Set the directions of the face normals of a cell. More...
 
void plot_simplices (std::ofstream *out) const
 Plot the simplices to out. More...
 
void plot (std::ofstream *out) const
 Plot the polytope to out. More...
 

Detailed Description

template<size_t object_dim>
class Mesh2D::Polytope< object_dim >

A Vertex is a Polytope with object_dim = 0.

Polytope is a templated class describing polytopes in two dimensional space. It takes in one template parameter - object_dim - the dimension of the polytope. object_dim must be less than or equal to two


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