dune-localfunctions  2.2.1
refinedp0.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_REFINED_P0_LOCALFINITEELEMENT_HH
4 #define DUNE_REFINED_P0_LOCALFINITEELEMENT_HH
5 
6 #include <dune/geometry/type.hh>
7 
10 
14 
18 namespace Dune
19 {
20 
23  template<class D, class R, int dim>
25  {
27 
28  public:
29  // We steal the p0 traits since they exist for all dim.
30  // This allows to instantiate the type and access the Traits.
32  };
33 
36  template<class D, class R>
38  {
39  public:
46 
50  {
51  gt.makeTriangle();
52  }
53 
56  const typename Traits::LocalBasisType& localBasis () const
57  {
58  return basis_;
59  }
60 
63  const typename Traits::LocalCoefficientsType& localCoefficients () const
64  {
65  return coefficients_;
66  }
67 
70  const typename Traits::LocalInterpolationType& localInterpolation () const
71  {
72  return interpolation_;
73  }
74 
77  GeometryType type () const
78  {
79  return gt;
80  }
81 
82  RefinedP0LocalFiniteElement * clone () const
83  {
84  return new RefinedP0LocalFiniteElement(*this);
85  }
86 
87  private:
89  RefinedP0LocalCoefficients<2> coefficients_;
91  GeometryType gt;
92  };
93 
96  template<class D, class R>
98  {
99  public:
102  typedef LocalFiniteElementTraits<
106 
110  {
111  gt.makeTetrahedron();
112  }
113 
116  const typename Traits::LocalBasisType& localBasis () const
117  {
118  return basis_;
119  }
120 
123  const typename Traits::LocalCoefficientsType& localCoefficients () const
124  {
125  return coefficients_;
126  }
127 
130  const typename Traits::LocalInterpolationType& localInterpolation () const
131  {
132  return interpolation_;
133  }
134 
137  GeometryType type () const
138  {
139  return gt;
140  }
141 
143  {
144  return new RefinedP0LocalFiniteElement(*this);
145  }
146 
147  private:
149  RefinedP0LocalCoefficients<3> coefficients_;
151  GeometryType gt;
152  };
153 
154 
155 }
156 
157 #endif