3#ifndef DUNE_GENERIC_LOCALFINITEELEMENT_HH
4#define DUNE_GENERIC_LOCALFINITEELEMENT_HH
9#include <dune/localfunctions/common/localfiniteelementtraits.hh>
10#include <dune/localfunctions/utility/l2interpolation.hh>
11#include <dune/localfunctions/utility/dglocalcoefficients.hh>
21 template<
class BasisF,
class CoeffF,
class InterpolF>
26 typename CoeffF::Object,
27 typename InterpolF::Object >
Traits;
29 typedef typename BasisF::Key Key;
30 static const unsigned int dimDomain = BasisF::dimension;
32 typedef BasisF BasisFactory;
33 typedef CoeffF CoefficientFactory;
34 typedef InterpolF InterpolationFactory;
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_);
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 > >
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:123
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:130
bool gt(const T &first, const T &second, typename EpsilonType< T >::Type epsilon)
test if first greater than second
Definition: float_cmp.cc:156
Dune namespace.
Definition: alignedallocator.hh:11
A factory class for the dg local coefficients.
Definition: dglocalcoefficients.hh:57
Takes the basis and interpolation factory from a given LocalFiniteElement (derived from GenericLocalF...
Definition: localfiniteelement.hh:146
DGLocalFiniteElement(const GeometryType >, const typename Base::Key &key)
Definition: localfiniteelement.hh:155
A LocalFiniteElement implementation based on three TopologyFactories providing the LocalBasis,...
Definition: localfiniteelement.hh:23
GeometryType type() const
Definition: localfiniteelement.hh:97
GenericLocalFiniteElement(const GenericLocalFiniteElement &other)
Definition: localfiniteelement.hh:53
const Traits::LocalInterpolationType & localInterpolation() const
Definition: localfiniteelement.hh:84
unsigned int size() const
Number of shape functions in this finite element.
Definition: localfiniteelement.hh:90
GenericLocalFiniteElement(const GeometryType >, const Key &key)
Definition: localfiniteelement.hh:42
const Traits::LocalCoefficientsType & localCoefficients() const
Definition: localfiniteelement.hh:77
const Traits::LocalBasisType & localBasis() const
Definition: localfiniteelement.hh:70
Takes the basis factory from a given LocalFiniteElement (derived from GenericLocalFiniteElement) and ...
Definition: localfiniteelement.hh:171
L2LocalFiniteElement(const GeometryType >, const typename Base::Key &key)
Definition: localfiniteelement.hh:180
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 local l2 interpolations taking a basis factory.
Definition: l2interpolation.hh:197
A unique label for each type of element that can occur in a grid.
Helper classes to provide indices for geometrytypes for use in a vector.