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;
64 using FluxVariablesCache =
typename Traits::FluxVariablesCache;
67 static constexpr bool cachingEnabled =
true;
70 using LocalView =
typename Traits::template LocalView<ThisType, cachingEnabled>;
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);
104 const Problem& problem()
const
105 {
return *problemPtr_; }
107 template<
class SubControlVolumeFace>
108 const FluxVariablesCache& operator [](
const SubControlVolumeFace& scvf)
const
109 {
return fluxVarsCache_[scvf.index()]; }
111 template<
class SubControlVolumeFace>
112 FluxVariablesCache& operator [](
const SubControlVolumeFace& scvf)
113 {
return fluxVarsCache_[scvf.index()]; }
117 const Problem* problemPtr_;
118 std::vector<FluxVariablesCache> fluxVarsCache_;
125template<
class P,
class FVC,
class FVCF,
class Traits>
126class FaceCenteredStaggeredGridFluxVariablesCache<P, FVC, FVCF, false, Traits>
128 using Problem =
typename Traits::Problem;
129 using ThisType = FaceCenteredStaggeredGridFluxVariablesCache<P, FVC, FVCF, false, Traits>;
133 using FluxVariablesCache =
typename Traits::FluxVariablesCache;
136 static constexpr bool cachingEnabled =
false;
139 using LocalView =
typename Traits::template LocalView<ThisType, cachingEnabled>;
141 FaceCenteredStaggeredGridFluxVariablesCache(
const Problem& problem) : problemPtr_(&problem) {}
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) {}
149 const Problem& problem()
const
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.
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
FaceCenteredStaggeredElementFluxVariablesCache< GridFluxVariablesCache, cachingEnabled > LocalView
Definition discretization/facecentered/staggered/gridfluxvariablescache.hh:35
FVC FluxVariablesCache
Definition discretization/facecentered/staggered/gridfluxvariablescache.hh:31