2#ifndef DUNE_PDELAB_FINITEELEMENTMAP_VARIABLEOPBFEM_HH
3#define DUNE_PDELAB_FINITEELEMENTMAP_VARIABLEOPBFEM_HH
8#include <dune/geometry/type.hh>
10#include <dune/localfunctions/common/virtualwrappers.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 MonomialLocalFiniteElement<D,R,d,0>::Traits::LocalBasisType::Traits T;
47 typedef LocalFiniteElementVirtualInterface<T> FiniteElementType;
55 mapper_(m), polOrder_(mapper_.
size(), defaultP), defaultP_(defaultP)
57 InitVariableOPBLocalFiniteElementMap<D,R,d,maxP,bt,ComputationFieldType>::init(finiteElements_);
61 template<
class EntityType>
70 return *(finiteElements_[
p]);
76 return *(finiteElements_[defaultP_]);
79 template<
class EntityType>
83 unsigned int i = mapper_.map(e);
87 template<
class EntityType>
88 unsigned int getOrder (
const EntityType& e)
const
90 unsigned int i = mapper_.map(e);
91 unsigned int p = polOrder_[i];
106 std::size_t
size(GeometryType gt)
const
108 DUNE_THROW(Dune::Exception,
"This should not be called!");
113 return getFEM(maxP).localCoefficients().size();
118 std::vector<unsigned char> polOrder_;
119 unsigned int defaultP_;
120 std::array< std::shared_ptr<FiniteElementType>, maxP+1 > finiteElements_;
const P & p
Definition: constraints.hh:148
This file defines polynomial basis functions on the reference element in a generic way.
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
Definition: l2orthonormal.hh:791
collect types exported by a finite element map
Definition: finiteelementmap.hh:28
T FiniteElementType
Type of finite element from local functions.
Definition: finiteelementmap.hh:30
Definition: variableopbfem.hh:44
VariableOPBLocalFiniteElementMap(const M &m, unsigned int defaultP)
Definition: variableopbfem.hh:54
unsigned int getOrder(const EntityType &e) const
Definition: variableopbfem.hh:88
std::size_t maxLocalSize() const
Definition: variableopbfem.hh:111
std::size_t size(GeometryType gt) const
Definition: variableopbfem.hh:106
static constexpr bool hasDOFs(int codim)
Definition: variableopbfem.hh:101
static constexpr int dimension
The dimension of the finite elements returned by this map.
Definition: variableopbfem.hh:52
const Traits::FiniteElementType & getFEM(unsigned int p) const
get local basis functions for a given polynomial order
Definition: variableopbfem.hh:68
const Traits::FiniteElementType & find(const EntityType &e) const
get local basis functions for entity
Definition: variableopbfem.hh:62
static constexpr bool fixedSize()
Definition: variableopbfem.hh:96
const Traits::FiniteElementType & getFEM() const
get local basis functions for the default order
Definition: variableopbfem.hh:74
FiniteElementMapTraits< FiniteElementType > Traits
Definition: variableopbfem.hh:49
void setOrder(const EntityType &e, unsigned int p)
Definition: variableopbfem.hh:80