Note: this is documentation for an old release. View the latest documentation at docs.fenicsproject.org/dolfinx/v0.9.0/cpp/doxygen/da/d02/classdolfinx_1_1mesh_1_1Topology.html
DOLFINx 0.7.3
DOLFINx C++ interface
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Topology Class Reference

Topology stores the topology of a mesh, consisting of mesh entities and connectivity (incidence relations for the mesh entities). More...

#include <Topology.h>

Public Member Functions

 Topology (MPI_Comm comm, std::vector< CellType > type)
 Create empty mesh topology.
 
 Topology (const Topology &topology)=default
 Copy constructor.
 
 Topology (Topology &&topology)=default
 Move constructor.
 
 ~Topology ()=default
 Destructor.
 
Topologyoperator= (const Topology &topology)=delete
 Assignment.
 
Topologyoperator= (Topology &&topology)=default
 Assignment.
 
int dim () const noexcept
 Return the topological dimension of the mesh.
 
void set_entity_group_offsets (int dim, const std::vector< std::int32_t > &offsets)
 Set the offsets for each group of entities of a particular dimension. See entity_group_offsets.
 
const std::vector< std::int32_t > & entity_group_offsets (int dim) const
 Get the offsets for each group of entities of a particular dimension.
 
void set_index_map (int dim, std::shared_ptr< const common::IndexMap > map)
 Set the IndexMap for dimension dim.
 
std::shared_ptr< const common::IndexMapindex_map (int dim) const
 Get the IndexMap that described the parallel distribution of the mesh entities.
 
std::shared_ptr< const graph::AdjacencyList< std::int32_t > > connectivity (int d0, int d1) const
 Return connectivity from entities of dimension d0 to entities of dimension d1.
 
void set_connectivity (std::shared_ptr< graph::AdjacencyList< std::int32_t > > c, int d0, int d1)
 Set connectivity for given pair of topological dimensions.
 
const std::vector< std::uint32_t > & get_cell_permutation_info () const
 Returns the permutation information.
 
const std::vector< std::uint8_t > & get_facet_permutations () const
 Get the permutation number to apply to a facet.
 
std::vector< CellTypecell_types () const noexcept
 Cell type.
 
std::int32_t create_entities (int dim)
 Create entities of given topological dimension.
 
void create_connectivity (int d0, int d1)
 Create connectivity between given pair of dimensions, d0 -> d1.
 
void create_entity_permutations ()
 Compute entity permutations and reflections.
 
const std::vector< std::int32_t > & interprocess_facets () const
 List of inter-process facets, if facet topology has been computed.
 
MPI_Comm comm () const
 Mesh MPI communicator.
 

Public Attributes

std::vector< std::int64_t > original_cell_index
 Original cell index.
 

Detailed Description

Topology stores the topology of a mesh, consisting of mesh entities and connectivity (incidence relations for the mesh 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.

Todo:
Rework memory management and associated API. Currently, there is no clear caching policy implemented and no way of discarding cached data.

Member Function Documentation

◆ cell_types()

std::vector< mesh::CellType > cell_types ( ) const
noexcept

Cell type.

Returns
Cell types that the topology is for

◆ comm()

MPI_Comm comm ( ) const

Mesh MPI communicator.

Returns
The communicator on which the topology is distributed

◆ connectivity()

std::shared_ptr< const graph::AdjacencyList< std::int32_t > > connectivity ( int  d0,
int  d1 
) const

Return connectivity from entities of dimension d0 to entities of dimension d1.

Parameters
[in]d0
[in]d1
Returns
The adjacency list that for each entity of dimension d0 gives the list of incident entities of dimension d1. Returns nullptr if connectivity has not been computed.

◆ create_connectivity()

void create_connectivity ( int  d0,
int  d1 
)

Create connectivity between given pair of dimensions, d0 -> d1.

Parameters
[in]d0Topological dimension
[in]d1Topological dimension

◆ create_entities()

std::int32_t create_entities ( int  dim)

Create entities of given topological dimension.

Parameters
[in]dimTopological dimension
Returns
Number of newly created entities, returns -1 if entities already existed

◆ entity_group_offsets()

const std::vector< std::int32_t > & entity_group_offsets ( int  dim) const

Get the offsets for each group of entities of a particular dimension.

The topology may consist of more than one cell type or facet type. In that case, the cells of the same types are grouped together in blocks, firstly for regular cells, then repeated for ghost cells. For example, a mesh with two triangles, three quads and no ghosts would have offsets: 0, 2, 5, 5, 5. A mesh with twenty tetrahedra and two ghost tetrahedra has offsets: 0, 20, 22.

Parameters
dimDimension of the entities
Returns
The offsets

◆ get_facet_permutations()

const std::vector< std::uint8_t > & get_facet_permutations ( ) const

Get the permutation number to apply to a facet.

The permutations are numbered so that:

  • n % 2 gives the number of reflections to apply
  • n // 2 gives the number of rotations to apply

Each column of the returned array represents a cell, and each row a facet of that cell.

Returns
The permutation number
Note
An exception is raised if the permutations have not been computed

◆ index_map()

std::shared_ptr< const common::IndexMap > index_map ( int  dim) const

Get the IndexMap that described the parallel distribution of the mesh entities.

Parameters
[in]dimTopological dimension
Returns
Index map for the entities of dimension dim. Returns nullptr if index map has not been set.

◆ set_connectivity()

void set_connectivity ( std::shared_ptr< graph::AdjacencyList< std::int32_t > >  c,
int  d0,
int  d1 
)

Set connectivity for given pair of topological dimensions.

Todo:
Merge with set_index_map

◆ set_entity_group_offsets()

void set_entity_group_offsets ( int  dim,
const std::vector< std::int32_t > &  offsets 
)

Set the offsets for each group of entities of a particular dimension. See entity_group_offsets.

Parameters
dimDimension of the entities
offsetsThe offsets

◆ set_index_map()

void set_index_map ( int  dim,
std::shared_ptr< const common::IndexMap map 
)

Set the IndexMap for dimension dim.

Todo:
Merge with set_connectivity
Warning
This is experimental and likely to change

The documentation for this class was generated from the following files: