dune-pdelab  2.4-dev
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
Dune::PDELab::SubOrdering< BaseOrdering_, TreePath > Class Template Reference

A view on a subtree of a multi-component ordering. More...

#include <dune/pdelab/ordering/subordering.hh>

Inheritance diagram for Dune::PDELab::SubOrdering< BaseOrdering_, TreePath >:
Inheritance graph

Public Types

typedef BaseOrdering_ BaseOrdering
 The type of the BaseOrdering for which to represent a SubOrdering view. More...
 
using TargetOrdering = TypeTree::ChildForTreePath< BaseOrdering, TreePath >
 The target ordering that makes up the root of this SubOrdering view. More...
 
typedef BaseOrdering::Traits Traits
 Forwarded Ordering traits from BaseOrdering. More...
 
typedef BaseOrdering::ContainerAllocationTag ContainerAllocationTag
 Forwarded tag from BaseOrdering, required by PDELab internals. More...
 
typedef BaseOrdering::CacheTag CacheTag
 Forwarded tag from BaseOrdering, required by PDELab internals. More...
 

Public Member Functions

 SubOrdering (std::shared_ptr< const BaseOrdering > base_ordering)
 Constructs a SubOrdering for base_ordering. More...
 
void update ()
 Updates this SubOrdering. More...
 
template<typename ItIn , typename ItOut >
void map_lfs_indices (ItIn begin, const ItIn end, ItOut out) const
 
Traits::ContainerIndex mapIndex (const typename Traits::DOFIndex &di) const
 Maps di from the DOFIndex subtree to the ContainerIndex in the BaseOrdering. More...
 
void mapIndex (typename Traits::DOFIndexView di, typename Traits::ContainerIndex &ci) const
 Maps di from the DOFIndex subtree to the ContainerIndex in the BaseOrdering - inplace version. More...
 
Traits::SizeType size () const
 Returns the size of the BaseOrdering. More...
 
Traits::SizeType blockCount () const
 Returns the block count of the BaseOrdering. More...
 
Traits::SizeType maxLocalSize () const
 Returns the maximum per-entity size of the TargetOrdering. More...
 
bool contains (typename Traits::SizeType codim) const
 Returns whether the TargetOrdering has DOFs attached to entities of codimension codim. More...
 
bool fixedSize (typename Traits::SizeType codim) const
 Returns whether the TargetOrdering is of fixed size for entities of codimension codim. More...
 
const BaseOrderingbaseOrdering () const
 Returns the BaseOrdering. More...
 
const TargetOrderingtargetOrdering () const
 Returns the TargetOrdering. More...
 
bool containsPartition (PartitionType partition) const
 Returns whether this ordering contains entities with PartitionType partition. More...
 
std::bitset< 6 > containedPartitions () const
 Returns the internal representation of the set of contained entities. More...
 

Static Public Attributes

static const bool has_dynamic_ordering_children = TargetOrdering::has_dynamic_ordering_children
 Forwarded ordering property from TargetOrdering, required by PDELab internals. More...
 
static const bool consume_tree_index = TargetOrdering::consume_tree_index
 Forwarded ordering property from TargetOrdering, required by PDELab internals. More...
 

Protected Member Functions

void clearPartitionSet ()
 Empties the set of contained partitions. More...
 
void mergePartitionSet (const PartitionInfoProvider &r)
 Adds all partitions contained in r the set of contained partitions. More...
 
void setPartitionSet (const std::bitset< 6 > &partitions)
 Sets the set of contained partitions to the passed-in value. More...
 
void setPartitionSet (const PartitionInfoProvider &r)
 Copies the set of contained partitions from r. More...
 
template<typename It >
void mergePartitionSets (It begin, It end)
 Adds the partitions from all PartitionInfoProviders in the range [begin,end). More...
 

Detailed Description

template<typename BaseOrdering_, typename TreePath>
class Dune::PDELab::SubOrdering< BaseOrdering_, TreePath >

A view on a subtree of a multi-component ordering.

SubOrdering presents a read-only view on the components of BaseOrdering contained in the subtree pointed at by TreePath. The TreePath has to be an instantiation of Dune::TypeTree::TreePath and is interpreted from left to right, i.e. a TypeTree<3,1> means take the fourth child of BaseOrdering and continue to the second child of that ordering.

Note
SubOrdering is not (yet) as feature-complete as a regular ordering. The most important missing feature is support for per-entity indices.
Warning
SubOrdering does not support nesting! Trying to construct a Subordering with a SubOrdering as BaseOrdering will not work and might either just fail to compile or fail in subtle ways at runtime, so don't try it. SubOrdering is not really an ordering, but more of a view into a subset of a real Ordering. Overall, this restriction should not be problematic, as users will usually construct GridFunctionSubSpaces, which take care of avoiding this recursion.
Template Parameters
BaseOrdering_The type of the underlying base ordering.
TreePathThe path to the subtree for which to provide a view.
Warning
This path will usually differ from the path into the GridFunctionSpace!

Member Typedef Documentation

template<typename BaseOrdering_, typename TreePath>
typedef BaseOrdering_ Dune::PDELab::SubOrdering< BaseOrdering_, TreePath >::BaseOrdering

The type of the BaseOrdering for which to represent a SubOrdering view.

template<typename BaseOrdering_, typename TreePath>
typedef BaseOrdering::CacheTag Dune::PDELab::SubOrdering< BaseOrdering_, TreePath >::CacheTag

Forwarded tag from BaseOrdering, required by PDELab internals.

template<typename BaseOrdering_, typename TreePath>
typedef BaseOrdering::ContainerAllocationTag Dune::PDELab::SubOrdering< BaseOrdering_, TreePath >::ContainerAllocationTag

Forwarded tag from BaseOrdering, required by PDELab internals.

template<typename BaseOrdering_, typename TreePath>
using Dune::PDELab::SubOrdering< BaseOrdering_, TreePath >::TargetOrdering = TypeTree::ChildForTreePath<BaseOrdering,TreePath>

The target ordering that makes up the root of this SubOrdering view.

template<typename BaseOrdering_, typename TreePath>
typedef BaseOrdering::Traits Dune::PDELab::SubOrdering< BaseOrdering_, TreePath >::Traits

Forwarded Ordering traits from BaseOrdering.

Constructor & Destructor Documentation

template<typename BaseOrdering_, typename TreePath>
Dune::PDELab::SubOrdering< BaseOrdering_, TreePath >::SubOrdering ( std::shared_ptr< const BaseOrdering base_ordering)
inlineexplicit

Constructs a SubOrdering for base_ordering.

Constructor for a subordering view of base_ordering rooted in the subtree pointed to by TreePath. The second parameter DOFIndexTreePath represents the subtree in the DOFIndex space, i.e. the path to append to passed-in DOFIndices to obtain valid DOFIndices that can be mapped using base_ordering (usually, this will be the TreePath of a GridFunctionSubSpace). This information has to be passed in separately, as the two paths will generally not be identical due to synthesized nodes in the ordering tree.

Parameters
base_orderingStorage pointer to the BaseOrdering.
Template Parameters
DOFIndexTreePathInstantiation of TypeTree::TreePath, representing the path from the root of the DOFIndex tree to the DOFIndices passed to this ordering.

Member Function Documentation

template<typename BaseOrdering_, typename TreePath>
const BaseOrdering& Dune::PDELab::SubOrdering< BaseOrdering_, TreePath >::baseOrdering ( ) const
inline
template<typename BaseOrdering_, typename TreePath>
Traits::SizeType Dune::PDELab::SubOrdering< BaseOrdering_, TreePath >::blockCount ( ) const
inline

Returns the block count of the BaseOrdering.

void Dune::PDELab::PartitionInfoProvider::clearPartitionSet ( )
inlineprotectedinherited

Empties the set of contained partitions.

Referenced by Dune::PDELab::PartitionInfoProvider::mergePartitionSets().

std::bitset<6> Dune::PDELab::PartitionInfoProvider::containedPartitions ( ) const
inlineinherited

Returns the internal representation of the set of contained entities.

template<typename BaseOrdering_, typename TreePath>
bool Dune::PDELab::SubOrdering< BaseOrdering_, TreePath >::contains ( typename Traits::SizeType  codim) const
inline

Returns whether the TargetOrdering has DOFs attached to entities of codimension codim.

bool Dune::PDELab::PartitionInfoProvider::containsPartition ( PartitionType  partition) const
inlineinherited

Returns whether this ordering contains entities with PartitionType partition.

Referenced by Dune::PDELab::GridFunctionSpaceBase< GridFunctionSpace, PowerCompositeGridFunctionSpaceTraits< GV, B, O, k > >::containsPartition().

template<typename BaseOrdering_, typename TreePath>
bool Dune::PDELab::SubOrdering< BaseOrdering_, TreePath >::fixedSize ( typename Traits::SizeType  codim) const
inline

Returns whether the TargetOrdering is of fixed size for entities of codimension codim.

template<typename BaseOrdering_, typename TreePath>
template<typename ItIn , typename ItOut >
void Dune::PDELab::SubOrdering< BaseOrdering_, TreePath >::map_lfs_indices ( ItIn  begin,
const ItIn  end,
ItOut  out 
) const
inline
template<typename BaseOrdering_, typename TreePath>
Traits::ContainerIndex Dune::PDELab::SubOrdering< BaseOrdering_, TreePath >::mapIndex ( const typename Traits::DOFIndex &  di) const
inline
template<typename BaseOrdering_, typename TreePath>
void Dune::PDELab::SubOrdering< BaseOrdering_, TreePath >::mapIndex ( typename Traits::DOFIndexView  di,
typename Traits::ContainerIndex &  ci 
) const
inline

Maps di from the DOFIndex subtree to the ContainerIndex in the BaseOrdering - inplace version.

template<typename BaseOrdering_, typename TreePath>
Traits::SizeType Dune::PDELab::SubOrdering< BaseOrdering_, TreePath >::maxLocalSize ( ) const
inline
void Dune::PDELab::PartitionInfoProvider::mergePartitionSet ( const PartitionInfoProvider r)
inlineprotectedinherited

Adds all partitions contained in r the set of contained partitions.

Referenced by Dune::PDELab::PartitionInfoProvider::mergePartitionSets().

template<typename It >
void Dune::PDELab::PartitionInfoProvider::mergePartitionSets ( It  begin,
It  end 
)
inlineprotectedinherited

Adds the partitions from all PartitionInfoProviders in the range [begin,end).

Note
The passed-in iterators may yield both references and pointers to the PartitionInfoProviders in the range. This feature exists mostly to simplify implementation of the dynamic ordering base classes, which hold pointers to their children.

References Dune::PDELab::PartitionInfoProvider::clearPartitionSet(), and Dune::PDELab::PartitionInfoProvider::mergePartitionSet().

Referenced by Dune::PDELab::LocalOrderingBase< first_type< Children...>::type::Traits::GridView, first_type< Children...>::type::Traits::DOFIndex, first_type< Children...>::type::Traits::ContainerIndex >::LocalOrderingBase(), and Dune::PDELab::OrderingBase< Ordering::Traits::DOFIndex, Ordering::Traits::ContainerIndex >::OrderingBase().

void Dune::PDELab::PartitionInfoProvider::setPartitionSet ( const std::bitset< 6 > &  partitions)
inlineprotectedinherited
void Dune::PDELab::PartitionInfoProvider::setPartitionSet ( const PartitionInfoProvider r)
inlineprotectedinherited

Copies the set of contained partitions from r.

template<typename BaseOrdering_, typename TreePath>
Traits::SizeType Dune::PDELab::SubOrdering< BaseOrdering_, TreePath >::size ( ) const
inline
template<typename BaseOrdering_, typename TreePath>
const TargetOrdering& Dune::PDELab::SubOrdering< BaseOrdering_, TreePath >::targetOrdering ( ) const
inline
template<typename BaseOrdering_, typename TreePath>
void Dune::PDELab::SubOrdering< BaseOrdering_, TreePath >::update ( )
inline

Member Data Documentation

template<typename BaseOrdering_, typename TreePath>
const bool Dune::PDELab::SubOrdering< BaseOrdering_, TreePath >::consume_tree_index = TargetOrdering::consume_tree_index
static

Forwarded ordering property from TargetOrdering, required by PDELab internals.

template<typename BaseOrdering_, typename TreePath>
const bool Dune::PDELab::SubOrdering< BaseOrdering_, TreePath >::has_dynamic_ordering_children = TargetOrdering::has_dynamic_ordering_children
static

Forwarded ordering property from TargetOrdering, required by PDELab internals.


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