12#ifndef DUMUX_DISCRETIZATION_FACECENTERED_STAGGERED_GRID_FLUXVARSCACHE_HH
13#define DUMUX_DISCRETIZATION_FACECENTERED_STAGGERED_GRID_FLUXVARSCACHE_HH
27template<
class P,
class FVC,
class FVCF>
34 template<
class Gr
idFluxVariablesCache,
bool cachingEnabled>
43template<
class Problem,
44 class FluxVariablesCache,
45 class FluxVariablesCacheFiller,
46 bool cachingEnabled =
false,
55template<
class P,
class FVC,
class FVCF,
class Traits>
58 using Problem =
typename Traits::Problem;
60 using FluxVariablesCacheFiller =
typename Traits::FluxVariablesCacheFiller;
67 static constexpr bool cachingEnabled =
true;
75 template<
class Gr
idGeometry,
class Gr
idVolumeVariables,
class SolutionVector>
76 void update(
const GridGeometry& gridGeometry,
77 const GridVolumeVariables& gridVolVars,
78 const SolutionVector& sol,
79 bool forceUpdate =
false)
82 if (FluxVariablesCacheFiller::isSolDependent || forceUpdate)
85 FluxVariablesCacheFiller filler(problem());
87 fluxVarsCache_.resize(gridGeometry.numScvf());
92 const auto element = gridGeometry.element(eIdx);
93 const auto fvGeometry = localView(gridGeometry).bind(element);
94 const auto elemVolVars = localView(gridVolVars).bind(element, fvGeometry, sol);
96 for (auto&& scvf : scvfs(fvGeometry))
98 filler.fill(*this, fluxVarsCache_[scvf.index()], element, fvGeometry, elemVolVars, scvf, forceUpdate);
105 {
return *problemPtr_; }
107 template<
class SubControlVolumeFace>
109 {
return fluxVarsCache_[scvf.index()]; }
111 template<
class SubControlVolumeFace>
113 {
return fluxVarsCache_[scvf.index()]; }
117 const Problem* problemPtr_;
118 std::vector<FluxVariablesCache> fluxVarsCache_;
125template<
class P,
class FVC,
class FVCF,
class Traits>
128 using Problem =
typename Traits::Problem;
136 static constexpr bool cachingEnabled =
false;
143 template<
class Gr
idGeometry,
class Gr
idVolumeVariables,
class SolutionVector>
144 void update(
const GridGeometry& gridGeometry,
145 const GridVolumeVariables& gridVolVars,
146 const SolutionVector& sol,
147 bool forceUpdate =
false) {}
150 {
return *problemPtr_; }
153 const Problem* problemPtr_;
The flux variables caches for an element.
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:30
Flux variable caches on a gridview with grid caching disabled.
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:127
typename Traits::FluxVariablesCache FluxVariablesCache
export the flux variable cache type
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:133
void update(const GridGeometry &gridGeometry, const GridVolumeVariables &gridVolVars, const SolutionVector &sol, bool forceUpdate=false)
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:144
const Problem & problem() const
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:149
FaceCenteredStaggeredGridFluxVariablesCache(const Problem &problem)
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:141
typename Traits::template LocalView< ThisType, cachingEnabled > LocalView
export the type of the local view
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:139
Flux variable caches on a gridview with grid caching enabled.
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:57
typename Traits::FluxVariablesCache FluxVariablesCache
export the flux variable cache type
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:64
typename Traits::template LocalView< ThisType, cachingEnabled > LocalView
export the type of the local view
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:70
void update(const GridGeometry &gridGeometry, const GridVolumeVariables &gridVolVars, const SolutionVector &sol, bool forceUpdate=false)
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:76
const Problem & problem() const
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:104
FaceCenteredStaggeredGridFluxVariablesCache(const Problem &problem)
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:72
Flux variable caches on a gridview.
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:48
Global flux variable cache.
void parallelFor(const std::size_t count, const FunctorType &functor)
A parallel for loop (multithreading)
Definition: parallel_for.hh:160
Free function to get the local view of a grid cache object.
Parallel for loop (multithreading)
Flux variable caches traits.
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:29
FVCF FluxVariablesCacheFiller
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:32
P Problem
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:30
FVC FluxVariablesCache
Definition: discretization/facecentered/staggered/gridfluxvariablescache.hh:31