DUNE PDELab (git)

Dune::PDELab::SizeProviderAdapter< Size, ContainerIndex_, OriginOrder > Struct Template Reference

Adapter to create a size provider from an ordering. More...

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

Public Types

using ContainerIndex = ContainerIndex_
 Partial MultiIndex of a ContainerIndex.
 
using SizePrefix = ContainerIndex
 Partial MultiIndex of a ContainerIndex.
 
using SizeType = Size
 Type that refers to the size of containers.
 

Public Member Functions

template<class Ordering >
 SizeProviderAdapter (const std::shared_ptr< const Ordering > &ordering)
 Construct a new Size Provider Adapter object. More...
 
SizeType size (const SizePrefix &prefix) const
 Gives the size for a given prefix. More...
 

Static Public Attributes

static constexpr MultiIndexOrder ContainerIndexOrder = MultiIndexOrder::Outer2Inner
 Inform about ContainerIndex multi-index order semantics.
 

Detailed Description

template<class Size, class ContainerIndex_, MultiIndexOrder OriginOrder>
struct Dune::PDELab::SizeProviderAdapter< Size, ContainerIndex_, OriginOrder >

Adapter to create a size provider from an ordering.

This adapter is meant to be used in allocation and resizing of vectors containers. In particular, this adapter is needed because the ordering library give sizes for multi-indices ordered with Inner2Outer semantis, while resizing algorithms are faster and easier when using Outer2Inner semantics.

  • This class makes type erasure on the ordering type.
  • This class has value semantics.
  • This class always receives container indices with Outer2Inner order
Template Parameters
SizeType_return type of the size method
ContainerIndex_argument type of the size method
OriginOrderenum with MultiIndexOrder semantics of the origin ordering

Constructor & Destructor Documentation

◆ SizeProviderAdapter()

template<class Size , class ContainerIndex_ , MultiIndexOrder OriginOrder>
template<class Ordering >
Dune::PDELab::SizeProviderAdapter< Size, ContainerIndex_, OriginOrder >::SizeProviderAdapter ( const std::shared_ptr< const Ordering > &  ordering)
inline

Construct a new Size Provider Adapter object.

Template Parameters
OrderingThe type of the ordering to adapt
Parameters
orderingA shared pointer to the ordering

Member Function Documentation

◆ size()

template<class Size , class ContainerIndex_ , MultiIndexOrder OriginOrder>
SizeType Dune::PDELab::SizeProviderAdapter< Size, ContainerIndex_, OriginOrder >::size ( const SizePrefix prefix) const
inline

Gives the size for a given prefix.

Parameters
prefixMultiIndex with a partial path to a container
Returns
Traits::SizeType The size required for such a path

References Inner2Outer.


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