DUNE PDELab (git)
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. | |
LocalFiniteElementVariantCache & | operator= (const LocalFiniteElementVariantCache &other)=default |
Copy assignment. | |
LocalFiniteElementVariantCache & | operator= (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
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
-
Base Type of the base class providing getImplementations() and index().
Member Typedef Documentation
◆ FiniteElementType
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()
|
inline |
Default constructor.
Prefills the cache with all implementations.
References Dune::Hybrid::forEach().
Member Function Documentation
◆ get()
|
inline |
Get the LocalFiniteElement for the given key data.
- Exceptions
-
Dune::RangeError If 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:
- dune/localfunctions/common/localfiniteelementvariantcache.hh