# MeshTopology¶

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

Bases: object

MeshTopology stores the topology of a mesh, consisting of mesh entities and connectivity (incidence relations for the mesh entities). Note that the mesh entities don’t need to be stored, only the number of entities and the connectivity. Any numbering scheme for the mesh entities is stored separately in a MeshFunction over the entities.

A mesh entity e may be identified globally as a pair e = (dim, i), where dim is the topological dimension and i is the index of the entity within that topological dimension.

• MeshTopology()

Create empty mesh topology

• MeshTopology(topology)

Copy constructor

cell_owner()

• cell_owner()

Return mapping from local ghost cell index to owning process Since ghost cells are at the end of the range, this is just a vector over those cells

• cell_owner()

Return mapping from local ghost cell index to owning process (const version) Since ghost cells are at the end of the range, this is just a vector over those cells

clear()

• clear()

Clear all data

• clear(d0, d1)

Clear data for given pair of topological dimensions

coloring
dim()

ghost_offset()

Return number of regular (non-ghost) entities or equivalently, the offset of where ghost entities begin

global_indices()

Get local-to-global index map for entities of topological dimension d

hash()

Return hash based on the hash of cell-vertex connectivity

have_global_indices()

Check if global indices are available for entities of dimension dim

have_shared_entities()

Check whether there are any shared entities calculated of dimension dim

init()

• init(dim)

Initialize topology of given maximum dimension

• init(dim, local_size, global_size)

Set number of local entities (local_size) and global entities (global_size) for given topological dimension dim

init_ghost()

Initialise the offset index of ghost entities for this dimension

init_global_indices()

Initialize storage for global entity numbering for entities of dimension dim

set_global_index()

Set global index for entity of dimension dim and with local index

shared_entities()

• shared_entities(dim)

Return map from shared entities (local index) to processes that share the entity

• shared_entities(dim)

Return map from shared entities (local index) to process that share the entity (const version)

size()

Return number of entities for given dimension

size_global()

Return global number of entities for given dimension

str()

Return informal string representation (pretty-print)

thisown

The membership flag