5#ifndef DUNE_GENERIC_LOCALFINITEELEMENT_HH
6#define DUNE_GENERIC_LOCALFINITEELEMENT_HH
8#include <dune/geometry/type.hh>
9#include <dune/geometry/typeindex.hh>
23 template<
class BasisF,
class CoeffF,
class InterpolF>
28 typename CoeffF::Object,
31 typedef typename BasisF::Key
Key;
32 static const unsigned int dimDomain = BasisF::dimension;
38 static_assert(std::is_same<Key, typename CoeffF::Key>::value,
39 "incompatible keys between BasisCreator and CoefficientsCreator");
40 static_assert(std::is_same<Key, typename InterpolF::Key>::value,
41 "incompatible keys between BasisCreator and InterpolationCreator" );
49 Impl::toGeometryTypeIdConstant<dimDomain>(
type(), [&](
auto geometryTypeId) {
50 finiteElement_.template create<decltype(geometryTypeId)::value>(key_);
56 : geometry_( other.
type() ),
60 Impl::toGeometryTypeIdConstant<dimDomain>(
type(), [&](
auto geometryTypeId) {
61 finiteElement_.template create<decltype(geometryTypeId)::value>(key_);
67 finiteElement_.release();
74 return *(finiteElement_.basis_);
81 return *(finiteElement_.coeff_);
88 return *(finiteElement_.interpol_);
94 return finiteElement_.basis_->size();
106 FiniteElement() : basis_(0), coeff_(0), interpol_(0) {}
108 template < GeometryType::Id geometryId >
109 void create(
const Key &key )
112 basis_ = BasisF::template create<geometryId>(key);
113 coeff_ = CoeffF::template create<geometryId>(key);
114 interpol_ = InterpolF::template create<geometryId>(key);
119 BasisF::release(basis_);
121 CoeffF::release(coeff_);
123 InterpolF::release(interpol_);
132 GeometryType geometry_;
134 FiniteElement finiteElement_;
146 DGLocalCoefficientsFactory< typename FE::BasisFactory >,
147 typename FE::InterpolationFactory>
151 typename FE::InterpolationFactory>
Base;
171 DGLocalCoefficientsFactory< typename FE::BasisFactory >,
172 LocalL2InterpolationFactory< typename FE::BasisFactory, false > >
Definition bdfmcube.hh:18
traits helper struct
Definition localfiniteelementtraits.hh:13
LB LocalBasisType
Definition localfiniteelementtraits.hh:16
LC LocalCoefficientsType
Definition localfiniteelementtraits.hh:20
LI LocalInterpolationType
Definition localfiniteelementtraits.hh:24
A factory class for the dg local coefficients.
Definition dglocalcoefficients.hh:59
A factory class for the local l2 interpolations taking a basis factory.
Definition l2interpolation.hh:163
A LocalFiniteElement implementation based on three TopologyFactories providing the LocalBasis,...
Definition localfunctions/utility/localfiniteelement.hh:25
GeometryType type() const
Definition localfunctions/utility/localfiniteelement.hh:99
GenericLocalFiniteElement(const GenericLocalFiniteElement &other)
Definition localfunctions/utility/localfiniteelement.hh:55
const Traits::LocalInterpolationType & localInterpolation() const
Definition localfunctions/utility/localfiniteelement.hh:86
unsigned int size() const
Number of shape functions in this finite element.
Definition localfunctions/utility/localfiniteelement.hh:92
CoeffF CoefficientFactory
Definition localfunctions/utility/localfiniteelement.hh:35
BasisF BasisFactory
Definition localfunctions/utility/localfiniteelement.hh:34
BasisF::Key Key
Definition localfunctions/utility/localfiniteelement.hh:31
GenericLocalFiniteElement(const GeometryType >, const Key &key)
Definition localfunctions/utility/localfiniteelement.hh:44
const Traits::LocalCoefficientsType & localCoefficients() const
Definition localfunctions/utility/localfiniteelement.hh:79
InterpolF InterpolationFactory
Definition localfunctions/utility/localfiniteelement.hh:36
static const unsigned int dimDomain
Definition localfunctions/utility/localfiniteelement.hh:32
LocalFiniteElementTraits< typename BasisF::Object, typename CoeffF::Object, typename InterpolF::Object > Traits
Definition localfunctions/utility/localfiniteelement.hh:29
GenericLocalFiniteElement< BasisF, CoeffF, InterpolF > This
Definition localfunctions/utility/localfiniteelement.hh:26
const Traits::LocalBasisType & localBasis() const
Definition localfunctions/utility/localfiniteelement.hh:72
~GenericLocalFiniteElement()
Definition localfunctions/utility/localfiniteelement.hh:65
Takes the basis and interpolation factory from a given LocalFiniteElement (derived from GenericLocalF...
Definition localfunctions/utility/localfiniteelement.hh:148
Base::Traits Traits
Definition localfunctions/utility/localfiniteelement.hh:153
DGLocalFiniteElement(const GeometryType >, const typename Base::Key &key)
Definition localfunctions/utility/localfiniteelement.hh:157
GenericLocalFiniteElement< typename FE::BasisFactory, DGLocalCoefficientsFactory< typename FE::BasisFactory >, typename FE::InterpolationFactory > Base
Definition localfunctions/utility/localfiniteelement.hh:151
Takes the basis factory from a given LocalFiniteElement (derived from GenericLocalFiniteElement) and ...
Definition localfunctions/utility/localfiniteelement.hh:173
L2LocalFiniteElement(const GeometryType >, const typename Base::Key &key)
Definition localfunctions/utility/localfiniteelement.hh:182
GenericLocalFiniteElement< typename FE::BasisFactory, DGLocalCoefficientsFactory< typename FE::BasisFactory >, LocalL2InterpolationFactory< typename FE::BasisFactory, false > > Base
Definition localfunctions/utility/localfiniteelement.hh:176
Base::Traits Traits
Definition localfunctions/utility/localfiniteelement.hh:178