MeshTopology

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

Bases: dolfin.cpp.common.Variable

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.

Copy constructor.

Parameters:MeshTopology & topology (const) –
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

Return type:std::vector< unsigned int > &
clear()

Clear all data.

Return type:void
coloring

Mesh entity colors, if computed. First vector is (colored entity dim - dim1 - dim2 - … - colored entity dim) The first vector in the pair stores mesh entity colors and the vector<vector> is a list of all mesh entity indices of the same color, e.g. vector<vector>[col][i] is the index of the ith entity of color ‘col’.

Return type:std::map< std::vector< std::size_t >, std::pair< std::vector< std::size_t >, std::vector< std::vector< std::size_t > > > >
dim()

Return topological dimension.

Return type:std::size_t
ghost_offset()

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

Parameters:dim (std::size_t) –
Return type:std::size_t
global_indices()

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

Parameters:d (std::size_t) –
Return type:const std::vector< std::int64_t > &
hash()

Return hash based on the hash of cell-vertex connectivity.

Return type:size_t
have_global_indices()

Check if global indices are available for entities of dimension dim

Parameters:dim (std::size_t) –
Return type:bool
have_shared_entities()

Check whether there are any shared entities calculated of dimension dim

Parameters:int dim (unsigned) –
Return type:bool
init()

Initialize topology of given maximum dimension.

Parameters:dim (std::size_t) –
Return type:void
init_ghost()

Initialise the offset index of ghost entities for this dimension.

Parameters:
  • dim (std::size_t) –
  • index (std::size_t) –
Return type:

void

init_global_indices()

Initialize storage for global entity numbering for entities of dimension dim

Parameters:
  • dim (std::size_t) –
  • size (std::size_t) –
Return type:

void

set_global_index()

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

Parameters:
  • dim (std::size_t) –
  • local_index (std::size_t) –
  • global_index (std::int64_t) –
Return type:

void

shared_entities()

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

Parameters:int dim (unsigned) –
Return type:std::map< std::int32_t, std::set< unsigned int > > &
size()

Return number of entities for given dimension.

Parameters:dim (std::size_t) –
Return type:std::size_t
size_global()

Return global number of entities for given dimension.

Parameters:dim (std::size_t) –
Return type:std::size_t
thisown

The membership flag