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_RAVIARTTHOMAS02DLOCALFINITEELEMENT_HH 4 #define DUNE_RAVIARTTHOMAS02DLOCALFINITEELEMENT_HH 5 6 #include <dune/geometry/type.hh> 7 8 #include <dune/localfunctions/common/localfiniteelementtraits.hh> 9 #include "raviartthomas02d/raviartthomas02dlocalbasis.hh" 10 #include "raviartthomas02d/raviartthomas02dlocalcoefficients.hh" 11 #include "raviartthomas02d/raviartthomas02dlocalinterpolation.hh" 12 13 namespace Dune 14 { 15 16 /** 17 * \brief Zero order Raviart-Thomas shape functions on triangles. 18 * 19 * \ingroup RaviartThomas 20 * 21 * \tparam D Type to represent the field in the domain. 22 * \tparam R Type to represent the field in the range. 23 */ 24 template<class D, class R> 25 class 26 RT02DLocalFiniteElement 27 { 28 public: 29 typedef LocalFiniteElementTraits<RT02DLocalBasis<D,R>,RT02DLocalCoefficients, 30 RT02DLocalInterpolation<RT02DLocalBasis<D,R> > > Traits; 31 32 //! \brief Standard constructor RT02DLocalFiniteElement()33 RT02DLocalFiniteElement () 34 {} 35 36 /** 37 * \brief Constructor with explicitly given edge orientations 38 * 39 * \param s Edge orientation indicator 40 */ RT02DLocalFiniteElement(std::bitset<3> s)41 RT02DLocalFiniteElement (std::bitset<3> s) : 42 basis(s), 43 interpolation(s) 44 {} 45 localBasis() const46 const typename Traits::LocalBasisType& localBasis () const 47 { 48 return basis; 49 } 50 localCoefficients() const51 const typename Traits::LocalCoefficientsType& localCoefficients () const 52 { 53 return coefficients; 54 } 55 localInterpolation() const56 const typename Traits::LocalInterpolationType& localInterpolation () const 57 { 58 return interpolation; 59 } 60 size() const61 unsigned int size () const 62 { 63 return 3; 64 } 65 type()66 static constexpr GeometryType type () 67 { 68 return GeometryTypes::triangle; 69 } 70 71 private: 72 RT02DLocalBasis<D,R> basis; 73 RT02DLocalCoefficients coefficients; 74 RT02DLocalInterpolation<RT02DLocalBasis<D,R> > interpolation; 75 }; 76 77 } 78 79 #endif 80