DUNE PDELab (git)

Dune::LocalFiniteElementVariantCache< Base > Class Template Reference

A cache storing a compile time selection of local finite element implementations. More...

#include <dune/localfunctions/common/localfiniteelementvariantcache.hh>

Public Types

using FiniteElementType = typename GenerateLFEVariant< Implementations >::type
 Type of exported LocalFiniteElement's. More...
 

Public Member Functions

template<class... Args>
 LocalFiniteElementVariantCache (Args &&... args)
 Default constructor. More...
 
 LocalFiniteElementVariantCache (const LocalFiniteElementVariantCache &other)=default
 Copy constructor.
 
 LocalFiniteElementVariantCache (LocalFiniteElementVariantCache &&other)=default
 Move constructor.
 
LocalFiniteElementVariantCacheoperator= (const LocalFiniteElementVariantCache &other)=default
 Copy assignment.
 
LocalFiniteElementVariantCacheoperator= (LocalFiniteElementVariantCache &&other)=default
 Move assignment.
 
template<class... Key>
const auto & get (const Key &... key) const
 Get the LocalFiniteElement for the given key data. More...
 

Detailed Description

template<class Base>
class Dune::LocalFiniteElementVariantCache< Base >

A cache storing a compile time selection of local finite element implementations.

This class stores a compile time selection of LocalFiniteElement implementations. The exported FiniteElementType is a LocalFiniteElementVariant<Implementations...>.

The base class is required to implement two methods: getImplementations() and index(). The index(key...) method computes an index that uniquely identifies a LocalFiniteElement implementation for the provided key data. The getImplementations() method returns a std::tuple with one entry for each LocalFiniteElement implementation. Each entry is an std::pair consisting of the index of the implementation and a callable object that creates a corresponding LocalFiniteElement implementation.

The constructor forwards all arguments to the base class.

For performance reasons all LocalFiniteElement implementations are created during construction and stored in an std::vector according to the associated indices. Hence densely packed indices should be preferred to avoid wasting space for empty LocalFiniteElementVariant's string no implementation.

Template Parameters
BaseType of the base class providing getImplementations() and index().

Member Typedef Documentation

◆ FiniteElementType

template<class Base >
using Dune::LocalFiniteElementVariantCache< Base >::FiniteElementType = typename GenerateLFEVariant<Implementations>::type

Type of exported LocalFiniteElement's.

This is a LocalFiniteElementVariant<Implementation...> with Implementations... being the list of all provided implementations.

Constructor & Destructor Documentation

◆ LocalFiniteElementVariantCache()

template<class Base >
template<class... Args>
Dune::LocalFiniteElementVariantCache< Base >::LocalFiniteElementVariantCache ( Args &&...  args)
inline

Default constructor.

Prefills the cache with all implementations.

References Dune::Hybrid::forEach().

Member Function Documentation

◆ get()

template<class Base >
template<class... Key>
const auto & Dune::LocalFiniteElementVariantCache< Base >::get ( const Key &...  key) const
inline

Get the LocalFiniteElement for the given key data.

Exceptions
Dune::RangeErrorIf the cache doesn't hold a value matching the requested type.

References DUNE_THROW.


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 (Nov 23, 23:29, 2024)