Dune Core Modules (2.6.0)

Dune::GlobalIndexSet< GridView > Class Template Reference

Calculate globally unique index over all processes in a Dune grid. More...

#include <dune/grid/utility/globalindexset.hh>

Classes

struct  SubPartitionTypeProvider
 Helper class to provide access to subentity PartitionTypes with a run-time codimension. More...
 

Public Types

typedef int Index
 The number type used for global indices

 

Public Member Functions

 GlobalIndexSet (const GridView &gridview, int codim)
 Constructor for a given GridView. More...
 
template<class Entity >
Index index (const Entity &entity) const
 Return the global index of a given entity. More...
 
template<class Entity >
Index subIndex (const Entity &entity, unsigned int i, unsigned int codim) const
 Return the global index of a subentity of a given entity. More...
 
unsigned int size (unsigned int codim) const
 Return the total number of entities over all processes that we have indices for. More...
 

Protected Attributes

unsigned int codim_
 Codimension of the entities that we hold indices for.
 
int nGlobalEntity_
 Global number of entities, i.e. number of entities without rendundant entities on interprocessor boundaries.
 
MapId2Index globalIndex_
 Stores global index of entities with entity's globally unique id as key.
 

Detailed Description

template<class GridView>
class Dune::GlobalIndexSet< GridView >

Calculate globally unique index over all processes in a Dune grid.

Constructor & Destructor Documentation

◆ GlobalIndexSet()

template<class GridView >
Dune::GlobalIndexSet< GridView >::GlobalIndexSet ( const GridView gridview,
int  codim 
)
inline

Constructor for a given GridView.

This constructor calculates the complete set of global unique indices so that we can then later query the global index, by directly passing the entity in question.

Share number of locally owned entities

retrieve globally unique Id set

initialize contribution for the global index

retrieve the entity's id

if the entity is owned by the process, go ahead with computing the global index

compute global index

insert pair (key, datum) into the map

increment contribution to global index

if entity is not owned, insert -1 to signal not yet calculated global index

insert pair (key, datum) into the map

if the entity is owned by the process, go ahead with computing the global index

compute global index

insert pair (key, value) into the map

increment contribution to global index

if entity is not owned, insert -1 to signal not yet calculated global index

References Dune::All_All_Interface, Dune::GlobalIndexSet< GridView >::codim_, Dune::GridView< ViewTraits >::comm(), Dune::GridView< ViewTraits >::communicate(), Dune::ForwardCommunication, Dune::GlobalIndexSet< GridView >::globalIndex_, Dune::GridView< ViewTraits >::grid(), Dune::GridView< ViewTraits >::indexSet(), Dune::InteriorEntity, Dune::GlobalIndexSet< GridView >::nGlobalEntity_, Dune::GridView< ViewTraits >::size(), and Dune::GlobalIndexSet< GridView >::size().

Member Function Documentation

◆ index()

template<class GridView >
template<class Entity >
Index Dune::GlobalIndexSet< GridView >::index ( const Entity entity) const
inline

Return the global index of a given entity.

global unique index is only applicable for inter or border type entities

retrieve globally unique Id set

obtain the entity's id

retrieve the global index in the map with the id as key

References Dune::GlobalIndexSet< GridView >::codim_, Dune::GlobalIndexSet< GridView >::globalIndex_, Dune::GridView< ViewTraits >::grid(), and Dune::GridView< ViewTraits >::indexSet().

◆ size()

template<class GridView >
unsigned int Dune::GlobalIndexSet< GridView >::size ( unsigned int  codim) const
inline

Return the total number of entities over all processes that we have indices for.

Parameters
codimIf this matches GlobalIndexSet codimension, the number of entities is returned. Otherwise, zero is returned.

References Dune::GlobalIndexSet< GridView >::codim_, and Dune::GlobalIndexSet< GridView >::nGlobalEntity_.

Referenced by Dune::GlobalIndexSet< GridView >::GlobalIndexSet().

◆ subIndex()

template<class GridView >
template<class Entity >
Index Dune::GlobalIndexSet< GridView >::subIndex ( const Entity entity,
unsigned int  i,
unsigned int  codim 
) const
inline

Return the global index of a subentity of a given entity.

Parameters
iNumber of the requested subentity among all subentities of the given codimension
codimCodimension of the requested subentity

global unique index is only applicable for inter or border type entities

retrieve globally unique Id set

obtain the entity's id

retrieve the global index in the map with the id as key

References Dune::GlobalIndexSet< GridView >::codim_, Dune::GlobalIndexSet< GridView >::globalIndex_, Dune::GridView< ViewTraits >::grid(), and Dune::GridView< ViewTraits >::indexSet().


The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 26, 23:30, 2024)