pk2d.hh

Go to the documentation of this file.
00001 // -*- tab-width: 4; indent-tabs-mode: nil -*-
00002 // vi: set ts=4 sw=2 et sts=2:
00003 #ifndef DUNE_Pk2DLOCALFINITEELEMENT_HH
00004 #define DUNE_Pk2DLOCALFINITEELEMENT_HH
00005 
00006 #include <dune/common/geometrytype.hh>
00007 
00008 #include <dune/localfunctions/common/localfiniteelementtraits.hh>
00009 #include "pk2d/pk2dlocalbasis.hh"
00010 #include "pk2d/pk2dlocalcoefficients.hh"
00011 #include "pk2d/pk2dlocalinterpolation.hh"
00012 
00013 namespace Dune 
00014 {
00015 
00018   template<class D, class R, unsigned int k>
00019   class Pk2DLocalFiniteElement 
00020   {
00021   public:
00024         typedef LocalFiniteElementTraits<Pk2DLocalBasis<D,R,k>,
00025                                          Pk2DLocalCoefficients<k>,
00026                                          Pk2DLocalInterpolation<Pk2DLocalBasis<D,R,k> > > Traits;
00027 
00030         Pk2DLocalFiniteElement ()
00031         {
00032           gt.makeTriangle();
00033         }
00034 
00037         Pk2DLocalFiniteElement (int variant) : coefficients(variant)
00038         {
00039           gt.makeTriangle();
00040         }
00041 
00048         Pk2DLocalFiniteElement (const unsigned int vertexmap[3]) : coefficients(vertexmap)
00049         {
00050           gt.makeTriangle();
00051         }
00052 
00055         const typename Traits::LocalBasisType& localBasis () const
00056         {
00057           return basis;
00058         }
00059         
00062         const typename Traits::LocalCoefficientsType& localCoefficients () const
00063         {
00064           return coefficients;
00065         }
00066         
00069         const typename Traits::LocalInterpolationType& localInterpolation () const
00070         {
00071           return interpolation;
00072         }
00073         
00076         GeometryType type () const
00077         {
00078           return gt;
00079         }
00080 
00081     Pk2DLocalFiniteElement* clone () const
00082     {
00083       return new Pk2DLocalFiniteElement(*this);
00084     }
00085 
00086   private:
00087         Pk2DLocalBasis<D,R,k> basis;
00088         Pk2DLocalCoefficients<k> coefficients;
00089         Pk2DLocalInterpolation<Pk2DLocalBasis<D,R,k> > interpolation;
00090         GeometryType gt;
00091   };
00092 
00093 }
00094 
00095 #endif
Generated on Sat Apr 24 11:15:35 2010 for dune-localfunctions by  doxygen 1.6.3