AMDiS  0.1
The Adaptive Multi-Dimensional Simulation Toolbox
GlobalBasisIdSet< GB, class > Class Template Reference

Provide global ids for all DOFs in a global basis. More...

#include <GlobalIdSet.hpp>

Public Types

using GlobalBasis = GB
 
using Tree = typename GB::LocalView::Tree
 
using size_type = std::size_t
 
using GridView = typename GlobalBasis::GridView
 
using Grid = typename GridView::Grid
 
using Element = typename GridView::template Codim< 0 >::Entity
 
using EntityIdType = typename Grid::GlobalIdSet::IdType
 
using PartitionType = Dune::PartitionType
 
using IdType = GlobalIdType_t< GB >
 
using PreBasis = typename GlobalBasis::PreBasis
 
using TreePath = typename GlobalBasis::PrefixPath
 
using NodeIdSet = AMDiS::NodeIdSet< PreBasis, TreePath >
 
using Twist = AMDiS::Twist< typename Grid::GlobalIdSet, GridView::dimension >
 

Public Member Functions

 GlobalBasisIdSet (GlobalBasis const &globalBasis)
 
void bind (Element const &element)
 Bind the IdSet to a grid element. More...
 
void unbind ()
 unbind from the element
 
size_type size () const
 The number of DOFs on the current element in the basis tree.
 
IdType id (size_type i) const
 Return the global unique ID of the ith DOF on the currently bound element in the basis tree.
 
EntityIdType entityId (size_type i) const
 Return the global unique ID of the entity associated to the ith DOF on the currently bound element in the basis tree.
 
PartitionType partitionType (size_type i) const
 Return the partition type of the ith DOF on the currently bound element in the basis tree.
 

Protected Types

using Data = std::pair< IdType, PartitionType >
 

Protected Attributes

Tree tree_
 
NodeIdSet nodeIdSet_
 
Twist twist_
 
std::vector< Data > data_
 

Detailed Description

template<class GB, class = std::void_t<>>
class AMDiS::GlobalBasisIdSet< GB, class >

Provide global ids for all DOFs in a global basis.

A GlobalBasisIdSet provides and interface to retrieve unique IDs (over all partitions) for all DOFs in the basis. It is implemented in terms of the NodeIdSet for each basis node that locally on each element calculates a global unique id.

Examples:

GlobalBasisIdSet<Basis> idSet(basis);
for (const auto& e : elements(basis.gridView())) {
idSet.bind(e);
for (std::size_t i = 0; i < idSet.size(); ++i) {
auto id = idSet.id(i); // global unique ID of i'th local DOF
auto pt = idSet.partitionType(i); // partition type of i'th local DOF
}
idSet.unbind();
}

Member Function Documentation

◆ bind()

void bind ( Element const &  element)
inline

Bind the IdSet to a grid element.

Binding the IdSet to an element collects the ids from all DOFs on that element and stores it in a local vector. Thus, the global DOF ids can be extracted using id() afterwards cheaply.


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