2 #ifndef DUNE_PDELAB_FINITEELEMENTMAP_PKQKFEM_HH
3 #define DUNE_PDELAB_FINITEELEMENTMAP_PKQKFEM_HH
8 #include <dune/geometry/type.hh>
10 #include <dune/localfunctions/common/virtualwrappers.hh>
11 #include <dune/localfunctions/common/virtualinterface.hh>
25 template<
class D,
class R,
int d,
int k>
26 struct InitPkQkLocalFiniteElementMap
30 static void init(C & c,
unsigned int order)
34 typedef Dune::QkLocalFiniteElement<D,R,d,k> QkLFE;
35 typedef Dune::PkLocalFiniteElement<D,R,d,k> PkLFE;
36 typedef typename C::value_type ptr;
37 c[0] = ptr(
new LocalFiniteElementVirtualImp<QkLFE>(QkLFE()));
38 c[1] = ptr(
new LocalFiniteElementVirtualImp<PkLFE>(PkLFE()));
41 InitPkQkLocalFiniteElementMap<D,R,d,k-1>::init(c,order);
44 template<
class D,
class R,
int d>
45 struct InitPkQkLocalFiniteElementMap<D,R,d,-1>
48 static void init(C & c,
unsigned int order)
50 DUNE_THROW(Exception,
"Sorry, but we failed to initialize a QkPk FiniteElementMap of order " << order);
65 template<
class D,
class R,
int d,
int maxP=6>
69 typedef LocalFiniteElementVirtualInterface<Dune::LocalBasisTraits<D,d,Dune::FieldVector<D,d>,R,1,Dune::FieldVector<R,1>,Dune::FieldMatrix<R,1,d> > > FiniteElementType;
80 InitPkQkLocalFiniteElementMap<D,R,d,maxP>::init(finiteElements_,maxP);
89 InitPkQkLocalFiniteElementMap<D,R,d,maxP>::init(finiteElements_,order);
93 template<
class EntityType>
96 typename Dune::GeometryType geoType=
e.type();
105 return *(finiteElements_[0]);
109 return *(finiteElements_[1]);
111 DUNE_THROW(
Exception,
"We can only handle cubes and simplices");
124 return order_ == 0 || order_ > 1;
132 std::size_t
size(GeometryType gt)
const
134 DUNE_THROW(NotImplemented,
"PkQkLocalFiniteElement is not fixed-size!");
143 std::array< std::shared_ptr<FiniteElementType>, 2 > finiteElements_;
144 const std::size_t order_;
149 #endif // DUNE_PDELAB_FINITEELEMENTMAP_PKQKFEM_HH