# Cell¶

class dolfin.cpp.mesh.Cell(*args)

A Cell is a MeshEntity of topological codimension 0.

Create cell on given mesh with given index

Parameters: Mesh & mesh (const) – The mesh. index (std::size_t) – The index.
cell_normal()

Compute normal to cell itself (viewed as embedded in 3D)

Return type: Point Point Normal of the cell
circumradius()

Compute circumradius of cell

UnitSquareMesh mesh(1, 1);
Cell cell(mesh, 0);

Return type: double double The circumradius of the cell.
collides()

Check whether given point collides with cell

Parameters: Point & point (const) – The point to be checked. bool bool True iff point collides with cell.
contains()

Check whether given point is contained in cell. This function is identical to the function collides(point).

Parameters: Point & point (const) – The point to be checked. bool bool True iff point is contained in cell.
distance()

Compute distance to given point.

Parameters: Point & point (const) – The point. double double The distance to the point.
facet_area()

Compute the area/length of given facet with respect to the cell

Parameters: facet (std::size_t) – Index of the facet. double double Area/length of the facet.
get_cell_data()

Fill UFC cell with miscellaneous data.

Parameters: & ufc_cell (ufc::cell) – local_facet (int) – void
get_cell_topology()

Fill UFC cell with topology data.

Parameters: & ufc_cell (ufc::cell) – void
get_coordinate_dofs()

Get cell coordinate dofs (not vertex coordinates)

Parameters: double > & coordinates (std::vector<) – void
get_vertex_coordinates()

Get cell vertex coordinates (not coordinate dofs)

Parameters: double > & coordinates (std::vector<) – void
h()

Compute greatest distance between any two vertices

UnitSquareMesh mesh(1, 1);
Cell cell(mesh, 0);
info("%g", cell.h());

Return type: double double The greatest distance between any two vertices of the cell.
inradius()

Compute inradius of cell

UnitSquareMesh mesh(1, 1);
Cell cell(mesh, 0);

Return type: double double Radius of the sphere inscribed in the cell.
intersection()

Compute triangulation of intersection with given entity

Parameters: MeshEntity & entity (const) – The entity with which to intersect. std::vector< Point > std::vector A flattened array of simplices of dimension num_simplices x num_vertices x gdim = num_simplices x (tdim + 1) x gdim
normal()

Compute component i of normal of given facet with respect to the cell

Parameters: facet (std::size_t) – Index of facet. i (std::size_t) – Component. double double Component i of the normal of the facet.
num_vertices()

Return number of vertices of cell.

Return type: std::size_t
order()

Order entities locally

Parameters: std::vector< std::int64_t > & local_to_global_vertex_indices (const) – The global vertex indices. void
ordered()

Check if entities are ordered

Parameters: std::vector< std::int64_t > & local_to_global_vertex_indices (const) – The global vertex indices. bool bool True iff ordered.
orientation()

Compute orientation of cell

Return type: std::size_t std::size_t Orientation of the cell (0 is ‘up’/’right’, 1 is ‘down’/’left’)
radius_ratio()

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

UnitSquareMesh mesh(1, 1);
Cell cell(mesh, 0);

Return type: double double topological_dimension * inradius / circumradius
squared_distance()

Compute squared distance to given point.

Parameters: Point & point (const) – The point. double double The squared distance to the point.
thisown

The membership flag

type()

Return type of cell.

Return type: CellType::Type
volume()

Compute (generalized) volume of cell

UnitSquare mesh(1, 1);
Cell cell(mesh, 0);
info("%g", cell.volume());

Return type: double double The volume of the cell.