Dune Core Modules (2.8.0)
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. | |
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 performence reasons all LocalFiniteElement implementations are created during construction and stored in an std::vector according to the associated indices. Hence densly packed indices should be prefered to avoid wasting space for emplty 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