24#ifndef DUMUX_DISCRETIZATION_CC_GRID_VOLUMEVARIABLES_HH
25#define DUMUX_DISCRETIZATION_CC_GRID_VOLUMEVARIABLES_HH
43template<
class Traits,
bool cachingEnabled = false>
60 static constexpr bool cachingEnabled =
true;
67 template<
class Gr
idGeometry,
class SolutionVector>
68 void update(
const GridGeometry& gridGeometry,
const SolutionVector& sol)
70 const auto numScv = gridGeometry.numScv();
71 volumeVariables_.resize(numScv);
72 auto fvGeometry =
localView(gridGeometry);
73 for (
const auto& element : elements(gridGeometry.gridView()))
75 fvGeometry.bindElement(element);
76 for (
auto&& scv : scvs(fvGeometry))
79 volumeVariables_[scv.dofIndex()].update(elemSol, problem(), element, scv);
85 {
return volumeVariables_[scvIdx]; }
88 {
return volumeVariables_[scvIdx]; }
90 template<class SubControlVolume, typename std::enable_if_t<!std::is_integral<SubControlVolume>::value,
int> = 0>
92 {
return volumeVariables_[scv.dofIndex()]; }
94 template<class SubControlVolume, typename std::enable_if_t<!std::is_integral<SubControlVolume>::value,
int> = 0>
96 {
return volumeVariables_[scv.dofIndex()]; }
100 {
return volumeVariables_[scvIdx]; }
104 {
return volumeVariables_[scvIdx]; }
108 {
return *problemPtr_; }
111 const Problem* problemPtr_;
112 std::vector<VolumeVariables> volumeVariables_;
117template<
class Traits>
130 static constexpr bool cachingEnabled =
false;
137 template<
class Gr
idGeometry,
class SolutionVector>
138 void update(
const GridGeometry& gridGeometry,
const SolutionVector& sol) {}
142 {
return *problemPtr_;}
145 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 grid volume variables.
Definition: cellcentered/gridvolumevariables.hh:44
specialization in case of storing the volume variables
Definition: cellcentered/gridvolumevariables.hh:49
void update(const GridGeometry &gridGeometry, const SolutionVector &sol)
Definition: cellcentered/gridvolumevariables.hh:68
VolumeVariables & volVars(const std::size_t scvIdx)
Definition: cellcentered/gridvolumevariables.hh:87
typename Traits::template LocalView< ThisType, cachingEnabled > LocalView
export the type of the local view
Definition: cellcentered/gridvolumevariables.hh:63
VolumeVariables & volVars(const SubControlVolume &scv)
Definition: cellcentered/gridvolumevariables.hh:95
const Problem & problem() const
The problem we are solving.
Definition: cellcentered/gridvolumevariables.hh:107
const VolumeVariables & volVars(const std::size_t scvIdx, const std::size_t localIdx) const
Definition: cellcentered/gridvolumevariables.hh:99
const VolumeVariables & volVars(const std::size_t scvIdx) const
Definition: cellcentered/gridvolumevariables.hh:84
typename Traits::Problem Problem
export the problem type
Definition: cellcentered/gridvolumevariables.hh:54
const VolumeVariables & volVars(const SubControlVolume &scv) const
Definition: cellcentered/gridvolumevariables.hh:91
typename Traits::VolumeVariables VolumeVariables
export the volume variables type
Definition: cellcentered/gridvolumevariables.hh:57
CCGridVolumeVariables(const Problem &problem)
Definition: cellcentered/gridvolumevariables.hh:65
VolumeVariables & volVars(const std::size_t scvIdx, const std::size_t localIdx)
Definition: cellcentered/gridvolumevariables.hh:103
Specialization when the current volume variables are not stored globally.
Definition: cellcentered/gridvolumevariables.hh:119
typename Traits::VolumeVariables VolumeVariables
export the volume variables type
Definition: cellcentered/gridvolumevariables.hh:127
CCGridVolumeVariables(const Problem &problem)
Definition: cellcentered/gridvolumevariables.hh:135
typename Traits::Problem Problem
export the problem type
Definition: cellcentered/gridvolumevariables.hh:124
const Problem & problem() const
The problem we are solving.
Definition: cellcentered/gridvolumevariables.hh:141
void update(const GridGeometry &gridGeometry, const SolutionVector &sol)
Definition: cellcentered/gridvolumevariables.hh:138
typename Traits::template LocalView< ThisType, cachingEnabled > LocalView
export the type of the local view
Definition: cellcentered/gridvolumevariables.hh:133
The local element solution class for cell-centered methods.