12#ifndef DUMUX_DISCRETIZATION_STAGGERED_FACE_SOLUTION_HH
13#define DUMUX_DISCRETIZATION_STAGGERED_FACE_SOLUTION_HH
26template<
class FaceSolutionVector>
29 using FacePrimaryVariables = std::decay_t<decltype(std::declval<FaceSolutionVector>()[0])>;
33 template<
class SubControlVolumeFace,
class Gr
idGeometry>
35 const GridGeometry& gridGeometry)
38 const auto& connectivityMap = gridGeometry.connectivityMap();
39 const auto& stencil = connectivityMap(GridGeometry::faceIdx(), GridGeometry::faceIdx(), scvf.index());
41 facePriVars_.reserve(stencil.size()+1);
42 map_.reserve(stencil.size()+1);
44 map_.push_back(scvf.dofIndex());
45 facePriVars_.push_back(sol[scvf.dofIndex()]);
46 for(
const auto dofJ : stencil)
49 facePriVars_.push_back(sol[dofJ]);
54 template<
typename IndexType>
55 const FacePrimaryVariables&
operator [](IndexType globalFaceDofIdx)
const
57 const auto pos = std::find(map_.begin(), map_.end(), globalFaceDofIdx);
58 assert (pos != map_.end());
59 return facePriVars_[pos - map_.begin()];
63 template<
typename IndexType>
66 const auto pos = std::find(map_.begin(), map_.end(), globalFaceDofIdx);
67 assert (pos != map_.end());
68 return facePriVars_[pos - map_.begin()];
73 std::vector<FacePrimaryVariables> facePriVars_;
74 std::vector<unsigned int> map_;
The global face variables class for staggered models.
Definition: facesolution.hh:28
const FacePrimaryVariables & operator[](IndexType globalFaceDofIdx) const
bracket operator const access
Definition: facesolution.hh:55
StaggeredFaceSolution(const SubControlVolumeFace &scvf, const FaceSolutionVector &sol, const GridGeometry &gridGeometry)
Definition: facesolution.hh:34