24#ifndef DUMUX_FV_GRID_VARIABLES_HH
25#define DUMUX_FV_GRID_VARIABLES_HH
40template<
class GG,
class GVV,
class GFVC>
57 using Scalar = std::decay_t<decltype(std::declval<PrimaryVariables>()[0])>;
62 template<
class Problem>
66 , curGridVolVars_(*problem)
67 , prevGridVolVars_(*problem)
68 , gridFluxVarsCache_(*problem)
72 template<
class SolutionVector>
73 void init(
const SolutionVector& curSol)
79 gridFluxVarsCache_.update(*
gridGeometry_, curGridVolVars_, curSol,
true);
85 prevGridVolVars_ = curGridVolVars_;
89 template<
class SolutionVector>
90 void update(
const SolutionVector& curSol,
bool forceFluxCacheUpdate =
false)
96 gridFluxVarsCache_.update(*
gridGeometry_, curGridVolVars_, curSol, forceFluxCacheUpdate);
100 template<
class SolutionVector>
108 prevGridVolVars_ = curGridVolVars_;
117 prevGridVolVars_ = curGridVolVars_;
121 template<
class SolutionVector>
125 curGridVolVars_ = prevGridVolVars_;
128 gridFluxVarsCache_.update(*
gridGeometry_, curGridVolVars_, solution);
133 {
return gridFluxVarsCache_; }
137 {
return gridFluxVarsCache_; }
141 {
return curGridVolVars_; }
145 {
return curGridVolVars_; }
149 {
return prevGridVolVars_; }
153 {
return prevGridVolVars_; }
The grid variable class for finite volume schemes storing variables on scv and scvf (volume and flux ...
Definition: discretization/fvgridvariables.hh:42
GridVolumeVariables & curGridVolVars()
return the current volume variables
Definition: discretization/fvgridvariables.hh:144
const GridFluxVariablesCache & gridFluxVarsCache() const
return the flux variables cache
Definition: discretization/fvgridvariables.hh:132
GG GridGeometry
export type of the finite volume grid geometry
Definition: discretization/fvgridvariables.hh:45
typename VolumeVariables::PrimaryVariables PrimaryVariables
export primary variable type
Definition: discretization/fvgridvariables.hh:54
std::shared_ptr< const GridGeometry > gridGeometry_
pointer to the constant grid geometry
Definition: discretization/fvgridvariables.hh:161
const GridVolumeVariables & curGridVolVars() const
return the current volume variables
Definition: discretization/fvgridvariables.hh:140
void advanceTimeStep()
Sets the current state as the previous for next time step.
Definition: discretization/fvgridvariables.hh:115
GVV GridVolumeVariables
export type of the finite volume grid geometry
Definition: discretization/fvgridvariables.hh:48
GridFluxVariablesCache & gridFluxVarsCache()
return the flux variables cache
Definition: discretization/fvgridvariables.hh:136
void init(const SolutionVector &curSol)
initialize all variables (stationary case)
Definition: discretization/fvgridvariables.hh:73
const GridVolumeVariables & prevGridVolVars() const
return the volume variables of the previous time step (for instationary problems)
Definition: discretization/fvgridvariables.hh:148
const GridGeometry & gridGeometry() const
return the finite volume grid geometry
Definition: discretization/fvgridvariables.hh:156
GridVolumeVariables & prevGridVolVars()
return the volume variables of the previous time step (for instationary problems)
Definition: discretization/fvgridvariables.hh:152
typename GridVolumeVariables::VolumeVariables VolumeVariables
export type of the volume variables
Definition: discretization/fvgridvariables.hh:51
GFVC GridFluxVariablesCache
export type of the finite volume grid geometry
Definition: discretization/fvgridvariables.hh:60
void updateAfterGridAdaption(const SolutionVector &curSol)
update all variables after grid adaption
Definition: discretization/fvgridvariables.hh:101
void resetTimeStep(const SolutionVector &solution)
resets state to the one before time integration
Definition: discretization/fvgridvariables.hh:122
FVGridVariables(std::shared_ptr< Problem > problem, std::shared_ptr< const GridGeometry > gridGeometry)
Definition: discretization/fvgridvariables.hh:63
std::decay_t< decltype(std::declval< PrimaryVariables >()[0])> Scalar
export scalar type (TODO get it directly from the volvars)
Definition: discretization/fvgridvariables.hh:57
void update(const SolutionVector &curSol, bool forceFluxCacheUpdate=false)
update all variables
Definition: discretization/fvgridvariables.hh:90