14#ifndef DUMUX_EXPERIMENTAL_FV_GRID_VARIABLES_HH
15#define DUMUX_EXPERIMENTAL_FV_GRID_VARIABLES_HH
35 using GridGeometry =
typename GV::GridGeometry;
36 using FVElementGeometry =
typename GridGeometry::LocalView;
38 using GridView =
typename GridGeometry::GridView;
39 using Element =
typename GridView::template Codim<0>::Entity;
41 using ElementVolumeVariables =
typename GV::GridVolumeVariables::LocalView;
42 using ElementFluxVariablesCache =
typename GV::GridFluxVariablesCache::LocalView;
60 void bind(
const Element& element,
61 const FVElementGeometry& fvGeometry)
64 elemVolVars_.bind(element, fvGeometry, x);
65 elemFluxVarsCache_.bind(element, fvGeometry, elemVolVars_);
74 const FVElementGeometry& fvGeometry)
76 elemVolVars_.bind(element, fvGeometry,
gridVariables().dofs());
83 const ElementVolumeVariables&
elemVolVars()
const {
return elemVolVars_; }
84 ElementVolumeVariables&
elemVolVars() {
return elemVolVars_; }
92 {
return *gridVariables_; }
96 ElementVolumeVariables elemVolVars_;
97 ElementFluxVariablesCache elemFluxVarsCache_;
109template<
class GVV,
class GFVC,
class X>
111:
public GridVariables<typename ProblemTraits<typename GVV::Problem>::GridGeometry, X>
113 using Problem =
typename GVV::Problem;
151 , gridVolVars_(*problem)
152 , gridFluxVarsCache_(*problem)
163 template<
class SolOrInitializer>
166 SolOrInitializer&& solOrInitializer)
168 , gridVolVars_(*problem)
169 , gridFluxVarsCache_(*problem)
172 gridFluxVarsCache_.update(this->
gridGeometry(), gridVolVars_, this->
dofs(),
true);
184 gridFluxVarsCache_.update(this->
gridGeometry(), gridVolVars_, curSol);
196 gridFluxVarsCache_.update(this->
gridGeometry(), gridVolVars_, curSol,
true);
201 {
return gridFluxVarsCache_; }
205 {
return gridFluxVarsCache_; }
209 {
return gridVolVars_; }
213 {
return gridVolVars_; }
The grid variable class for finite volume schemes, storing variables on scv and scvf (volume and flux...
Definition: experimental/discretization/fvgridvariables.hh:112
GG GridGeometry
export type of the finite volume grid geometry
Definition: experimental/discretization/fvgridvariables.hh:123
void update(const SolutionVector &curSol)
Update all variables that may be affected by a change in solution.
Definition: experimental/discretization/fvgridvariables.hh:176
typename GridVolumeVariables::VolumeVariables VolumeVariables
export type of the volume variables
Definition: experimental/discretization/fvgridvariables.hh:129
GridFluxVariablesCache & gridFluxVarsCache()
return the flux variables cache
Definition: experimental/discretization/fvgridvariables.hh:204
GFVC GridFluxVariablesCache
export cache type for flux variables
Definition: experimental/discretization/fvgridvariables.hh:135
void forceUpdateAll(const SolutionVector &curSol)
Force the update of all variables.
Definition: experimental/discretization/fvgridvariables.hh:188
GVV GridVolumeVariables
export type of the grid volume variables
Definition: experimental/discretization/fvgridvariables.hh:126
FVGridVariables(std::shared_ptr< Problem > problem, std::shared_ptr< const GridGeometry > gridGeometry)
Constructor.
Definition: experimental/discretization/fvgridvariables.hh:148
GridVolumeVariables & gridVolVars()
return the current volume variables
Definition: experimental/discretization/fvgridvariables.hh:212
const GridFluxVariablesCache & gridFluxVarsCache() const
return the flux variables cache
Definition: experimental/discretization/fvgridvariables.hh:200
const GridVolumeVariables & gridVolVars() const
return the current volume variables
Definition: experimental/discretization/fvgridvariables.hh:208
typename VolumeVariables::PrimaryVariables PrimaryVariables
export primary variable type
Definition: experimental/discretization/fvgridvariables.hh:132
FVGridVariables(std::shared_ptr< Problem > problem, std::shared_ptr< const GridGeometry > gridGeometry, SolOrInitializer &&solOrInitializer)
Constructor with custom initialization of the solution.
Definition: experimental/discretization/fvgridvariables.hh:164
Finite volume-specific local view on grid variables.
Definition: experimental/discretization/fvgridvariables.hh:34
GV GridVariables
export corresponding grid-wide class
Definition: experimental/discretization/fvgridvariables.hh:46
ElementVolumeVariables & elemVolVars()
Definition: experimental/discretization/fvgridvariables.hh:84
FVGridVariablesLocalView(const GridVariables &gridVariables)
Constructor.
Definition: experimental/discretization/fvgridvariables.hh:49
const ElementVolumeVariables & elemVolVars() const
return reference to the elem vol vars
Definition: experimental/discretization/fvgridvariables.hh:83
void bindElemVolVars(const Element &element, const FVElementGeometry &fvGeometry)
Bind only the volume variables local view to a grid element.
Definition: experimental/discretization/fvgridvariables.hh:73
ElementFluxVariablesCache & elemFluxVarsCache()
Definition: experimental/discretization/fvgridvariables.hh:88
const ElementFluxVariablesCache & elemFluxVarsCache() const
return reference to the flux variables cache
Definition: experimental/discretization/fvgridvariables.hh:87
void bind(const Element &element, const FVElementGeometry &fvGeometry)
Bind this local view to a grid element.
Definition: experimental/discretization/fvgridvariables.hh:60
const GridVariables & gridVariables() const
Return reference to the grid variables.
Definition: experimental/discretization/fvgridvariables.hh:91
Base class for grid variables.
Definition: experimental/discretization/gridvariables.hh:33
const GridGeometry & gridGeometry() const
Return a reference to the grid geometry.
Definition: experimental/discretization/gridvariables.hh:52
void update(const SolutionVector &x)
Update the state to a new solution.
Definition: variables.hh:98
const SolutionVector & dofs() const
Return reference to the solution.
Definition: variables.hh:92
X SolutionVector
export the type of solution vector
Definition: variables.hh:54
Type traits for problem classes.
Base class for grid variables.
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition: localview.hh:26
Free function to get the local view of a grid cache object.
Definition: experimental/assembly/cclocalassembler.hh:36
std::decay_t< decltype(std::declval< Problem >().gridGeometry())> GridGeometry
Definition: common/typetraits/problem.hh:33