Cell.h¶
Note
The documentation on this page was automatically extracted from the DOLFIN C++ code and may need to be edited or expanded.
-
class
Cell
¶ Parent class(es)
A Cell is a
MeshEntity
of topological codimension 0.-
Cell
()¶ Create empty cell
-
Cell
(const Mesh &mesh, std::size_t index)¶ Create cell on given mesh with given index
- @param mesh
- The mesh.
- @param index
- The index.
-
std::size_t
num_vertices
() const¶ Return number of vertices of cell
-
std::size_t
orientation
() const¶ Compute orientation of cell
- @return std::size_t
- Orientation of the cell (0 is ‘up’/’right’, 1 is ‘down’/’left’)
-
std::size_t
orientation
(const Point &up) const¶ Compute orientation of cell relative to given ‘up’ direction
- @param up
- The direction defined as ‘up’
- @return std::size_t
- Orientation of the cell (0 is ‘same’, 1 is ‘opposite’)
-
double
volume
() const¶ Compute (generalized) volume of cell
- @return double
- The volume of the cell.
@code{.cpp}
UnitSquare mesh(1, 1); Cell cell(mesh, 0); info(“%g”, cell.volume());@endcode
-
double
h
() const¶ Compute greatest distance between any two vertices
- @return double
- The greatest distance between any two vertices of the cell.
@code{.cpp}
UnitSquareMesh mesh(1, 1); Cell cell(mesh, 0); info(“%g”, cell.h());@endcode
-
double
circumradius
() const¶ Compute circumradius of cell
- @return double
- The circumradius of the cell.
@code{.cpp}
UnitSquareMesh mesh(1, 1); Cell cell(mesh, 0); info(“%g”, cell.circumradius());@endcode
-
double
inradius
() const¶ Compute inradius of cell
- @return double
- Radius of the sphere inscribed in the cell.
@code{.cpp}
UnitSquareMesh mesh(1, 1); Cell cell(mesh, 0); info(“%g”, cell.inradius());@endcode
-
double
radius_ratio
() const¶ Compute ratio of inradius to circumradius times dim for cell. Useful as cell quality measure. Returns 1. for equilateral and 0. for degenerate cell. See Jonathan Richard Shewchuk: What Is a Good Linear Finite Element?, online: http://www.cs.berkeley.edu/~jrs/papers/elemj.pdf
- @return double
- topological_dimension * inradius / circumradius
@code{.cpp}
UnitSquareMesh mesh(1, 1); Cell cell(mesh, 0); info(“%g”, cell.radius_ratio());@endcode
-
double
squared_distance
(const Point &point) const¶ Compute squared distance to given point.
- @param point
- The point.
- @return double
- The squared distance to the point.
-
double
distance
(const Point &point) const¶ Compute distance to given point.
- @param point
- The point.
- @return double
- The distance to the point.
-
double
normal
(std::size_t facet, std::size_t i) const¶ Compute component i of normal of given facet with respect to the cell
- @param facet
- Index of facet.
- @param i
- Component.
- @return double
- Component i of the normal of the facet.
-
Point
normal
(std::size_t facet) const¶ Compute normal of given facet with respect to the cell
- @param facet
- Index of facet.
- @return Point
- Normal of the facet.
-
Point
cell_normal
() const¶ Compute normal to cell itself (viewed as embedded in 3D)
- @return Point
- Normal of the cell
-
double
facet_area
(std::size_t facet) const¶ Compute the area/length of given facet with respect to the cell
- @param facet
- Index of the facet.
- @return double
- Area/length of the facet.
-
void
order
(const std::vector<std::int64_t> &local_to_global_vertex_indices)¶ Order entities locally
- @param local_to_global_vertex_indices
- The global vertex indices.
-
bool
ordered
(const std::vector<std::int64_t> &local_to_global_vertex_indices) const¶ Check if entities are ordered
- @param local_to_global_vertex_indices
- The global vertex indices.
- @return bool
- True iff ordered.
-
bool
contains
(const Point &point) const¶ Check whether given point is contained in cell. This function is identical to the function collides(point).
- @param point
- The point to be checked.
- @return bool
- True iff point is contained in cell.
-
bool
collides
(const Point &point) const¶ Check whether given point collides with cell
- @param point
- The point to be checked.
- @return bool
- True iff point collides with cell.
-
bool
collides
(const MeshEntity &entity) const¶ Check whether given entity collides with cell
- @param entity
- The cell to be checked.
- @return bool
- True iff entity collides with cell.
-
std::vector<Point>
intersection
(const MeshEntity &entity) const¶ Compute triangulation of intersection with given entity
- @param entity
- The entity with which to intersect.
- @return std::vector<Point>
- A flattened array of simplices of dimension num_simplices x num_vertices x gdim = num_simplices x (tdim + 1) x gdim
-
void
get_coordinate_dofs
(std::vector<double> &coordinates) const¶ Get cell coordinate dofs (not vertex coordinates)
-
void
get_vertex_coordinates
(std::vector<double> &coordinates) const¶ Get cell vertex coordinates (not coordinate dofs)
-
void
get_cell_data
(ufc::cell &ufc_cell, int local_facet = -1) const¶ Fill UFC cell with miscellaneous data
-
void
get_cell_topology
(ufc::cell &ufc_cell) const¶ Fill UFC cell with topology data
-
-
class
CellFunction
¶ Parent class(es)
MeshFunction
A CellFunction is a MeshFunction of topological codimension 0.
Constructor on Mesh
Constructor on Mesh and value