dune-localfunctions  2.2.0
refinedp1.hh
Go to the documentation of this file.
00001 // -*- tab-width: 8; indent-tabs-mode: nil -*-
00002 // vi: set ts=8 sw=2 et sts=2:
00003 #ifndef DUNE_REFINED_P1_LOCALFINITEELEMENT_HH
00004 #define DUNE_REFINED_P1_LOCALFINITEELEMENT_HH
00005 
00006 #include <dune/geometry/type.hh>
00007 
00008 #include <dune/localfunctions/common/localfiniteelementtraits.hh>
00009 #include <dune/localfunctions/lagrange/p0.hh>
00010 
00011 #include <dune/localfunctions/refined/refinedp1/refinedp1localbasis.hh>
00012 #include <dune/localfunctions/lagrange/pk1d/pk1dlocalcoefficients.hh>
00013 #include <dune/localfunctions/lagrange/pk1d/pk1dlocalinterpolation.hh>
00014 #include <dune/localfunctions/lagrange/pk1d/pk1dlocalbasis.hh>
00015 #include <dune/localfunctions/lagrange/pk2d/pk2dlocalcoefficients.hh>
00016 #include <dune/localfunctions/lagrange/pk2d/pk2dlocalinterpolation.hh>
00017 #include <dune/localfunctions/lagrange/pk2d/pk2dlocalbasis.hh>
00018 #include <dune/localfunctions/lagrange/pk3d/pk3dlocalcoefficients.hh>
00019 #include <dune/localfunctions/lagrange/pk3d/pk3dlocalinterpolation.hh>
00020 #include <dune/localfunctions/lagrange/pk3d/pk3dlocalbasis.hh>
00021 
00022 namespace Dune
00023 {
00024 
00027   template<class D, class R, int dim>
00028   class RefinedP1LocalFiniteElement
00029   {
00030   public:
00033     typedef LocalFiniteElementTraits<RefinedP1LocalBasis<D,R,1>,
00034                                          Pk1DLocalCoefficients<2>,
00035                                          Pk1DLocalInterpolation<Pk1DLocalBasis<D,R,2> > > Traits;
00036 
00039     RefinedP1LocalFiniteElement ()
00040     {
00041       gt.makeLine();
00042     }
00043 
00046     const typename Traits::LocalBasisType& localBasis () const
00047     {
00048       return basis;
00049     }
00050 
00053     const typename Traits::LocalCoefficientsType& localCoefficients () const
00054     {
00055       return coefficients;
00056     }
00057 
00060     const typename Traits::LocalInterpolationType& localInterpolation () const
00061     {
00062       return interpolation;
00063     }
00064 
00067     GeometryType type () const
00068     {
00069       return gt;
00070     }
00071 
00072     RefinedP1LocalFiniteElement * clone () const
00073     {
00074       return new RefinedP1LocalFiniteElement(*this);
00075     }
00076 
00077   private:
00078     RefinedP1LocalBasis<D,R,1> basis;
00079     Pk1DLocalCoefficients<2> coefficients;
00080     Pk1DLocalInterpolation<Pk1DLocalBasis<D,R,2> > interpolation;
00081     GeometryType gt;
00082   };
00083 
00084 
00085 
00088   template<class D, class R>
00089   class RefinedP1LocalFiniteElement<D,R,2>
00090   {
00091   public:
00094     typedef LocalFiniteElementTraits<RefinedP1LocalBasis<D,R,2>,
00095                                          Pk2DLocalCoefficients<2>,
00096                                          Pk2DLocalInterpolation<Pk2DLocalBasis<D,R,2> > > Traits;
00097 
00100     RefinedP1LocalFiniteElement ()
00101     {
00102       gt.makeTriangle();
00103     }
00104 
00107     const typename Traits::LocalBasisType& localBasis () const
00108     {
00109       return basis;
00110     }
00111 
00114     const typename Traits::LocalCoefficientsType& localCoefficients () const
00115     {
00116       return coefficients;
00117     }
00118 
00121     const typename Traits::LocalInterpolationType& localInterpolation () const
00122     {
00123       return interpolation;
00124     }
00125 
00128     GeometryType type () const
00129     {
00130       return gt;
00131     }
00132 
00133     RefinedP1LocalFiniteElement * clone () const
00134     {
00135       return new RefinedP1LocalFiniteElement(*this);
00136     }
00137 
00138   private:
00139     RefinedP1LocalBasis<D,R,2> basis;
00140     Pk2DLocalCoefficients<2> coefficients;
00141     Pk2DLocalInterpolation<Pk2DLocalBasis<D,R,2> > interpolation;
00142     GeometryType gt;
00143   };
00144 
00147   template<class D, class R>
00148   class RefinedP1LocalFiniteElement<D,R,3>
00149   {
00150   public:
00153     typedef LocalFiniteElementTraits<RefinedP1LocalBasis<D,R,3>,
00154                                          Pk3DLocalCoefficients<2>,
00155                                          Pk3DLocalInterpolation<Pk3DLocalBasis<D,R,2> > > Traits;
00156 
00159     RefinedP1LocalFiniteElement ()
00160     {
00161       gt.makeTetrahedron();
00162     }
00163 
00166     const typename Traits::LocalBasisType& localBasis () const
00167     {
00168       return basis;
00169     }
00170 
00173     const typename Traits::LocalCoefficientsType& localCoefficients () const
00174     {
00175       return coefficients;
00176     }
00177 
00180     const typename Traits::LocalInterpolationType& localInterpolation () const
00181     {
00182       return interpolation;
00183     }
00184 
00187     GeometryType type () const
00188     {
00189       return gt;
00190     }
00191 
00192     RefinedP1LocalFiniteElement* clone () const
00193     {
00194       return new RefinedP1LocalFiniteElement(*this);
00195     }
00196 
00197   private:
00198     RefinedP1LocalBasis<D,R,3> basis;
00199     Pk3DLocalCoefficients<2> coefficients;
00200     Pk3DLocalInterpolation<Pk3DLocalBasis<D,R,2> > interpolation;
00201     GeometryType gt;
00202   };
00203 
00204 }
00205 
00206 #endif