dune-localfunctions  2.2.1
pq22d.hh
Go to the documentation of this file.
1 // -*- tab-width: 8; indent-tabs-mode: nil -*-
2 // vi: set ts=8 sw=2 et sts=2:
3 #ifndef DUNE_PQ22DLOCALFINITEELEMENT_HH
4 #define DUNE_PQ22DLOCALFINITEELEMENT_HH
5 
6 #include <dune/common/fmatrix.hh>
7 
10 #include "q22d.hh"
11 #include "pk2d.hh"
12 
13 namespace Dune
14 {
15  template<class D, class R>
17  {
18  typedef Dune::FieldVector<D,2> Domain;
19  typedef Dune::FieldVector<R,1> Range;
21 
23  public:
28  > Traits;
32 
33  PQ22DLocalFiniteElement ( const GeometryType &gt )
34  : gt_(gt)
35  {
36  if ( gt.isTriangle() )
38  else if ( gt.isQuadrilateral() )
39  setup( Q22DLocalFiniteElement<D,R>() );
40  }
41 
42  PQ22DLocalFiniteElement ( const GeometryType &gt, const std::vector<unsigned int> vertexmap )
43  : gt_(gt)
44  {
45  if ( gt.isTriangle() )
46  setup( Pk2DLocalFiniteElement<D,R,2>(vertexmap) );
47  else if ( gt.isQuadrilateral() )
48  setup( Q22DLocalFiniteElement<D,R>() );
49  }
50 
52  : gt_(other.gt_)
53  {
54  fe_ = other.fe_->clone();
55  }
56 
58  {
59  delete fe_;
60  }
61 
62  const LocalBasis& localBasis () const
63  {
64  return fe_->localBasis();
65  }
66 
68  {
69  return fe_->localCoefficients();
70  }
71 
73  {
74  return fe_->localInterpolation();
75  }
76 
77  const GeometryType &type () const
78  {
79  return gt_;
80  }
81 
82  private:
83 
84  template <class FE>
85  void setup(const FE& fe)
86  {
88  }
89 
90  const GeometryType gt_;
91  const LocalFiniteElementBase *fe_;
92  };
93 
94 }
95 
96 #endif