2#ifndef DUNE_PDELAB_FINITEELEMENTMAP_VARIABLEQKDGFEM_HH
3#define DUNE_PDELAB_FINITEELEMENTMAP_VARIABLEQKDGFEM_HH
10#include <dune/localfunctions/common/virtualwrappers.hh>
11#include "finiteelementmap.hh"
18 template<
class D,
class R,
int d,
int p>
19 struct InitVariableQkDGLocalFiniteElementMap
22 static void init(C & c)
25 typedef typename C::value_type ptr;
26 c[p] = ptr(
new LocalFiniteElementVirtualImp<LFE>(LFE()));
28 InitVariableQkDGLocalFiniteElementMap<D,R,d,p-1>::init(c);
31 template<
class D,
class R,
int d>
32 struct InitVariableQkDGLocalFiniteElementMap<D,R,d,-1>
35 static void init(C & c) {}
41 template<
class M,
class D,
class R,
int d,
int maxP=6>
54 mapper_(m), polOrder_(mapper_.size(), defaultP), defaultP_(defaultP)
56 InitVariableQkDGLocalFiniteElementMap<D,R,d,maxP>::init(finiteElements_);
60 template<
class EntityType>
63 return getFEM(getOrder(e));
69 return *(finiteElements_[p]);
75 return *(finiteElements_[defaultP_]);
78 template<
class EntityType>
79 void setOrder (
const EntityType& e,
unsigned int p)
82 unsigned int i = mapper_.map(e);
86 template<
class EntityType>
87 unsigned int getOrder (
const EntityType& e)
const
89 unsigned int i = mapper_.map(e);
90 unsigned int p = polOrder_[i];
95 static constexpr bool fixedSize()
100 static constexpr bool hasDOFs(
int codim)
105 std::size_t size(GeometryType
gt)
const
110 std::size_t maxLocalSize()
const
112 return getFEM(maxP).localCoefficients().size();
117 std::vector<unsigned char> polOrder_;
118 unsigned int defaultP_;
119 std::array< std::shared_ptr<FiniteElementType>, maxP+1 > finiteElements_;
Base class for Dune-Exceptions.
Definition: exceptions.hh:96
virtual base class for local finite elements with functions
Definition: virtualinterface.hh:225
Definition: variableqkdgfem.hh:43
const Traits::FiniteElementType & getFEM() const
get local basis functions for the default order
Definition: variableqkdgfem.hh:73
static constexpr int dimension
The dimension of the finite elements returned by this map.
Definition: variableqkdgfem.hh:51
const Traits::FiniteElementType & find(const EntityType &e) const
get local basis functions for entity
Definition: variableqkdgfem.hh:61
const Traits::FiniteElementType & getFEM(unsigned int p) const
get local basis functions for a given polynomial order
Definition: variableqkdgfem.hh:67
Definition: qkdglagrange.hh:309
#define DUNE_THROW(E, m)
Definition: exceptions.hh:218
bool gt(const T &first, const T &second, typename EpsilonType< T >::Type epsilon)
test if first greater than second
Definition: float_cmp.cc:158
Dune namespace.
Definition: alignedallocator.hh:13
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
A unique label for each type of element that can occur in a grid.