dune-localfunctions  2.1.1
edges0.5.hh
Go to the documentation of this file.
00001 // -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
00002 // vi: set ts=8 sw=2 et sts=2:
00003 
00004 #ifndef DUNE_LOCALFUNCTIONS_WHITNEY_EDGES0_5_HH
00005 #define DUNE_LOCALFUNCTIONS_WHITNEY_EDGES0_5_HH
00006 
00007 // #include <cstddef>
00008 // #include <vector>
00009 
00010 // #include <dune/common/fmatrix.hh>
00011 // #include <dune/common/fvector.hh>
00012 #include <dune/common/geometrytype.hh>
00013 
00014 // #include <dune/grid/common/genericreferenceelements.hh>
00015 
00016 // #include <dune/localfunctions/common/localkey.hh>
00017 // #include <dune/localfunctions/common/localtoglobaladaptors.hh>
00018 // #include <dune/localfunctions/lagrange/p1/p1localbasis.hh>
00019 #include <dune/localfunctions/whitney/edges0.5/basis.hh>
00020 #include <dune/localfunctions/whitney/edges0.5/coefficients.hh>
00021 #include <dune/localfunctions/whitney/edges0.5/interpolation.hh>
00022 
00023 namespace Dune {
00024 
00026   //
00027   //  FiniteElement
00028   //
00029 
00031 
00047   template<class Geometry, class RF>
00048   class EdgeS0_5FiniteElement {
00049   public:
00053     struct Traits {
00054       typedef EdgeS0_5Basis<Geometry, RF> Basis;
00055       typedef EdgeS0_5Interpolation<Geometry,
00056                                     typename Basis::Traits> Interpolation;
00057       typedef EdgeS0_5Coefficients<Geometry::mydimension> Coefficients;
00058     };
00059 
00060   private:
00061     typename Traits::Basis basis_;
00062     typename Traits::Interpolation interpolation_;
00063     static const typename Traits::Coefficients& coefficients_;
00064     static const GeometryType gt;
00065 
00066   public:
00068 
00072     template<class VertexOrder>
00073     EdgeS0_5FiniteElement(const Geometry& geo,
00074                           const VertexOrder& vertexOrder) :
00075       basis_(geo, vertexOrder), interpolation_(geo, vertexOrder)
00076     { }
00077 
00079     const typename Traits::Basis& basis() const { return basis_; }
00081     const typename Traits::Interpolation& interpolation() const
00082     { return interpolation_; }
00084     const typename Traits::Coefficients& coefficients() const
00085     { return coefficients_; }
00087     const GeometryType& type() const { return gt; }
00088   };
00089 
00090   template<class Geometry, class RF>
00091   const typename EdgeS0_5FiniteElement<Geometry, RF>::Traits::Coefficients&
00092   EdgeS0_5FiniteElement<Geometry, RF>::coefficients_ =
00093     typename Traits::Coefficients();
00094 
00095   template<class Geometry, class RF>
00096   const GeometryType
00097   EdgeS0_5FiniteElement<Geometry, RF>::gt(GeometryType::simplex,
00098                                           Geometry::mydimension);
00099 
00101   //
00102   // Factory
00103   //
00104 
00106 
00115   template<class Geometry, class RF>
00116   struct EdgeS0_5FiniteElementFactory {
00117     typedef EdgeS0_5FiniteElement<Geometry, RF> FiniteElement;
00118 
00120 
00134     template<class VertexOrder>
00135     const FiniteElement make(const Geometry& geometry,
00136                              const VertexOrder& vertexOrder)
00137     { return FiniteElement(geometry, vertexOrder); }
00138   };
00139 
00140 } // namespace Dune
00141 
00142 #endif // DUNE_LOCALFUNCTIONS_WHITNEY_EDGES0_5_HH