17#ifndef DUMUX_DISCRETIZATION_PQ2_DOF_HELPER_HH
18#define DUMUX_DISCRETIZATION_PQ2_DOF_HELPER_HH
20#include <dune/common/fvector.hh>
21#include <dune/geometry/referenceelements.hh>
34template<
class Gr
idView>
37 using Scalar =
typename GridView::ctype;
38 static constexpr int dim = GridView::dimension;
43 template<
class DofMapper,
class Element,
class LocalKey,
class IdSet>
44 static std::size_t
dofIndex(
const DofMapper& m,
const Element& e,
45 const LocalKey& lk,
const IdSet& )
46 {
return m.subIndex(e, lk.subEntity(), lk.codim()); }
49 template<
class DofMapper,
class Element,
class LocalKey>
50 static std::size_t
dofIndex(
const DofMapper& m,
const Element& e,
const LocalKey& lk)
51 {
return m.subIndex(e, lk.subEntity(), lk.codim()); }
54 template<
class Geometry,
class LocalKey>
57 if (lk.codim() ==
dim)
return geo.corner(lk.subEntity());
58 if (lk.codim() == 0)
return geo.center();
59 const auto& ref = Dune::referenceElement<Scalar, dim>(geo.type());
60 return geo.global(ref.position(lk.subEntity(), lk.codim()));
DOF index and position helper for order-2 Lagrange discretizations.
Definition pq2/dofhelper.hh:36
Dune::FieldVector< Scalar, GridView::dimensionworld > GlobalPosition
Definition pq2/dofhelper.hh:39
typename GridView::ctype Scalar
Definition pq2/dofhelper.hh:37
static constexpr int dim
Definition pq2/dofhelper.hh:38
static std::size_t dofIndex(const DofMapper &m, const Element &e, const LocalKey &lk, const IdSet &)
Definition pq2/dofhelper.hh:44
static GlobalPosition dofPosition(const Geometry &geo, const LocalKey &lk)
Physical position of the DOF in global coordinates.
Definition pq2/dofhelper.hh:55
static std::size_t dofIndex(const DofMapper &m, const Element &e, const LocalKey &lk)
Global DOF index for the given local key (3-argument overload, no id-set).
Definition pq2/dofhelper.hh:50