24#ifndef DUMUX_DISCRETIZATION_CVFE_GRID_VOLUMEVARIABLES_HH
25#define DUMUX_DISCRETIZATION_CVFE_GRID_VOLUMEVARIABLES_HH
39template<
class P,
class VV>
45 template<
class Gr
idVolumeVariables,
bool cachingEnabled>
53template<
class Traits,
bool enableCaching>
70 static constexpr bool cachingEnabled =
true;
77 template<
class Gr
idGeometry,
class SolutionVector>
78 void update(
const GridGeometry& gridGeometry,
const SolutionVector& sol)
80 volumeVariables_.resize(gridGeometry.gridView().size(0));
81 Dumux::parallelFor(gridGeometry.gridView().size(0), [&, &problem = problem()](
const std::size_t eIdx)
83 const auto element = gridGeometry.element(eIdx);
84 const auto fvGeometry =
localView(gridGeometry).bindElement(element);
90 volumeVariables_[eIdx].resize(fvGeometry.numScv());
91 for (
const auto& scv : scvs(fvGeometry))
92 volumeVariables_[eIdx][scv.indexInElement()].update(elemSol, problem, element, scv);
96 template<class SubControlVolume, typename std::enable_if_t<!std::is_integral<SubControlVolume>::value,
int> = 0>
98 {
return volumeVariables_[scv.elementIndex()][scv.indexInElement()]; }
100 template<class SubControlVolume, typename std::enable_if_t<!std::is_integral<SubControlVolume>::value,
int> = 0>
102 {
return volumeVariables_[scv.elementIndex()][scv.indexInElement()]; }
105 {
return volumeVariables_[eIdx][scvIdx]; }
108 {
return volumeVariables_[eIdx][scvIdx]; }
111 {
return *problemPtr_; }
114 const Problem* problemPtr_;
115 std::vector<std::vector<VolumeVariables>> volumeVariables_;
120template<
class Traits>
133 static constexpr bool cachingEnabled =
false;
140 template<
class Gr
idGeometry,
class SolutionVector>
141 void update(
const GridGeometry& gridGeometry,
const SolutionVector& sol) {}
144 {
return *problemPtr_;}
147 const Problem* problemPtr_;
Free function to get the local view of a grid cache object.
Parallel for loop (multithreading)
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition: localview.hh:38
auto elementSolution(const Element &element, const SolutionVector &sol, const GridGeometry &gg) -> std::enable_if_t< GridGeometry::discMethod==DiscretizationMethods::box, BoxElementSolution< typename GridGeometry::LocalView, std::decay_t< decltype(std::declval< SolutionVector >()[0])> > >
Make an element solution for box schemes.
Definition: box/elementsolution.hh:118
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 local (stencil) volume variables class for control-volume finite element.
Definition: cvfe/elementvolumevariables.hh:43
Definition: cvfe/gridvolumevariables.hh:41
VV VolumeVariables
Definition: cvfe/gridvolumevariables.hh:43
P Problem
Definition: cvfe/gridvolumevariables.hh:42
Base class for the grid volume variables.
Definition: cvfe/gridvolumevariables.hh:54
Definition: cvfe/gridvolumevariables.hh:59
CVFEGridVolumeVariables(const Problem &problem)
Definition: cvfe/gridvolumevariables.hh:75
const VolumeVariables & volVars(const std::size_t eIdx, const std::size_t scvIdx) const
Definition: cvfe/gridvolumevariables.hh:104
VolumeVariables & volVars(const std::size_t eIdx, const std::size_t scvIdx)
Definition: cvfe/gridvolumevariables.hh:107
typename Traits::VolumeVariables VolumeVariables
export the volume variables type
Definition: cvfe/gridvolumevariables.hh:67
const Problem & problem() const
Definition: cvfe/gridvolumevariables.hh:110
void update(const GridGeometry &gridGeometry, const SolutionVector &sol)
Definition: cvfe/gridvolumevariables.hh:78
typename Traits::Problem Problem
export the problem type
Definition: cvfe/gridvolumevariables.hh:64
const VolumeVariables & volVars(const SubControlVolume &scv) const
Definition: cvfe/gridvolumevariables.hh:97
VolumeVariables & volVars(const SubControlVolume &scv)
Definition: cvfe/gridvolumevariables.hh:101
typename Traits::template LocalView< ThisType, cachingEnabled > LocalView
export the type of the local view
Definition: cvfe/gridvolumevariables.hh:73
Definition: cvfe/gridvolumevariables.hh:122
void update(const GridGeometry &gridGeometry, const SolutionVector &sol)
Definition: cvfe/gridvolumevariables.hh:141
typename Traits::VolumeVariables VolumeVariables
export the volume variables type
Definition: cvfe/gridvolumevariables.hh:130
typename Traits::Problem Problem
export the problem type
Definition: cvfe/gridvolumevariables.hh:127
CVFEGridVolumeVariables(const Problem &problem)
Definition: cvfe/gridvolumevariables.hh:138
typename Traits::template LocalView< ThisType, cachingEnabled > LocalView
export the type of the local view
Definition: cvfe/gridvolumevariables.hh:136
const Problem & problem() const
Definition: cvfe/gridvolumevariables.hh:143
The local element solution class for the box method.
The local volume variables class.