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_BREZZIDOUGLASMARINI2_CUBE2D_LOCALCOEFFICIENTS_HH 4 #define DUNE_LOCALFUNCTIONS_BREZZIDOUGLASMARINI2_CUBE2D_LOCALCOEFFICIENTS_HH 5 6 #include <cstddef> 7 #include <vector> 8 9 #include "../../common/localkey.hh" 10 11 namespace Dune 12 { 13 14 /** 15 * \brief Layout map for Brezzi-Douglas-Marini-2 elements on quadrilaterals 16 * 17 * \ingroup LocalLayoutImplementation 18 * \nosubgrouping 19 * \implements Dune::LocalCoefficientsVirtualImp 20 */ 21 class BDM2Cube2DLocalCoefficients 22 { 23 24 public: 25 //! \brief Standard constructor BDM2Cube2DLocalCoefficients()26 BDM2Cube2DLocalCoefficients() : li(14) 27 { 28 for (std::size_t i = 0; i < 4; ++i) 29 { 30 li[3 * i] = LocalKey(i,1,0); 31 li[3 * i + 1] = LocalKey(i,1,1); 32 li[3 * i + 2] = LocalKey(i,1,2); 33 } 34 li[12] = LocalKey(0,0,0); 35 li[13] = LocalKey(0,0,1); 36 } 37 38 //! \brief number of coefficients size() const39 std::size_t size() const 40 { 41 return 14; 42 } 43 44 //! \brief get i'th index localKey(std::size_t i) const45 const LocalKey& localKey(std::size_t i) const 46 { 47 return li[i]; 48 } 49 50 private: 51 std::vector<LocalKey> li; 52 }; 53 } // end namespace Dune 54 #endif // DUNE_LOCALFUNCTIONS_BREZZIDOUGLASMARINI2_CUBE2D_LOCALCOEFFICIENTS_HH 55