3#ifndef DUNE_GENERIC_LOCALFINITEELEMENT_HH
4#define DUNE_GENERIC_LOCALFINITEELEMENT_HH
6#include <dune/geometry/type.hh>
7#include <dune/geometry/typeindex.hh>
21 template<
class BasisF,
class CoeffF,
class InterpolF>
26 typename CoeffF::Object,
29 typedef typename BasisF::Key
Key;
30 static const unsigned int dimDomain = BasisF::dimension;
36 static_assert(std::is_same<Key, typename CoeffF::Key>::value,
37 "incompatible keys between BasisCreator and CoefficientsCreator");
38 static_assert(std::is_same<Key, typename InterpolF::Key>::value,
39 "incompatible keys between BasisCreator and InterpolationCreator" );
47 Impl::toGeometryTypeIdConstant<dimDomain>(
type(), [&](
auto geometryTypeId) {
48 finiteElement_.template create<decltype(geometryTypeId)::value>(key_);
54 : geometry_( other.
type() ),
58 Impl::toGeometryTypeIdConstant<dimDomain>(
type(), [&](
auto geometryTypeId) {
59 finiteElement_.template create<decltype(geometryTypeId)::value>(key_);
65 finiteElement_.release();
72 return *(finiteElement_.basis_);
79 return *(finiteElement_.coeff_);
86 return *(finiteElement_.interpol_);
92 return finiteElement_.basis_->size();
104 FiniteElement() : basis_(0), coeff_(0), interpol_(0) {}
106 template < GeometryType::Id geometryId >
107 void create(
const Key &key )
110 basis_ = BasisF::template create<geometryId>(key);
111 coeff_ = CoeffF::template create<geometryId>(key);
112 interpol_ = InterpolF::template create<geometryId>(key);
117 BasisF::release(basis_);
119 CoeffF::release(coeff_);
121 InterpolF::release(interpol_);
130 GeometryType geometry_;
132 FiniteElement finiteElement_;
144 DGLocalCoefficientsFactory< typename FE::BasisFactory >,
145 typename FE::InterpolationFactory>
149 typename FE::InterpolationFactory>
Base;
169 DGLocalCoefficientsFactory< typename FE::BasisFactory >,
170 LocalL2InterpolationFactory< typename FE::BasisFactory, false > >
Definition: bdfmcube.hh:16
traits helper struct
Definition: localfiniteelementtraits.hh:11
LB LocalBasisType
Definition: localfiniteelementtraits.hh:14
LC LocalCoefficientsType
Definition: localfiniteelementtraits.hh:18
LI LocalInterpolationType
Definition: localfiniteelementtraits.hh:22
A factory class for the dg local coefficients.
Definition: dglocalcoefficients.hh:57
A factory class for the local l2 interpolations taking a basis factory.
Definition: l2interpolation.hh:197
A LocalFiniteElement implementation based on three TopologyFactories providing the LocalBasis,...
Definition: localfunctions/utility/localfiniteelement.hh:23
GeometryType type() const
Definition: localfunctions/utility/localfiniteelement.hh:97
GenericLocalFiniteElement(const GenericLocalFiniteElement &other)
Definition: localfunctions/utility/localfiniteelement.hh:53
const Traits::LocalInterpolationType & localInterpolation() const
Definition: localfunctions/utility/localfiniteelement.hh:84
unsigned int size() const
Number of shape functions in this finite element.
Definition: localfunctions/utility/localfiniteelement.hh:90
CoeffF CoefficientFactory
Definition: localfunctions/utility/localfiniteelement.hh:33
BasisF BasisFactory
Definition: localfunctions/utility/localfiniteelement.hh:32
BasisF::Key Key
Definition: localfunctions/utility/localfiniteelement.hh:29
GenericLocalFiniteElement(const GeometryType >, const Key &key)
Definition: localfunctions/utility/localfiniteelement.hh:42
const Traits::LocalCoefficientsType & localCoefficients() const
Definition: localfunctions/utility/localfiniteelement.hh:77
InterpolF InterpolationFactory
Definition: localfunctions/utility/localfiniteelement.hh:34
static const unsigned int dimDomain
Definition: localfunctions/utility/localfiniteelement.hh:30
LocalFiniteElementTraits< typename BasisF::Object, typename CoeffF::Object, typename InterpolF::Object > Traits
Definition: localfunctions/utility/localfiniteelement.hh:27
GenericLocalFiniteElement< BasisF, CoeffF, InterpolF > This
Definition: localfunctions/utility/localfiniteelement.hh:24
const Traits::LocalBasisType & localBasis() const
Definition: localfunctions/utility/localfiniteelement.hh:70
~GenericLocalFiniteElement()
Definition: localfunctions/utility/localfiniteelement.hh:63
Takes the basis and interpolation factory from a given LocalFiniteElement (derived from GenericLocalF...
Definition: localfunctions/utility/localfiniteelement.hh:146
Base::Traits Traits
Definition: localfunctions/utility/localfiniteelement.hh:151
DGLocalFiniteElement(const GeometryType >, const typename Base::Key &key)
Definition: localfunctions/utility/localfiniteelement.hh:155
GenericLocalFiniteElement< typename FE::BasisFactory, DGLocalCoefficientsFactory< typename FE::BasisFactory >, typename FE::InterpolationFactory > Base
Definition: localfunctions/utility/localfiniteelement.hh:149
Takes the basis factory from a given LocalFiniteElement (derived from GenericLocalFiniteElement) and ...
Definition: localfunctions/utility/localfiniteelement.hh:171
L2LocalFiniteElement(const GeometryType >, const typename Base::Key &key)
Definition: localfunctions/utility/localfiniteelement.hh:180
GenericLocalFiniteElement< typename FE::BasisFactory, DGLocalCoefficientsFactory< typename FE::BasisFactory >, LocalL2InterpolationFactory< typename FE::BasisFactory, false > > Base
Definition: localfunctions/utility/localfiniteelement.hh:174
Base::Traits Traits
Definition: localfunctions/utility/localfiniteelement.hh:176