12#ifndef DUMUX_CVFE_LOCAL_DOF_HH
13#define DUMUX_CVFE_LOCAL_DOF_HH
25template<
class LocalIndex,
class Gr
idIndex>
34 LocalIndex
index()
const {
return index_; }
35 GridIndex
dofIndex()
const {
return dofIndex_; }
49template<
class FVElementGeometry>
50inline auto localDofs(
const FVElementGeometry& fvGeometry)
55 auto scvRange =
scvs(fvGeometry);
56 return std::ranges::transform_view(
57 std::ranges::subrange(scvRange.begin(), scvRange.end()),
59 return CVFE::LocalDof<LocalIndexType, GridIndexType>{
60 static_cast<LocalIndexType>(scv.localDofIndex()),
61 static_cast<GridIndexType>(scv.dofIndex()),
62 static_cast<GridIndexType>(scv.elementIndex())
69template<
class FVElementGeometry>
80template<
class FVElementGeometry,
class LocalDof>
81inline std::ranges::range
auto
82scvs(
const FVElementGeometry& fvGeometry,
const LocalDof& localDof)
84 assert(fvGeometry.numScv() > localDof.index());
85 return std::views::single(1) | std::views::transform(
86 [&](
const auto i) ->
const typename FVElementGeometry::SubControlVolume& {
return fvGeometry.scv(localDof.index()); }
GridIndex GridIndexType
Definition localdof.hh:30
GridIndex dofIndex() const
Definition localdof.hh:35
LocalIndex index() const
Definition localdof.hh:34
GridIndex elementIndex() const
Definition localdof.hh:36
LocalDof(LocalIndex index, GridIndex dofIndex, GridIndex eIdx)
Definition localdof.hh:32
LocalIndex LocalIndexType
Definition localdof.hh:29
Definition interpolate.hh:27
auto cvLocalDofs(const FVElementGeometry &fvGeometry)
range over control-volume local dofs
Definition localdof.hh:70
std::ranges::range auto scvs(const FVElementGeometry &fvGeometry, const LocalDof &localDof)
Definition localdof.hh:82
auto localDofs(const FVElementGeometry &fvGeometry)
range over local dofs
Definition localdof.hh:50
typename GridView::IndexSet::IndexType GridIndex
Definition indextraits.hh:27
unsigned int LocalIndex
Definition indextraits.hh:28