refinedp0.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_P0_LOCALFINITEELEMENT_HH
00004 #define DUNE_REFINED_P0_LOCALFINITEELEMENT_HH
00005 
00006 #include <dune/common/geometrytype.hh>
00007 
00008 #include <dune/localfunctions/common/localfiniteelementtraits.hh>
00009 #include <dune/localfunctions/lagrange/p0.hh>
00010 
00011 #include "refinedp0/refinedp0localbasis.hh"
00012 #include "refinedp0/refinedp0localcoefficients.hh"
00013 #include "refinedp0/refinedp0localinterpolation.hh"
00014 
00018 namespace Dune
00019 {
00020 
00023   template<class D, class R, int dim>
00024   class RefinedP0LocalFiniteElement
00025   {
00026     RefinedP0LocalFiniteElement() {}
00027 
00028   public:
00029       // We steal the p0 traits since they exist for all dim.
00030       // This allows to instanciate the type and access the Traits.
00031       typedef typename P0LocalFiniteElement<D,R,dim>::Traits Traits;
00032   };
00033 
00036   template<class D, class R>
00037   class RefinedP0LocalFiniteElement<D,R,2>
00038   {
00039   public:
00042     typedef LocalFiniteElementTraits<
00043       RefinedP0LocalBasis<D,R,2>,
00044       RefinedP0LocalCoefficients<2>,
00045       RefinedP0LocalInterpolation<RefinedP0LocalBasis<D,R,2> > > Traits;
00046 
00049     RefinedP0LocalFiniteElement ()
00050     {
00051       gt.makeTriangle();
00052     }
00053 
00056     const typename Traits::LocalBasisType& localBasis () const
00057     {
00058       return basis_;
00059     }
00060 
00063     const typename Traits::LocalCoefficientsType& localCoefficients () const
00064     {
00065       return coefficients_;
00066     }
00067 
00070     const typename Traits::LocalInterpolationType& localInterpolation () const
00071     {
00072       return interpolation_;
00073     }
00074 
00077     GeometryType type () const
00078     {
00079       return gt;
00080     }
00081 
00082     RefinedP0LocalFiniteElement * clone () const
00083     {
00084       return new RefinedP0LocalFiniteElement(*this);
00085     }
00086 
00087   private:
00088     RefinedP0LocalBasis<D,R,2> basis_;
00089     RefinedP0LocalCoefficients<2> coefficients_;
00090     RefinedP0LocalInterpolation<RefinedP0LocalBasis<D,R,2> > interpolation_;
00091     GeometryType gt;
00092   };
00093 
00094 
00095 }
00096 
00097 #endif
Generated on Sat Apr 24 11:15:35 2010 for dune-localfunctions by  doxygen 1.6.3