1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 // vi: set et ts=4 sw=2 sts=2: 3 #ifndef DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS0_CUBE2D_LOCALFINITEELEMENT_HH 4 #define DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS0_CUBE2D_LOCALFINITEELEMENT_HH 5 6 #include <dune/geometry/type.hh> 7 8 #include <dune/localfunctions/common/localfiniteelementtraits.hh> 9 #include "raviartthomas0cube2d/raviartthomas0cube2dall.hh" 10 11 namespace Dune 12 { 13 /** 14 * \brief Zero order Raviart-Thomas shape functions on rectangles. 15 * 16 * \ingroup RaviartThomas 17 * 18 * \tparam D Type to represent the field in the domain. 19 * \tparam R Type to represent the field in the range. 20 */ 21 template<class D, class R> 22 class RT0Cube2DLocalFiniteElement 23 { 24 public: 25 typedef LocalFiniteElementTraits< 26 RT0Cube2DLocalBasis<D,R>, 27 RT0Cube2DLocalCoefficients, 28 RT0Cube2DLocalInterpolation<RT0Cube2DLocalBasis<D,R> > > Traits; 29 RT0Cube2DLocalFiniteElement()30 RT0Cube2DLocalFiniteElement () 31 {} 32 RT0Cube2DLocalFiniteElement(int s)33 RT0Cube2DLocalFiniteElement (int s) : 34 basis(s), 35 interpolation(s) 36 {} 37 localBasis() const38 const typename Traits::LocalBasisType& localBasis () const 39 { 40 return basis; 41 } 42 localCoefficients() const43 const typename Traits::LocalCoefficientsType& localCoefficients () const 44 { 45 return coefficients; 46 } 47 localInterpolation() const48 const typename Traits::LocalInterpolationType& localInterpolation () const 49 { 50 return interpolation; 51 } 52 53 /** \brief Number of shape functions in this finite element */ size() const54 unsigned int size () const 55 { 56 return basis.size(); 57 } 58 type()59 static constexpr GeometryType type () 60 { 61 return GeometryTypes::quadrilateral; 62 } 63 64 private: 65 RT0Cube2DLocalBasis<D,R> basis; 66 RT0Cube2DLocalCoefficients coefficients; 67 RT0Cube2DLocalInterpolation<RT0Cube2DLocalBasis<D,R> > interpolation; 68 }; 69 } 70 #endif // DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS0_CUBE2D_LOCALFINITEELEMENT_HH 71