2 #ifndef DUNE_PDELAB_VARIABLEOPBFEM_HH
3 #define DUNE_PDELAB_VARIABLEOPBFEM_HH
5 #include <dune/geometry/type.hh>
7 #include <dune/localfunctions/common/virtualwrappers.hh>
8 #include <dune/common/array.hh>
9 #include <dune/common/shared_ptr.hh>
18 template<
class D,
class R,
int d,
int p, Dune::GeometryType::BasicType bt,
typename ComputationFieldType>
19 struct InitVariableOPBLocalFiniteElementMap
22 static void init(C & c)
25 typedef typename C::value_type ptr;
26 c[
p] = ptr(
new LocalFiniteElementVirtualImp<LFE>);
28 InitVariableOPBLocalFiniteElementMap<D,R,d,p-1,bt,ComputationFieldType>::init(c);
31 template<
class D,
class R,
int d, Dune::GeometryType::BasicType bt,
typename ComputationFieldType>
32 struct InitVariableOPBLocalFiniteElementMap<D,R,d,-1,bt,ComputationFieldType>
35 static void init(C & c) {}
41 template<
class M,
class D,
class R,
int d,
typename ComputationFieldType=R,
int maxP=6, Dune::GeometryType::BasicType bt=Dune::GeometryType::cube>
44 typedef typename FixedOrderLocalBasisTraits<
45 typename MonomLocalFiniteElement<D,R,d,0>::Traits::LocalBasisType::Traits,0>
::Traits T;
47 typedef LocalFiniteElementVirtualInterface<T> FiniteElementType;
52 mapper_(m), polOrder_(mapper_.
size(), defaultP), defaultP_(defaultP)
54 InitVariableOPBLocalFiniteElementMap<D,R,d,maxP,bt,ComputationFieldType>::init(finiteElements_);
58 template<
class EntityType>
67 return *(finiteElements_[
p]);
73 return *(finiteElements_[defaultP_]);
76 template<
class EntityType>
80 unsigned int i = mapper_.map(e);
84 template<
class EntityType>
87 unsigned int i = mapper_.map(e);
88 unsigned int p = polOrder_[i];
98 std::size_t
size(GeometryType gt)
const
100 DUNE_THROW(Dune::Exception,
"This should not be called!");
105 return getFEM(maxP).localCoefficients().size();
110 std::vector<unsigned char> polOrder_;
111 unsigned int defaultP_;
112 Dune::array< Dune::shared_ptr<FiniteElementType>, maxP+1 > finiteElements_;
120 #endif //DUNE_PDELAB_VARIABLEOPBFEM_HH
void setOrder(const EntityType &e, unsigned int p)
Definition: variableopbfem.hh:77
const Traits::FiniteElementType & getFEM() const
get local basis functions for the default order
Definition: variableopbfem.hh:71
bool fixedSize() const
Definition: variableopbfem.hh:93
This file defines polynomial basis functions on the reference element in a generic way...
FiniteElementMapTraits< FiniteElementType > Traits
Definition: variableopbfem.hh:49
collect types exported by a finite element map
Definition: finiteelementmap.hh:27
Definition: l2orthonormal.hh:862
T FiniteElementType
Type of finite element from local functions.
Definition: finiteelementmap.hh:30
std::size_t size(GeometryType gt) const
Definition: variableopbfem.hh:98
const Traits::FiniteElementType & find(const EntityType &e) const
get local basis functions for entity
Definition: variableopbfem.hh:59
std::size_t maxLocalSize() const
Definition: variableopbfem.hh:103
Definition: variableopbfem.hh:42
unsigned int getOrder(const EntityType &e) const
Definition: variableopbfem.hh:85
const Traits::FiniteElementType & getFEM(unsigned int p) const
get local basis functions for a given polynomial order
Definition: variableopbfem.hh:65
VariableOPBLocalFiniteElementMap(const M &m, unsigned int defaultP)
Definition: variableopbfem.hh:51
R p(int i, D x)
Definition: qkdg.hh:62
const E & e
Definition: interpolate.hh:172