2 #ifndef DUNE_PDELAB_PKQKFEM_HH
3 #define DUNE_PDELAB_PKQKFEM_HH
5 #include <dune/geometry/type.hh>
7 #include <dune/localfunctions/common/virtualwrappers.hh>
8 #include <dune/localfunctions/common/virtualinterface.hh>
9 #include <dune/common/array.hh>
10 #include <dune/common/shared_ptr.hh>
19 template<
class D,
class R,
int d,
int k>
20 struct InitPkQkLocalFiniteElementMap
23 static void init(C & c,
unsigned int order)
27 typedef Dune::QkLocalFiniteElement<D,R,d,k> QkLFE;
28 typedef Dune::PkLocalFiniteElement<D,R,d,k> PkLFE;
29 typedef typename C::value_type ptr;
30 c[0] = ptr(
new LocalFiniteElementVirtualImp<QkLFE>(QkLFE()));
31 c[1] = ptr(
new LocalFiniteElementVirtualImp<PkLFE>(PkLFE()));
34 InitPkQkLocalFiniteElementMap<D,R,d,k-1>::init(c,order);
37 template<
class D,
class R,
int d>
38 struct InitPkQkLocalFiniteElementMap<D,R,d,-1>
41 static void init(C & c,
unsigned int order)
43 DUNE_THROW(Exception,
"Sorry, but we failed to initialize a QkPk FiniteElementMap of order " << order);
50 template<
class D,
class R,
int d,
int maxP=6>
54 typedef LocalFiniteElementVirtualInterface<Dune::LocalBasisTraits<D,d,Dune::FieldVector<D,d>,R,1,Dune::FieldVector<R,1>,Dune::FieldMatrix<R,1,d>,0> > FiniteElementType;
60 InitPkQkLocalFiniteElementMap<D,R,d,maxP>::init(finiteElements_,maxP);
65 InitPkQkLocalFiniteElementMap<D,R,d,maxP>::init(finiteElements_,order);
69 template<
class EntityType>
72 typename Dune::GeometryType geoType=e.type();
81 return *(finiteElements_[0]);
85 return *(finiteElements_[1]);
87 DUNE_THROW(
Exception,
"We can only handle cubes and simplices");
95 std::size_t
size(GeometryType gt)
const
97 assert(
false &&
"this method should never be called");
106 Dune::array< Dune::shared_ptr<FiniteElementType>, 2 > finiteElements_;
111 #endif //DUNE_PDELAB_PKQKFEM_HH
std::size_t size(GeometryType gt) const
Definition: pkqkfem.hh:95
bool fixedSize() const
Definition: pkqkfem.hh:90
collect types exported by a finite element map
Definition: finiteelementmap.hh:27
const Traits::FiniteElementType & find(const EntityType &e) const
get local basis functions for entity
Definition: pkqkfem.hh:70
T FiniteElementType
Type of finite element from local functions.
Definition: finiteelementmap.hh:30
FiniteElementMapTraits< FiniteElementType > Traits
Definition: pkqkfem.hh:56
const Traits::FiniteElementType & getFEM(Dune::GeometryType gt) const
get local basis functions for a given geometrytype
Definition: pkqkfem.hh:77
Definition: pkqkfem.hh:51
PkQkLocalFiniteElementMap(unsigned int order)
Definition: pkqkfem.hh:63
PkQkLocalFiniteElementMap()
Definition: pkqkfem.hh:58
Base class for all PDELab exceptions.
Definition: exceptions.hh:17
std::size_t maxLocalSize() const
Definition: pkqkfem.hh:100
const E & e
Definition: interpolate.hh:172