2 #ifndef DUNE_PDELAB_FINITEELEMENTMAP_VARIABLEOPBFEM_HH 3 #define DUNE_PDELAB_FINITEELEMENTMAP_VARIABLEOPBFEM_HH 7 #include <dune/geometry/type.hh> 9 #include <dune/localfunctions/common/virtualwrappers.hh> 10 #include <dune/common/array.hh> 19 template<
class D,
class R,
int d,
int p, Dune::GeometryType::BasicType bt,
typename ComputationFieldType>
20 struct InitVariableOPBLocalFiniteElementMap
23 static void init(C & c)
26 typedef typename C::value_type ptr;
27 c[
p] = ptr(
new LocalFiniteElementVirtualImp<LFE>);
29 InitVariableOPBLocalFiniteElementMap<D,R,d,p-1,bt,ComputationFieldType>::init(c);
32 template<
class D,
class R,
int d, Dune::GeometryType::BasicType bt,
typename ComputationFieldType>
33 struct InitVariableOPBLocalFiniteElementMap<D,R,d,-1,bt,ComputationFieldType>
36 static void init(C & c) {}
42 template<
class M,
class D,
class R,
int d,
typename ComputationFieldType=R,
int maxP=6, Dune::GeometryType::BasicType bt=Dune::GeometryType::cube>
45 typedef typename FixedOrderLocalBasisTraits<
46 typename MonomialLocalFiniteElement<D,R,d,0>::Traits::LocalBasisType::Traits,0>
::Traits T;
48 typedef LocalFiniteElementVirtualInterface<T> FiniteElementType;
53 mapper_(m), polOrder_(mapper_.size(), defaultP), defaultP_(defaultP)
55 InitVariableOPBLocalFiniteElementMap<D,R,d,maxP,bt,ComputationFieldType>::init(finiteElements_);
59 template<
class EntityType>
62 return getFEM(getOrder(e));
68 return *(finiteElements_[
p]);
74 return *(finiteElements_[defaultP_]);
77 template<
class EntityType>
81 unsigned int i = mapper_.map(e);
85 template<
class EntityType>
88 unsigned int i = mapper_.map(e);
89 unsigned int p = polOrder_[i];
104 std::size_t
size(GeometryType gt)
const 106 DUNE_THROW(Dune::Exception,
"This should not be called!");
111 return getFEM(maxP).localCoefficients().size();
116 std::vector<unsigned char> polOrder_;
117 unsigned int defaultP_;
118 std::array< std::shared_ptr<FiniteElementType>, maxP+1 > finiteElements_;
126 #endif // DUNE_PDELAB_FINITEELEMENTMAP_VARIABLEOPBFEM_HH const Traits::FiniteElementType & getFEM(unsigned int p) const
get local basis functions for a given polynomial order
Definition: variableopbfem.hh:66
const Entity & e
Definition: localfunctionspace.hh:111
const Traits::FiniteElementType & getFEM() const
get local basis functions for the default order
Definition: variableopbfem.hh:72
void setOrder(const EntityType &e, unsigned int p)
Definition: variableopbfem.hh:78
bool fixedSize() const
Definition: variableopbfem.hh:94
T FiniteElementType
Type of finite element from local functions.
Definition: finiteelementmap.hh:30
For backward compatibility – Do not use this!
Definition: adaptivity.hh:27
const P & p
Definition: constraints.hh:147
std::size_t maxLocalSize() const
Definition: variableopbfem.hh:109
std::size_t size(GeometryType gt) const
Definition: variableopbfem.hh:104
Definition: l2orthonormal.hh:873
const Traits::FiniteElementType & find(const EntityType &e) const
get local basis functions for entity
Definition: variableopbfem.hh:60
Definition: variableopbfem.hh:43
collect types exported by a finite element map
Definition: finiteelementmap.hh:27
unsigned int getOrder(const EntityType &e) const
Definition: variableopbfem.hh:86
FiniteElementMapTraits< FiniteElementType > Traits
Definition: variableopbfem.hh:50
bool hasDOFs(int codim) const
Definition: variableopbfem.hh:99
VariableOPBLocalFiniteElementMap(const M &m, unsigned int defaultP)
Definition: variableopbfem.hh:52
This file defines polynomial basis functions on the reference element in a generic way...