dune-localfunctions
2.2.0
|
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/geometry/type.hh> 00013 00014 // #include <dune/grid/common/referenceelements.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 00071 template<class VertexOrder> 00072 EdgeS0_5FiniteElement(const Geometry& geo, 00073 const VertexOrder& vertexOrder) : 00074 basis_(geo, vertexOrder), interpolation_(geo, vertexOrder) 00075 { } 00076 00078 const typename Traits::Basis& basis() const { return basis_; } 00080 const typename Traits::Interpolation& interpolation() const 00081 { return interpolation_; } 00083 const typename Traits::Coefficients& coefficients() const 00084 { return coefficients_; } 00086 const GeometryType& type() const { return gt; } 00087 }; 00088 00089 template<class Geometry, class RF> 00090 const typename EdgeS0_5FiniteElement<Geometry, RF>::Traits::Coefficients& 00091 EdgeS0_5FiniteElement<Geometry, RF>::coefficients_ = 00092 typename Traits::Coefficients(); 00093 00094 template<class Geometry, class RF> 00095 const GeometryType 00096 EdgeS0_5FiniteElement<Geometry, RF>::gt(GeometryType::simplex, 00097 Geometry::mydimension); 00098 00100 // 00101 // Factory 00102 // 00103 00105 00114 template<class Geometry, class RF> 00115 struct EdgeS0_5FiniteElementFactory { 00116 typedef EdgeS0_5FiniteElement<Geometry, RF> FiniteElement; 00117 00119 00133 template<class VertexOrder> 00134 const FiniteElement make(const Geometry& geometry, 00135 const VertexOrder& vertexOrder) 00136 { return FiniteElement(geometry, vertexOrder); } 00137 }; 00138 00139 } // namespace Dune 00140 00141 #endif // DUNE_LOCALFUNCTIONS_WHITNEY_EDGES0_5_HH