12#ifndef DUMUX_DISCRETIZATION_FACECENTERED_STAGGERED_ELEMENT_FLUXVARSCACHE_HH
13#define DUMUX_DISCRETIZATION_FACECENTERED_STAGGERED_ELEMENT_FLUXVARSCACHE_HH
29template<
class GFVC,
bool cachingEnabled>
47 : gridFluxVarsCachePtr_(&global) {}
54 template<
class FVElementGeometry,
class ElementVolumeVariables>
56 const FVElementGeometry& fvGeometry,
57 const ElementVolumeVariables& elemVolVars) &&
59 this->bind(element, fvGeometry, elemVolVars);
60 return std::move(*
this);
65 template<
class FVElementGeometry,
class ElementVolumeVariables>
66 void bind(
const typename FVElementGeometry::Element& element,
67 const FVElementGeometry& fvGeometry,
68 const ElementVolumeVariables& elemVolVars) &
70 bindElement(element, fvGeometry, elemVolVars);
78 template<
class FVElementGeometry,
class ElementVolumeVariables>
80 const FVElementGeometry& fvGeometry,
81 const ElementVolumeVariables& elemVolVars) &&
83 this->bindElement(element, fvGeometry, elemVolVars);
84 return std::move(*
this);
87 template<
class FVElementGeometry,
class ElementVolumeVariables>
88 void bindElement(
const typename FVElementGeometry::Element& element,
89 const FVElementGeometry& fvGeometry,
90 const ElementVolumeVariables& elemVolVars) &
92 eIdx_ = fvGeometry.gridGeometry().elementMapper().index(element);
100 template<
class FVElementGeometry,
class ElementVolumeVariables>
102 const FVElementGeometry& fvGeometry,
103 const ElementVolumeVariables& elemVolVars,
104 const typename FVElementGeometry::SubControlVolumeFace& scvf) &&
106 this->bindScvf(element, fvGeometry, elemVolVars, scvf);
107 return std::move(*
this);
110 template<
class FVElementGeometry,
class ElementVolumeVariables>
111 void bindScvf(
const typename FVElementGeometry::Element& element,
112 const FVElementGeometry& fvGeometry,
113 const ElementVolumeVariables& elemVolVars,
114 const typename FVElementGeometry::SubControlVolumeFace& scvf) &
116 bindElement(element, fvGeometry, elemVolVars);
120 template<
class SubControlVolumeFace>
122 {
return gridFluxVarsCache()[scvf]; }
126 {
return *gridFluxVarsCachePtr_; }
129 const GridFluxVariablesCache* gridFluxVarsCachePtr_;
148 : gridFluxVarsCachePtr_(&global) {}
155 template<
class FVElementGeometry,
class ElementVolumeVariables>
157 const FVElementGeometry& fvGeometry,
158 const ElementVolumeVariables& elemVolVars) &&
160 this->bind(element, fvGeometry, elemVolVars);
161 return std::move(*
this);
166 template<
class FVElementGeometry,
class ElementVolumeVariables>
167 void bind(
const typename FVElementGeometry::Element& element,
168 const FVElementGeometry& fvGeometry,
169 const ElementVolumeVariables& elemVolVars) &
171 bindElement(element, fvGeometry, elemVolVars);
179 template<
class FVElementGeometry,
class ElementVolumeVariables>
181 const FVElementGeometry& fvGeometry,
182 const ElementVolumeVariables& elemVolVars) &&
184 this->bindElement(element, fvGeometry, elemVolVars);
185 return std::move(*
this);
188 template<
class FVElementGeometry,
class ElementVolumeVariables>
189 void bindElement(
const typename FVElementGeometry::Element& element,
190 const FVElementGeometry& fvGeometry,
191 const ElementVolumeVariables& elemVolVars) &
194 fluxVarsCache_.resize(fvGeometry.numScvf());
204 template<
class FVElementGeometry,
class ElementVolumeVariables>
206 const FVElementGeometry& fvGeometry,
207 const ElementVolumeVariables& elemVolVars,
208 const typename FVElementGeometry::SubControlVolumeFace& scvf) &&
210 this->bindScvf(element, fvGeometry, elemVolVars, scvf);
211 return std::move(*
this);
214 template<
class FVElementGeometry,
class ElementVolumeVariables>
215 void bindScvf(
const typename FVElementGeometry::Element& element,
216 const FVElementGeometry& fvGeometry,
217 const ElementVolumeVariables& elemVolVars,
218 const typename FVElementGeometry::SubControlVolumeFace& scvf) &
220 fluxVarsCache_.resize(fvGeometry.numScvf());
225 template<
class SubControlVolumeFace>
227 {
return fluxVarsCache_[scvf.index()]; }
230 template<
class SubControlVolumeFace>
232 {
return fluxVarsCache_[scvf.index()]; }
236 {
return *gridFluxVarsCachePtr_; }
239 const GridFluxVariablesCache* gridFluxVarsCachePtr_;
240 std::vector<FluxVariablesCache> fluxVarsCache_;
FaceCenteredStaggeredElementFluxVariablesCache bindScvf(const typename FVElementGeometry::Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const typename FVElementGeometry::SubControlVolumeFace &scvf) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:205
FaceCenteredStaggeredElementFluxVariablesCache bind(const typename FVElementGeometry::Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:156
void bindScvf(const typename FVElementGeometry::Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const typename FVElementGeometry::SubControlVolumeFace &scvf) &
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:215
void bindElement(const typename FVElementGeometry::Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars) &
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:189
const GridFluxVariablesCache & gridFluxVarsCache() const
The global object we are a restriction of.
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:235
FaceCenteredStaggeredElementFluxVariablesCache(const GridFluxVariablesCache &global)
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:147
GFVC GridFluxVariablesCache
export the type of the grid flux variables cache
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:142
void bind(const typename FVElementGeometry::Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars) &
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:167
typename GFVC::FluxVariablesCache FluxVariablesCache
export the type of the flux variables cache
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:145
FaceCenteredStaggeredElementFluxVariablesCache bindElement(const typename FVElementGeometry::Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:180
GFVC GridFluxVariablesCache
export the type of the grid flux variables cache
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:41
FaceCenteredStaggeredElementFluxVariablesCache(const GridFluxVariablesCache &global)
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:46
typename GFVC::FluxVariablesCache FluxVariablesCache
export the type of the flux variables cache
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:44
void bindElement(const typename FVElementGeometry::Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars) &
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:88
const GridFluxVariablesCache & gridFluxVarsCache() const
The global object we are a restriction of.
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:125
FaceCenteredStaggeredElementFluxVariablesCache bind(const typename FVElementGeometry::Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:55
void bind(const typename FVElementGeometry::Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars) &
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:66
FaceCenteredStaggeredElementFluxVariablesCache bindElement(const typename FVElementGeometry::Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:79
FaceCenteredStaggeredElementFluxVariablesCache bindScvf(const typename FVElementGeometry::Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const typename FVElementGeometry::SubControlVolumeFace &scvf) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:101
void bindScvf(const typename FVElementGeometry::Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const typename FVElementGeometry::SubControlVolumeFace &scvf) &
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:111
The flux variables caches for an element.
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:30