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::Cell Class Reference

The Cell class provides description of a cell. More...

#include <cell.hpp>

Public Member Functions

 Cell (size_t iC, std::vector< size_t > vertex_ids, Mesh *mesh)
 
size_t global_index () const
 cell index
 
size_t n_edges () const
 returns number of edges of the cell
 
size_t n_vertices () const
 returns number of vertices of the cell
 
std::vector< Edge * > get_edges () const
 returns the list of edges of the cell
 
std::vector< Vertex * > get_vertices () const
 returns the list of vertices of the cell
 
std::vector< Cell * > get_neighbours () const
 returns the list of neighbours of the cell
 
Edgeedge (size_t iL) const
 returns the iL-th edge of the cell
 
Vertexvertex (size_t iL) const
 returns the iL-th edge of the cell
 
Cellneighbour (size_t iL) const
 returns the iL-th neighbour of the cell
 
bool is_boundary () const
 returns true if cell touches the boundary
 
double measure () const
 returns area of cell
 
double diam () const
 returns diameter of cell
 
Vector2d edge_normal (size_t i)
 returns the outer normal to the i-th edge
 
Vector2d center_mass () const
 returns the center of mass of the cell
 
bool calc_cell_geometry_factors ()
 calculate cell diam, area etc
 
bool add_neighbour (Cell *neigh)
 add a cell to the neighbour
 
bool is_neighbour (const Cell *rhs) const
 true if shares edge
 
Vector2d ari_coords () const
 return average of edge midpoints
 
size_t shared_edge (size_t i)
 
void set_boundary (bool val)
 calling this function. Returns -1 if there is no cell More...
 
void set_global_index (size_t idx)
 Set the global index of the cell to idx. Used to re-index the cells, should essentially only be used inside Mesh::renum.
 

Detailed Description

The Cell class provides description of a cell.

Constructor & Destructor Documentation

◆ Cell()

Cell::Cell ( size_t  iC,
std::vector< size_t >  vertex_ids,
Mesh mesh 
)

Constructor from global indexes and a mesh

Parameters
iGis the global index of the Cell (basically its just the location in the mesh cells vector
vertex_idsvector containing the global indices of the cell vertices
meshpointer to the mesh that the cell is contained in

Member Function Documentation

◆ set_boundary()

void Cell::set_boundary ( bool  val)

calling this function. Returns -1 if there is no cell

that shares the edge defined by the local coordinates with this cell if there is no edge it will return a null pointer, it would be best to check if the cell is a boundary beforeSet the _boundary value of the cell to val

◆ shared_edge()

size_t Cell::shared_edge ( size_t  i)

Returns the global index to the cell


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