31#include <boost/multi_array.hpp>
39 template <
typename T>
class MeshFunction;
51 enum class Type :
int { point, interval, triangle, quadrilateral, tetrahedron, hexahedron };
73 {
return _cell_type; }
77 {
return _facet_type; }
86 virtual std::size_t
dim()
const = 0;
108 const unsigned int* v)
const = 0;
127 const Point& point)
const = 0;
131 std::size_t i)
const = 0;
147 const std::vector<std::int64_t>& local_to_global_vertex_indices)
const = 0;
151 const std::vector<std::int64_t>& local_to_global_vertex_indices)
const;
172 unsigned int* vertices,
173 const std::vector<std::int64_t>& local_to_global_vertex_indices);
178 static bool increasing(std::size_t
num_vertices,
const unsigned int* vertices,
179 const std::vector<std::int64_t>& local_to_global_vertex_indices);
182 static bool increasing(std::size_t n0,
const unsigned int* v0,
183 std::size_t n1,
const unsigned int* v1,
185 const std::vector<std::int64_t>& local_to_global_vertex_indices);
virtual bool is_simplex() const =0
Check if cell is a simplex.
static void sort_entities(std::size_t num_vertices, unsigned int *vertices, const std::vector< std::int64_t > &local_to_global_vertex_indices)
Sort vertices based on global entity indices.
Definition CellType.cpp:276
virtual double volume(const MeshEntity &entity) const =0
Compute (generalized) volume of mesh entity.
virtual std::size_t num_entities(std::size_t dim) const =0
Return number of entities of given topological dimension.
virtual double facet_area(const Cell &cell, std::size_t facet) const =0
Compute the area/length of given facet with respect to the cell.
std::size_t num_vertices() const
Return number of vertices for cell.
Definition CellType.h:92
virtual double h(const MeshEntity &entity) const
Compute greatest distance between any two vertices.
Definition CellType.cpp:151
Type entity_type(std::size_t i) const
Return type of cell for entity of dimension i.
Definition CellType.cpp:134
static CellType * create(Type type)
Create cell type from type (factory function)
Definition CellType.cpp:55
virtual double inradius(const Cell &cell) const
Compute inradius of cell.
Definition CellType.cpp:178
virtual Point cell_normal(const Cell &cell) const =0
Compute normal to given cell (viewed as embedded in 3D)
virtual std::size_t num_vertices(std::size_t dim) const =0
Return number of vertices for entity of given topological dimension.
CellType(Type cell_type, Type facet_type)
Constructor.
Definition CellType.cpp:44
Type facet_type() const
Return type of cell for facets.
Definition CellType.h:76
virtual std::string description(bool plural) const =0
Return description of cell type.
virtual double radius_ratio(const Cell &cell) const
Compute dim*inradius/circumradius for given cell.
Definition CellType.cpp:210
virtual void order(Cell &cell, const std::vector< std::int64_t > &local_to_global_vertex_indices) const =0
Order entities locally.
virtual std::size_t dim() const =0
Return topological dimension of cell.
bool ordered(const Cell &cell, const std::vector< std::int64_t > &local_to_global_vertex_indices) const
Check if entities are ordered.
Definition CellType.cpp:221
virtual bool collides(const Cell &cell, const MeshEntity &entity) const =0
Check whether given entity collides with cell.
virtual void create_entities(boost::multi_array< unsigned int, 2 > &e, std::size_t dim, const unsigned int *v) const =0
virtual std::vector< std::int8_t > vtk_mapping() const =0
Mapping of DOLFIN/UFC vertex ordering to VTK/XDMF ordering.
virtual double circumradius(const MeshEntity &entity) const =0
Compute circumradius of mesh entity.
virtual Point normal(const Cell &cell, std::size_t facet) const =0
Compute of given facet with respect to the cell.
Type cell_type() const
Return type of cell.
Definition CellType.h:72
virtual double squared_distance(const Cell &cell, const Point &point) const =0
Compute squared distance to given point.
virtual bool collides(const Cell &cell, const Point &point) const =0
Check whether given point collides with cell.
virtual std::size_t orientation(const Cell &cell) const =0
Return orientation of the cell (assuming flat space)
Type
Enum for different cell types.
Definition CellType.h:51
static Type string2type(std::string type)
Convert from string to cell type.
Definition CellType.cpp:85
virtual ~CellType()
Destructor.
Definition CellType.cpp:50
static std::string type2string(Type type)
Convert from cell type to string.
Definition CellType.cpp:109
virtual double normal(const Cell &cell, std::size_t facet, std::size_t i) const =0
Compute component i of normal of given facet with respect to the cell.
A Cell is a MeshEntity of topological codimension 0.
Definition Cell.h:43
Definition MeshEntity.h:43