24#ifndef DUMUX_DISCRETIZATION_FACECENTERED_STAGGERED_GRID_FLUXVARSCACHE_HH
25#define DUMUX_DISCRETIZATION_FACECENTERED_STAGGERED_GRID_FLUXVARSCACHE_HH
39template<
class P,
class FVC,
class FVCF>
46 template<
class Gr
idFluxVariablesCache,
bool cachingEnabled>
55template<
class Problem,
56 class FluxVariablesCache,
57 class FluxVariablesCacheFiller,
58 bool cachingEnabled =
false,
67template<
class P,
class FVC,
class FVCF,
class Traits>
70 using Problem =
typename Traits::Problem;
72 using FluxVariablesCacheFiller =
typename Traits::FluxVariablesCacheFiller;
79 static constexpr bool cachingEnabled =
true;
87 template<
class Gr
idGeometry,
class Gr
idVolumeVariables,
class SolutionVector>
88 void update(
const GridGeometry& gridGeometry,
89 const GridVolumeVariables& gridVolVars,
90 const SolutionVector& sol,
91 bool forceUpdate =
false)
94 if (FluxVariablesCacheFiller::isSolDependent || forceUpdate)
97 FluxVariablesCacheFiller filler(problem());
99 fluxVarsCache_.resize(gridGeometry.numScvf());
104 const auto element = gridGeometry.element(eIdx);
105 const auto fvGeometry = localView(gridGeometry).bind(element);
106 const auto elemVolVars = localView(gridVolVars).bind(element, fvGeometry, sol);
108 for (auto&& scvf : scvfs(fvGeometry))
110 filler.fill(*this, fluxVarsCache_[scvf.index()], element, fvGeometry, elemVolVars, scvf, forceUpdate);
117 {
return *problemPtr_; }
119 template<
class SubControlVolumeFace>
121 {
return fluxVarsCache_[scvf.index()]; }
123 template<
class SubControlVolumeFace>
125 {
return fluxVarsCache_[scvf.index()]; }
129 const Problem* problemPtr_;
130 std::vector<FluxVariablesCache> fluxVarsCache_;
137template<
class P,
class FVC,
class FVCF,
class Traits>
140 using Problem =
typename Traits::Problem;
148 static constexpr bool cachingEnabled =
false;
155 template<
class Gr
idGeometry,
class Gr
idVolumeVariables,
class SolutionVector>
156 void update(
const GridGeometry& gridGeometry,
157 const GridVolumeVariables& gridVolVars,
158 const SolutionVector& sol,
159 bool forceUpdate =
false) {}
162 {
return *problemPtr_; }
165 const Problem* problemPtr_;
Free function to get the local view of a grid cache object.
Parallel for loop (multithreading)
void parallelFor(const std::size_t count, const FunctorType &functor)
A parallel for loop (multithreading)
Definition: parallel_for.hh:172
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
The flux variables caches for an element.
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:42
Flux variable caches traits.
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:41
FVCF FluxVariablesCacheFiller
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:44
P Problem
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:42
FVC FluxVariablesCache
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:43
Flux variable caches on a gridview.
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:60
Flux variable caches on a gridview with grid caching enabled.
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:69
typename Traits::FluxVariablesCache FluxVariablesCache
export the flux variable cache type
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:76
typename Traits::template LocalView< ThisType, cachingEnabled > LocalView
export the type of the local view
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:82
void update(const GridGeometry &gridGeometry, const GridVolumeVariables &gridVolVars, const SolutionVector &sol, bool forceUpdate=false)
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:88
const Problem & problem() const
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:116
FaceCenteredStaggeredGridFluxVariablesCache(const Problem &problem)
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:84
Flux variable caches on a gridview with grid caching disabled.
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:139
typename Traits::FluxVariablesCache FluxVariablesCache
export the flux variable cache type
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:145
void update(const GridGeometry &gridGeometry, const GridVolumeVariables &gridVolVars, const SolutionVector &sol, bool forceUpdate=false)
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:156
const Problem & problem() const
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:161
FaceCenteredStaggeredGridFluxVariablesCache(const Problem &problem)
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:153
typename Traits::template LocalView< ThisType, cachingEnabled > LocalView
export the type of the local view
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:151
Global flux variable cache.