DOLFIN-X
DOLFIN-X C++ interface
Public Member Functions | List of all members
dolfinx::mesh::Topology Class Reference

Topology 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. More...

#include <Topology.h>

Public Member Functions

 Topology (MPI_Comm comm, mesh::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
 Return topological dimension.
 
void set_index_map (int dim, std::shared_ptr< const common::IndexMap > index_map)
 
std::shared_ptr< const common::IndexMapindex_map (int dim) const
 Get the IndexMap that described the parallel distribution of the mesh entities. More...
 
std::vector< bool > on_boundary (int dim) const
 Marker for entities of dimension dim on the boundary. An entity of co-dimension < 0 is on the boundary if it is connected to a boundary facet. It is not defined for codimension 0. More...
 
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. More...
 
void set_connectivity (std::shared_ptr< graph::AdjacencyList< std::int32_t >> c, int d0, int d1)
 
const Eigen::Array< std::uint32_t, Eigen::Dynamic, 1 > & get_cell_permutation_info () const
 Returns the permutation information.
 
const Eigen::Array< std::uint8_t, Eigen::Dynamic, Eigen::Dynamic > & get_facet_permutations () const
 Get the permutation number to apply to a facet. The permutations are numbered so that: More...
 
const std::vector< bool > & interior_facets () const
 Gets markers for owned facets that are interior, i.e. are connected to two cells, one of which might be on a remote process. More...
 
void set_interior_facets (const std::vector< bool > &interior_facets)
 Set markers for owned facets that are interior. More...
 
size_t hash () const
 Return hash based on the hash of cell-vertex connectivity.
 
mesh::CellType cell_type () const
 Cell type. More...
 
std::int32_t create_entities (int dim)
 Create entities of given topological dimension. More...
 
void create_connectivity (int d0, int d1)
 Create connectivity between given pair of dimensions, d0 -> d1. More...
 
void create_entity_permutations ()
 Compute entity permutations and reflections.
 
void create_connectivity_all ()
 Compute all entities and connectivity.
 
MPI_Comm mpi_comm () const
 Mesh MPI communicator. More...
 

Detailed Description

Topology 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.

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.

Member Function Documentation

◆ cell_type()

mesh::CellType Topology::cell_type ( ) const

Cell type.

Returns
Cell type that the topology is for

◆ connectivity()

std::shared_ptr< const graph::AdjacencyList< std::int32_t > > Topology::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

◆ create_connectivity()

void Topology::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 Topology::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

◆ get_facet_permutations()

const Eigen::Array< std::uint8_t, Eigen::Dynamic, Eigen::Dynamic > & Topology::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

◆ index_map()

std::shared_ptr< const common::IndexMap > Topology::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

◆ interior_facets()

const std::vector< bool > & Topology::interior_facets ( ) const

Gets markers for owned facets that are interior, i.e. are connected to two cells, one of which might be on a remote process.

Returns
Vector with length equal to the number of facets owned by this process. True if the ith facet (local index) is interior to the domain.

◆ mpi_comm()

MPI_Comm Topology::mpi_comm ( ) const

Mesh MPI communicator.

Returns
The communicator on which the mesh is distributed

◆ on_boundary()

std::vector< bool > Topology::on_boundary ( int  dim) const

Marker for entities of dimension dim on the boundary. An entity of co-dimension < 0 is on the boundary if it is connected to a boundary facet. It is not defined for codimension 0.

Parameters
[in]dimToplogical dimension of the entities to check. It must be less than the topological dimension.
Returns
Vector of length equal to number of local entities, with 'true' for entities on the boundary and otherwise 'false'.

◆ set_connectivity()

void Topology::set_connectivity ( std::shared_ptr< graph::AdjacencyList< std::int32_t >>  c,
int  d0,
int  d1 
)
Todo:
Merge with set_index_map Set connectivity for given pair of topological dimensions

◆ set_index_map()

void Topology::set_index_map ( int  dim,
std::shared_ptr< const common::IndexMap index_map 
)
Todo:
Merge with set_connectivity

Set the IndexMap for dimension dim

Warning
This is experimental and likely to change

◆ set_interior_facets()

void Topology::set_interior_facets ( const std::vector< bool > &  interior_facets)

Set markers for owned facets that are interior.

Parameters
[in]interior_facetsThe marker vector

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