3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
cellcentered/mpfa/elementfluxvariablescache.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*****************************************************************************
4 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
24#ifndef DUMUX_DISCRETIZATION_CCMPFA_ELEMENT_FLUXVARSCACHE_HH
25#define DUMUX_DISCRETIZATION_CCMPFA_ELEMENT_FLUXVARSCACHE_HH
26
27#include <algorithm>
28#include <cassert>
29#include <type_traits>
30#include <vector>
31
32#include <dune/common/exceptions.hh>
33
34namespace Dumux {
35
40template<class PrimaryIV, class PrimaryIVDataHandle,
41 class SecondaryIV, class SecondaryIVDataHandle>
43{
44 std::vector<PrimaryIV> primaryInteractionVolumes;
45 std::vector<SecondaryIV> secondaryInteractionVolumes;
46
47 std::vector<PrimaryIVDataHandle> primaryDataHandles;
48 std::vector<SecondaryIVDataHandle> secondaryDataHandles;
49};
50
60template<class GFVC, bool cachingEnabled>
62
67template<class GFVC>
69{
70public:
72 using PrimaryInteractionVolume = typename GFVC::PrimaryInteractionVolume;
73 using SecondaryInteractionVolume = typename GFVC::SecondaryInteractionVolume;
74
76 using PrimaryIvDataHandle = typename GFVC::PrimaryIvDataHandle;
77 using SecondaryIvDataHandle = typename GFVC::SecondaryIvDataHandle;
78
80 using FluxVariablesCache = typename GFVC::FluxVariablesCache;
81
83 static constexpr bool cachingEnabled = true;
84
87
88private:
90 using FluxVariablesCacheFiller = typename GFVC::Traits::FluxVariablesCacheFiller;
91
93 class BoundaryCacheData
94 {
95 // allow the element flux variables class access to private members
97
98 public:
100 template<class SubControlVolumeFace>
101 const FluxVariablesCache& operator [](const SubControlVolumeFace& scvf) const
102 { return fluxVarCaches_[getLocalIdx_(scvf.index())]; }
103
104 template<class SubControlVolumeFace>
105 FluxVariablesCache& operator [](const SubControlVolumeFace& scvf)
106 { return fluxVarCaches_[getLocalIdx_(scvf.index())]; }
107
109 void clear()
110 {
111 fluxVarCaches_.clear();
112 cacheScvfIndices_.clear();
113 ivDataStorage_.primaryInteractionVolumes.clear();
114 ivDataStorage_.secondaryInteractionVolumes.clear();
115 ivDataStorage_.primaryDataHandles.clear();
116 ivDataStorage_.secondaryDataHandles.clear();
117 }
118
119 public:
121 int getLocalIdx_(const int scvfIdx) const
122 {
123 auto it = std::find(cacheScvfIndices_.begin(), cacheScvfIndices_.end(), scvfIdx);
124 assert(it != cacheScvfIndices_.end() && "Could not find the local idx for the given scvf idx!");
125 return std::distance(cacheScvfIndices_.begin(), it);
126 }
127
128 std::vector<std::size_t> cacheScvfIndices_;
129 std::vector<FluxVariablesCache> fluxVarCaches_;
130
131 // stored boundary interaction volumes and handles
136 IVDataStorage ivDataStorage_;
137 };
138
139public:
142 : gridFluxVarsCachePtr_(&global)
143 {}
144
146 template<class FVElementGeometry, class ElementVolumeVariables>
147 void bindElement(const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
148 const FVElementGeometry& fvGeometry,
149 const ElementVolumeVariables& elemVolVars)
150 { DUNE_THROW(Dune::NotImplemented, "Local element binding of the flux variables cache in mpfa schemes"); }
151
153 template<class FVElementGeometry, class ElementVolumeVariables>
154 void bind(const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
155 const FVElementGeometry& fvGeometry,
156 const ElementVolumeVariables& elemVolVars)
157 {
158 boundaryCacheData_.clear();
159
160 // find out how much memory needs to be reserved
161 std::size_t numPrimaryIv; numPrimaryIv = 0;
162 std::size_t numSecondaryIv; numSecondaryIv = 0;
163 std::size_t numCaches; numCaches = 0;
164
165 const auto& gridGeometry = fvGeometry.gridGeometry();
166 const auto& gridIvIndexSets = gridGeometry.gridInteractionVolumeIndexSets();
167
168 // lambda to check if a scvf was handled already
169 auto scvfHandled = [&] (auto idx)
170 {
171 return std::find(boundaryCacheData_.cacheScvfIndices_.begin(),
172 boundaryCacheData_.cacheScvfIndices_.end(),
173 idx) != boundaryCacheData_.cacheScvfIndices_.end();
174 };
175
176 // lambda to increase counters for a given scvf
177 auto handleScvf = [&] (const auto& scvf, const auto& indexSet, bool isSecondary)
178 {
179 const auto& scvfIndices = indexSet.gridScvfIndices();
180 if ( indexSet.nodalIndexSet().numBoundaryScvfs() > 0
181 && !std::any_of(scvfIndices.begin(), scvfIndices.end(), scvfHandled) )
182 {
183 boundaryCacheData_.cacheScvfIndices_.insert(boundaryCacheData_.cacheScvfIndices_.end(),
184 scvfIndices.begin(),
185 scvfIndices.end());
186 numCaches += scvfIndices.size();
187 if (isSecondary) numSecondaryIv++;
188 else numPrimaryIv++;
189 }
190 };
191
192 // search for ivs at boundary vertices
193 for (const auto& scvf : scvfs(fvGeometry))
194 gridGeometry.vertexUsesSecondaryInteractionVolume(scvf.vertexIndex()) ?
195 handleScvf(scvf, gridIvIndexSets.secondaryIndexSet(scvf), true) :
196 handleScvf(scvf, gridIvIndexSets.primaryIndexSet(scvf), false) ;
197
198 // skip the rest if there are no boundary caches to be created
199 if (numCaches > 0)
200 {
201 const auto& assemblyMapI = gridGeometry.connectivityMap()[gridGeometry.elementMapper().index(element)];
202
203 for (const auto& dataJ : assemblyMapI)
204 {
205 for (const auto& scvfJIdx : dataJ.scvfsJ)
206 {
207 const auto& scvfJ = fvGeometry.scvf(scvfJIdx);
208 if (gridGeometry.vertexUsesSecondaryInteractionVolume(scvfJ.vertexIndex()))
209 handleScvf(scvfJ, gridIvIndexSets.secondaryIndexSet(scvfJ), true);
210 else
211 handleScvf(scvfJ, gridIvIndexSets.primaryIndexSet(scvfJ), false);
212 }
213 }
214
215 // now prepare the caches of all scvfs that have been found to be handled
216 boundaryCacheData_.ivDataStorage_.primaryInteractionVolumes.reserve(numPrimaryIv);
217 boundaryCacheData_.ivDataStorage_.secondaryInteractionVolumes.reserve(numSecondaryIv);
218 boundaryCacheData_.ivDataStorage_.primaryDataHandles.reserve(numPrimaryIv);
219 boundaryCacheData_.ivDataStorage_.secondaryDataHandles.reserve(numSecondaryIv);
220
221 boundaryCacheData_.fluxVarCaches_.resize(numCaches);
222 for (auto& cache : boundaryCacheData_.fluxVarCaches_)
223 cache.setUpdateStatus(false);
224
225 FluxVariablesCacheFiller filler(gridFluxVarsCachePtr_->problem());
226 for (auto scvfIdx : boundaryCacheData_.cacheScvfIndices_)
227 {
228 const auto& scvf = fvGeometry.scvf(scvfIdx);
229 auto& cache = boundaryCacheData_[scvf];
230 if (!cache.isUpdated())
231 filler.fill(boundaryCacheData_, cache, boundaryCacheData_.ivDataStorage_,
232 element, fvGeometry, elemVolVars, scvf, /*forceUpdate*/true);
233 }
234 }
235 }
236
238 template<class FVElementGeometry, class ElementVolumeVariables>
239 void bindScvf(const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
240 const FVElementGeometry& fvGeometry,
241 const ElementVolumeVariables& elemVolVars,
242 const typename FVElementGeometry::SubControlVolumeFace& scvf)
243 { DUNE_THROW(Dune::NotImplemented, "Scvf-local binding of the flux variables cache in mpfa schemes"); }
244
246 template<class FVElementGeometry, class ElementVolumeVariables>
247 void update(const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
248 const FVElementGeometry& fvGeometry,
249 const ElementVolumeVariables& elemVolVars)
250 {
251 // Update only if the filler puts solution-dependent stuff into the caches
252 if (FluxVariablesCacheFiller::isSolDependent)
253 {
254 // helper class to fill flux variables caches
255 FluxVariablesCacheFiller filler(gridFluxVarsCachePtr_->problem());
256
257 // first, set all the caches to "outdated"
258 for (auto& cache : boundaryCacheData_.fluxVarCaches_)
259 cache.setUpdateStatus(false);
260
261 // go through the caches maybe update them
262 std::size_t cacheIdx = 0;
263 for (auto scvfIdx : boundaryCacheData_.cacheScvfIndices_)
264 {
265 auto& scvfCache = boundaryCacheData_.fluxVarCaches_[cacheIdx++];
266 if (!scvfCache.isUpdated())
267 filler.fill(boundaryCacheData_, scvfCache, boundaryCacheData_.ivDataStorage_,
268 element, fvGeometry, elemVolVars, fvGeometry.scvf(scvfIdx));
269 }
270 }
271 }
272
274 template<class SubControlVolumeFace>
275 const FluxVariablesCache& operator [](const SubControlVolumeFace& scvf) const
276 { return !isEmbeddedInBoundaryIV_(scvf) ? (*gridFluxVarsCachePtr_)[scvf] : boundaryCacheData_[scvf]; }
277
279 template<class SubControlVolumeFace>
280 const PrimaryInteractionVolume& primaryInteractionVolume(const SubControlVolumeFace& scvf) const
281 {
282 return isEmbeddedInBoundaryIV_(scvf)
283 ? boundaryCacheData_.ivDataStorage_.primaryInteractionVolumes[ (*this)[scvf].ivIndexInContainer() ]
284 : gridFluxVarsCachePtr_->primaryInteractionVolume(scvf);
285 }
286
288 template<class SubControlVolumeFace>
289 const PrimaryIvDataHandle& primaryDataHandle(const SubControlVolumeFace& scvf) const
290 {
291 return isEmbeddedInBoundaryIV_(scvf)
292 ? boundaryCacheData_.ivDataStorage_.primaryDataHandles[ (*this)[scvf].ivIndexInContainer() ]
293 : gridFluxVarsCachePtr_->primaryDataHandle(scvf);
294 }
295
297 template<class SubControlVolumeFace>
298 const SecondaryInteractionVolume& secondaryInteractionVolume(const SubControlVolumeFace& scvf) const
299 {
300 return isEmbeddedInBoundaryIV_(scvf)
301 ? boundaryCacheData_.ivDataStorage_.secondaryInteractionVolumes[ (*this)[scvf].ivIndexInContainer() ]
302 : gridFluxVarsCachePtr_->secondaryInteractionVolume(scvf);
303 }
304
306 template<class SubControlVolumeFace>
307 const SecondaryIvDataHandle& secondaryDataHandle(const SubControlVolumeFace& scvf) const
308 {
309 return isEmbeddedInBoundaryIV_(scvf)
310 ? boundaryCacheData_.ivDataStorage_.secondaryDataHandles[ (*this)[scvf].ivIndexInContainer() ]
311 : gridFluxVarsCachePtr_->secondaryDataHandle(scvf);
312 }
313
316 { return *gridFluxVarsCachePtr_; }
317
318private:
320 template<class SubControlVolumeFace>
321 bool isEmbeddedInBoundaryIV_(const SubControlVolumeFace& scvf) const
322 {
323 const auto& gridGeometry = gridFluxVarsCachePtr_->problem().gridGeometry();
324 const auto& gridIvIndexSets = gridGeometry.gridInteractionVolumeIndexSets();
325 if (gridGeometry.vertexUsesSecondaryInteractionVolume(scvf.vertexIndex()))
326 return gridIvIndexSets.secondaryIndexSet(scvf).nodalIndexSet().numBoundaryScvfs() > 0;
327 else
328 return gridIvIndexSets.primaryIndexSet(scvf).nodalIndexSet().numBoundaryScvfs() > 0;
329 }
330
331 const GridFluxVariablesCache* gridFluxVarsCachePtr_;
332
333 // we store those caches that touch the boundary locally here
334 // for the case that the boundary conditions change, which would
335 // leave the grid-wide cache outdated.
336 BoundaryCacheData boundaryCacheData_;
337};
338
343template<class GFVC>
345{
347 using FluxVariablesCacheFiller = typename GFVC::Traits::FluxVariablesCacheFiller;
348
349public:
351 using PrimaryInteractionVolume = typename GFVC::PrimaryInteractionVolume;
352 using SecondaryInteractionVolume = typename GFVC::SecondaryInteractionVolume;
353
355 using PrimaryIvDataHandle = typename GFVC::PrimaryIvDataHandle;
356 using SecondaryIvDataHandle = typename GFVC::SecondaryIvDataHandle;
357
359 using FluxVariablesCache = typename GFVC::FluxVariablesCache;
360
361
363 static constexpr bool cachingEnabled = false;
364
367
369 : gridFluxVarsCachePtr_(&global) {}
370
376 template<class FVElementGeometry, class ElementVolumeVariables>
377 void bindElement(const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
378 const FVElementGeometry& fvGeometry,
379 const ElementVolumeVariables& elemVolVars)
380 {
381 // For mpfa schemes we will have to prepare the caches of all scvfs that are
382 // embedded in the interaction volumes in which the element-local scvfs are embedded
383 DUNE_THROW(Dune::NotImplemented, "Local element binding of the flux variables cache in mpfa schemes");
384 }
385
391 template<class FVElementGeometry, class ElementVolumeVariables>
392 void bind(const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
393 const FVElementGeometry& fvGeometry,
394 const ElementVolumeVariables& elemVolVars)
395 {
396 clear_();
397
398 // some references for convenience
399 const auto& problem = gridFluxVarsCache().problem();
400 const auto& gridGeometry = fvGeometry.gridGeometry();
401
402 // the assembly map of the given element
403 const auto& assemblyMapI = gridGeometry.connectivityMap()[gridGeometry.elementMapper().index(element)];
404
405 // reserve memory for scvf index container
406 unsigned int numNeighborScvfs = 0;
407 for (const auto& dataJ : assemblyMapI)
408 numNeighborScvfs += dataJ.scvfsJ.size();
409 globalScvfIndices_.resize(fvGeometry.numScvf() + numNeighborScvfs);
410
411 // set the scvf indices in scvf index container
412 unsigned int i = 0;
413 for (const auto& scvf : scvfs(fvGeometry))
414 globalScvfIndices_[i++] = scvf.index();
415 for (const auto& dataJ : assemblyMapI)
416 for (auto scvfIdx : dataJ.scvfsJ)
417 globalScvfIndices_[i++] = scvfIdx;
418
419 // Reserve memory (over-) estimate for interaction volumes and corresponding data.
420 // The overestimate doesn't hurt as we are not in a memory-limited configuration.
421 // We need to avoid reallocation because in the caches we store pointers to the data handles.
422 // Default -> each facet has two neighbors (local adaption) and all scvfs belongs to different ivs.
423 // If you want to use higher local differences change the parameter below.
424 constexpr auto numIvEstimate = FVElementGeometry::maxNumElementScvfs
425 * GridFluxVariablesCache::Traits::maxLocalElementLevelDifference();
426 ivDataStorage_.primaryInteractionVolumes.reserve(numIvEstimate);
427 ivDataStorage_.secondaryInteractionVolumes.reserve(numIvEstimate);
428 ivDataStorage_.primaryDataHandles.reserve(numIvEstimate);
429 ivDataStorage_.secondaryDataHandles.reserve(numIvEstimate);
430
431 // helper class to fill flux variables caches
432 FluxVariablesCacheFiller filler(problem);
433
434 // resize the cache container
435 fluxVarsCache_.resize(globalScvfIndices_.size());
436
437 // go through the caches and fill them
438 i = 0;
439 for (const auto& scvf : scvfs(fvGeometry))
440 {
441 auto& scvfCache = fluxVarsCache_[i++];
442 if (!scvfCache.isUpdated())
443 filler.fill(*this, scvfCache, ivDataStorage_, element, fvGeometry, elemVolVars, scvf, true);
444 }
445
446 for (const auto& dataJ : assemblyMapI)
447 {
448 const auto elementJ = gridGeometry.element(dataJ.globalJ);
449 for (const auto scvfIdx : dataJ.scvfsJ)
450 {
451 auto& scvfCache = fluxVarsCache_[i++];
452 if (!scvfCache.isUpdated())
453 filler.fill(*this, scvfCache, ivDataStorage_, elementJ, fvGeometry, elemVolVars, fvGeometry.scvf(scvfIdx), true);
454 }
455 }
456 }
457
463 template<class FVElementGeometry, class ElementVolumeVariables>
464 void bindScvf(const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
465 const FVElementGeometry& fvGeometry,
466 const ElementVolumeVariables& elemVolVars,
467 const typename FVElementGeometry::SubControlVolumeFace& scvf)
468 {
469 // For mpfa schemes we will have to prepare the caches of all
470 // scvfs that are embedded in the interaction volumes this scvf is embedded
471 DUNE_THROW(Dune::NotImplemented, "Scvf-local binding of the flux variables cache in mpfa schemes");
472 }
473
478 template<class FVElementGeometry, class ElementVolumeVariables>
479 void update(const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
480 const FVElementGeometry& fvGeometry,
481 const ElementVolumeVariables& elemVolVars)
482 {
483 // Update only if the filler puts
484 // solution-dependent stuff into the caches
485 if (FluxVariablesCacheFiller::isSolDependent)
486 {
487 const auto& problem = gridFluxVarsCache().problem();
488 const auto& gridGeometry = fvGeometry.gridGeometry();
489 const auto& assemblyMapI = gridGeometry.connectivityMap()[gridGeometry.elementMapper().index(element)];
490
491 // helper class to fill flux variables caches
492 FluxVariablesCacheFiller filler(problem);
493
494 // set all the caches to "outdated"
495 for (auto& cache : fluxVarsCache_)
496 cache.setUpdateStatus(false);
497
498 // go through the caches maybe update them
499 unsigned int i = 0;
500 for (const auto& scvf : scvfs(fvGeometry))
501 {
502 auto& scvfCache = fluxVarsCache_[i++];
503 if (!scvfCache.isUpdated())
504 filler.fill(*this, scvfCache, ivDataStorage_, element, fvGeometry, elemVolVars, scvf);
505 }
506
507 for (const auto& dataJ : assemblyMapI)
508 {
509 const auto elementJ = gridGeometry.element(dataJ.globalJ);
510 for (const auto scvfIdx : dataJ.scvfsJ)
511 {
512 auto& scvfCache = fluxVarsCache_[i++];
513 if (!scvfCache.isUpdated())
514 filler.fill(*this, scvfCache, ivDataStorage_, elementJ, fvGeometry, elemVolVars, fvGeometry.scvf(scvfIdx));
515 }
516 }
517 }
518 }
519
521 template<class SubControlVolumeFace, typename std::enable_if_t<!std::is_integral<SubControlVolumeFace>::value, int> = 0>
522 const FluxVariablesCache& operator [](const SubControlVolumeFace& scvf) const
523 { return fluxVarsCache_[getLocalScvfIdx_(scvf.index())]; }
524
526 const FluxVariablesCache& operator [](const std::size_t scvfIdx) const
527 { return fluxVarsCache_[getLocalScvfIdx_(scvfIdx)]; }
528
530 template<class SubControlVolumeFace, typename std::enable_if_t<!std::is_integral<SubControlVolumeFace>::value, int> = 0>
531 FluxVariablesCache& operator [](const SubControlVolumeFace& scvf)
532 { return fluxVarsCache_[getLocalScvfIdx_(scvf.index())]; }
533
535 FluxVariablesCache& operator [](const std::size_t scvfIdx)
536 { return fluxVarsCache_[getLocalScvfIdx_(scvfIdx)]; }
537
539 template<class SubControlVolumeFace>
540 const PrimaryInteractionVolume& primaryInteractionVolume(const SubControlVolumeFace& scvf) const
541 { return ivDataStorage_.primaryInteractionVolumes[ (*this)[scvf].ivIndexInContainer() ]; }
542
544 template<class SubControlVolumeFace>
545 const PrimaryIvDataHandle& primaryDataHandle(const SubControlVolumeFace& scvf) const
546 { return ivDataStorage_.primaryDataHandles[ (*this)[scvf].ivIndexInContainer() ]; }
547
549 template<class SubControlVolumeFace>
550 const SecondaryInteractionVolume& secondaryInteractionVolume(const SubControlVolumeFace& scvf) const
551 { return ivDataStorage_.secondaryInteractionVolumes[ (*this)[scvf].ivIndexInContainer() ]; }
552
554 template<class SubControlVolumeFace>
555 const SecondaryIvDataHandle& secondaryDataHandle(const SubControlVolumeFace& scvf) const
556 { return ivDataStorage_.secondaryDataHandles[ (*this)[scvf].ivIndexInContainer() ]; }
557
560 { return *gridFluxVarsCachePtr_; }
561
562private:
563 const GridFluxVariablesCache* gridFluxVarsCachePtr_;
564
566 void clear_()
567 {
568 fluxVarsCache_.clear();
569 globalScvfIndices_.clear();
570 ivDataStorage_.primaryInteractionVolumes.clear();
571 ivDataStorage_.secondaryInteractionVolumes.clear();
572 ivDataStorage_.primaryDataHandles.clear();
573 ivDataStorage_.secondaryDataHandles.clear();
574 }
575
577 unsigned int getLocalScvfIdx_(const int scvfIdx) const
578 {
579 auto it = std::find(globalScvfIndices_.begin(), globalScvfIndices_.end(), scvfIdx);
580 assert(it != globalScvfIndices_.end() && "Could not find the flux vars cache for scvfIdx");
581 return std::distance(globalScvfIndices_.begin(), it);
582 }
583
584 // the local flux vars caches and corresponding indices
585 std::vector<FluxVariablesCache> fluxVarsCache_;
586 std::vector<std::size_t> globalScvfIndices_;
587
588 // stored interaction volumes and handles
589 using IVDataStorage = InteractionVolumeDataStorage<PrimaryInteractionVolume,
590 PrimaryIvDataHandle,
591 SecondaryInteractionVolume,
592 SecondaryIvDataHandle>;
593 IVDataStorage ivDataStorage_;
594};
595
596} // end namespace
597
598#endif
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
Structure to store interaction volumes and data handles.
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:43
std::vector< PrimaryIVDataHandle > primaryDataHandles
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:47
std::vector< SecondaryIV > secondaryInteractionVolumes
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:45
std::vector< PrimaryIV > primaryInteractionVolumes
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:44
std::vector< SecondaryIVDataHandle > secondaryDataHandles
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:48
The flux variables caches for an element.
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:61
The flux variables caches for an element with caching enabled.
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:69
GFVC GridFluxVariablesCache
export the type of the grid flux variables
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:86
typename GFVC::FluxVariablesCache FluxVariablesCache
export the flux variable cache type
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:80
void bindElement(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars)
Bind the flux var caches for scvfs inside the element only.
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:147
typename GFVC::PrimaryInteractionVolume PrimaryInteractionVolume
export the interaction volume types
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:72
void bindScvf(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const typename FVElementGeometry::SubControlVolumeFace &scvf)
Bind the flux var caches for an individual scvf.
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:239
const GridFluxVariablesCache & gridFluxVarsCache() const
The global object we are a restriction of.
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:315
const PrimaryIvDataHandle & primaryDataHandle(const SubControlVolumeFace &scvf) const
access to the data handle of an interaction volume an scvf is embedded in
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:289
const SecondaryIvDataHandle & secondaryDataHandle(const SubControlVolumeFace &scvf) const
access to the data handle of an interaction volume an scvf is embedded in
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:307
typename GFVC::SecondaryIvDataHandle SecondaryIvDataHandle
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:77
void bind(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars)
Specialization for the global caching being enabled - do nothing here.
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:154
const SecondaryInteractionVolume & secondaryInteractionVolume(const SubControlVolumeFace &scvf) const
access to the interaction volume an scvf is embedded in
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:298
const PrimaryInteractionVolume & primaryInteractionVolume(const SubControlVolumeFace &scvf) const
access to the interaction volume an scvf is embedded in
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:280
typename GFVC::PrimaryIvDataHandle PrimaryIvDataHandle
export the data handle types used
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:76
void update(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars)
Specialization for the global caching being enabled - do nothing here.
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:247
CCMpfaElementFluxVariablesCache(const GridFluxVariablesCache &global)
The constructor.
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:141
typename GFVC::SecondaryInteractionVolume SecondaryInteractionVolume
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:73
const SecondaryInteractionVolume & secondaryInteractionVolume(const SubControlVolumeFace &scvf) const
access to the interaction volume an scvf is embedded in
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:550
const PrimaryIvDataHandle & primaryDataHandle(const SubControlVolumeFace &scvf) const
access to the data handle of an interaction volume an scvf is embedded in
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:545
void update(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars)
Update the transmissibilities if the volume variables have changed.
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:479
const PrimaryInteractionVolume & primaryInteractionVolume(const SubControlVolumeFace &scvf) const
access to the interaction volume an scvf is embedded in
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:540
typename GFVC::SecondaryIvDataHandle SecondaryIvDataHandle
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:356
void bindScvf(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const typename FVElementGeometry::SubControlVolumeFace &scvf)
Prepares the transmissibilities of a single scv face.
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:464
typename GFVC::PrimaryIvDataHandle PrimaryIvDataHandle
export the data handle types used
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:355
void bind(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars)
Prepares the transmissibilities of the scv faces in the stencil of an element.
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:392
const SecondaryIvDataHandle & secondaryDataHandle(const SubControlVolumeFace &scvf) const
access to the data handle of an interaction volume an scvf is embedded in
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:555
typename GFVC::PrimaryInteractionVolume PrimaryInteractionVolume
export the interaction volume types
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:351
const GridFluxVariablesCache & gridFluxVarsCache() const
The global object we are a restriction of.
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:559
CCMpfaElementFluxVariablesCache(const GridFluxVariablesCache &global)
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:368
typename GFVC::FluxVariablesCache FluxVariablesCache
export the flux variable cache type
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:359
GFVC GridFluxVariablesCache
export the type of the grid flux variables
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:366
void bindElement(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars)
Prepares the transmissibilities of the scv faces in an element.
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:377
typename GFVC::SecondaryInteractionVolume SecondaryInteractionVolume
Definition: cellcentered/mpfa/elementfluxvariablescache.hh:352