24#ifndef DUMUX_DISCRETIZATION_FACECENTERED_GRID_VOLUMEVARIABLES_HH
25#define DUMUX_DISCRETIZATION_FACECENTERED_GRID_VOLUMEVARIABLES_HH
37template<
class P,
class VV>
43 template<
class Gr
idVolumeVariables,
bool cachingEnabled>
54template<
class Traits,
bool cachingEnabled = false>
71 static constexpr bool cachingEnabled =
true;
78 template<
class Gr
idGeometry,
class SolutionVector>
79 void update(
const GridGeometry& gridGeometry,
const SolutionVector& sol)
81 const auto numScv = gridGeometry.numScv();
82 volumeVariables_.resize(numScv);
84 for (
const auto& element : elements(gridGeometry.gridView()))
86 auto fvGeometry =
localView(gridGeometry);
87 fvGeometry.bindElement(element);
89 for (
auto&& scv : scvs(fvGeometry))
92 volumeVariables_[scv.index()].update(elemSol, problem(), element, scv);
98 {
return volumeVariables_[scvIdx]; }
101 {
return volumeVariables_[scvIdx]; }
103 template<class SubControlVolume, typename std::enable_if_t<!std::is_integral<SubControlVolume>::value,
int> = 0>
105 {
return volumeVariables_[scv.index()]; }
107 template<class SubControlVolume, typename std::enable_if_t<!std::is_integral<SubControlVolume>::value,
int> = 0>
109 {
return volumeVariables_[scv.index()]; }
113 {
return volumeVariables_[scvIdx]; }
117 {
return volumeVariables_[scvIdx]; }
121 {
return *problemPtr_; }
124 const Problem* problemPtr_;
125 std::vector<VolumeVariables> volumeVariables_;
130template<
class Traits>
143 static constexpr bool cachingEnabled =
false;
150 template<
class Gr
idGeometry,
class SolutionVector>
151 void update(
const GridGeometry& gridGeometry,
const SolutionVector& sol) {}
155 {
return *problemPtr_;}
158 const Problem* problemPtr_;
Free function to get the local view of a grid cache object.
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition: localview.hh:38
auto elementSolution(const Element &element, const SolutionVector &sol, const GridGeometry &gg) -> std::enable_if_t< GridGeometry::discMethod==DiscretizationMethods::box, BoxElementSolution< typename GridGeometry::LocalView, std::decay_t< decltype(std::declval< SolutionVector >()[0])> > >
Make an element solution for box schemes.
Definition: box/elementsolution.hh:118
Base class for the face variables vector.
Definition: facecentered/staggered/elementvolumevariables.hh:41
Definition: facecentered/staggered/gridvolumevariables.hh:39
P Problem
Definition: facecentered/staggered/gridvolumevariables.hh:40
VV VolumeVariables
Definition: facecentered/staggered/gridvolumevariables.hh:41
Base class for the grid volume variables.
Definition: facecentered/staggered/gridvolumevariables.hh:55
specialization in case of storing the volume variables
Definition: facecentered/staggered/gridvolumevariables.hh:60
void update(const GridGeometry &gridGeometry, const SolutionVector &sol)
Definition: facecentered/staggered/gridvolumevariables.hh:79
FaceCenteredStaggeredGridVolumeVariables(const Problem &problem)
Definition: facecentered/staggered/gridvolumevariables.hh:76
VolumeVariables & volVars(const std::size_t scvIdx, const std::size_t localIdx)
Definition: facecentered/staggered/gridvolumevariables.hh:116
const VolumeVariables & volVars(const std::size_t scvIdx) const
Definition: facecentered/staggered/gridvolumevariables.hh:97
typename Traits::Problem Problem
export the problem type
Definition: facecentered/staggered/gridvolumevariables.hh:65
const VolumeVariables & volVars(const SubControlVolume scv) const
Definition: facecentered/staggered/gridvolumevariables.hh:104
typename Traits::VolumeVariables VolumeVariables
export the volume variables type
Definition: facecentered/staggered/gridvolumevariables.hh:68
VolumeVariables & volVars(const SubControlVolume scv)
Definition: facecentered/staggered/gridvolumevariables.hh:108
VolumeVariables & volVars(const std::size_t scvIdx)
Definition: facecentered/staggered/gridvolumevariables.hh:100
typename Traits::template LocalView< ThisType, cachingEnabled > LocalView
export the type of the local view
Definition: facecentered/staggered/gridvolumevariables.hh:74
const Problem & problem() const
The problem we are solving.
Definition: facecentered/staggered/gridvolumevariables.hh:120
const VolumeVariables & volVars(const std::size_t scvIdx, const std::size_t localIdx) const
Definition: facecentered/staggered/gridvolumevariables.hh:112
Specialization when the current volume variables are not stored globally.
Definition: facecentered/staggered/gridvolumevariables.hh:132
FaceCenteredStaggeredGridVolumeVariables(const Problem &problem)
Definition: facecentered/staggered/gridvolumevariables.hh:148
typename Traits::VolumeVariables VolumeVariables
export the volume variables type
Definition: facecentered/staggered/gridvolumevariables.hh:140
typename Traits::template LocalView< ThisType, cachingEnabled > LocalView
export the type of the local view
Definition: facecentered/staggered/gridvolumevariables.hh:146
typename Traits::Problem Problem
export the problem type
Definition: facecentered/staggered/gridvolumevariables.hh:137
void update(const GridGeometry &gridGeometry, const SolutionVector &sol)
Definition: facecentered/staggered/gridvolumevariables.hh:151
const Problem & problem() const
The problem we are solving.
Definition: facecentered/staggered/gridvolumevariables.hh:154