24#ifndef DUMUX_DISCRETIZATION_FACECENTERED_GRID_VOLUMEVARIABLES_HH
25#define DUMUX_DISCRETIZATION_FACECENTERED_GRID_VOLUMEVARIABLES_HH
39template<
class P,
class VV>
45 template<
class Gr
idVolumeVariables,
bool cachingEnabled>
56template<
class Traits,
bool cachingEnabled = false>
73 static constexpr bool cachingEnabled =
true;
80 template<
class Gr
idGeometry,
class SolutionVector>
81 void update(
const GridGeometry& gridGeometry,
const SolutionVector& sol)
83 volumeVariables_.resize(gridGeometry.numScv());
84 Dumux::parallelFor(gridGeometry.gridView().size(0), [&, &problem = problem()](
const std::size_t eIdx)
86 const auto element = gridGeometry.element(eIdx);
87 const auto fvGeometry =
localView(gridGeometry).bindElement(element);
90 for (
const auto& scv : scvs(fvGeometry))
91 volumeVariables_[scv.index()].update(elemSol, problem, element, scv);
96 {
return volumeVariables_[scvIdx]; }
99 {
return volumeVariables_[scvIdx]; }
101 template<class SubControlVolume, typename std::enable_if_t<!std::is_integral<SubControlVolume>::value,
int> = 0>
103 {
return volumeVariables_[scv.index()]; }
105 template<class SubControlVolume, typename std::enable_if_t<!std::is_integral<SubControlVolume>::value,
int> = 0>
107 {
return volumeVariables_[scv.index()]; }
111 {
return volumeVariables_[scvIdx]; }
115 {
return volumeVariables_[scvIdx]; }
119 {
return *problemPtr_; }
122 const Problem* problemPtr_;
123 std::vector<VolumeVariables> volumeVariables_;
128template<
class Traits>
141 static constexpr bool cachingEnabled =
false;
148 template<
class Gr
idGeometry,
class SolutionVector>
149 void update(
const GridGeometry& gridGeometry,
const SolutionVector& sol) {}
153 {
return *problemPtr_;}
156 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
Base class for the face variables vector.
Definition: facecentered/staggered/elementvolumevariables.hh:41
Definition: facecentered/staggered/gridvolumevariables.hh:41
P Problem
Definition: facecentered/staggered/gridvolumevariables.hh:42
VV VolumeVariables
Definition: facecentered/staggered/gridvolumevariables.hh:43
Base class for the grid volume variables.
Definition: facecentered/staggered/gridvolumevariables.hh:57
specialization in case of storing the volume variables
Definition: facecentered/staggered/gridvolumevariables.hh:62
void update(const GridGeometry &gridGeometry, const SolutionVector &sol)
Definition: facecentered/staggered/gridvolumevariables.hh:81
FaceCenteredStaggeredGridVolumeVariables(const Problem &problem)
Definition: facecentered/staggered/gridvolumevariables.hh:78
VolumeVariables & volVars(const std::size_t scvIdx, const std::size_t localIdx)
Definition: facecentered/staggered/gridvolumevariables.hh:114
const VolumeVariables & volVars(const std::size_t scvIdx) const
Definition: facecentered/staggered/gridvolumevariables.hh:95
typename Traits::Problem Problem
export the problem type
Definition: facecentered/staggered/gridvolumevariables.hh:67
const VolumeVariables & volVars(const SubControlVolume scv) const
Definition: facecentered/staggered/gridvolumevariables.hh:102
typename Traits::VolumeVariables VolumeVariables
export the volume variables type
Definition: facecentered/staggered/gridvolumevariables.hh:70
VolumeVariables & volVars(const SubControlVolume scv)
Definition: facecentered/staggered/gridvolumevariables.hh:106
VolumeVariables & volVars(const std::size_t scvIdx)
Definition: facecentered/staggered/gridvolumevariables.hh:98
typename Traits::template LocalView< ThisType, cachingEnabled > LocalView
export the type of the local view
Definition: facecentered/staggered/gridvolumevariables.hh:76
const Problem & problem() const
The problem we are solving.
Definition: facecentered/staggered/gridvolumevariables.hh:118
const VolumeVariables & volVars(const std::size_t scvIdx, const std::size_t localIdx) const
Definition: facecentered/staggered/gridvolumevariables.hh:110
Specialization when the current volume variables are not stored globally.
Definition: facecentered/staggered/gridvolumevariables.hh:130
FaceCenteredStaggeredGridVolumeVariables(const Problem &problem)
Definition: facecentered/staggered/gridvolumevariables.hh:146
typename Traits::VolumeVariables VolumeVariables
export the volume variables type
Definition: facecentered/staggered/gridvolumevariables.hh:138
typename Traits::template LocalView< ThisType, cachingEnabled > LocalView
export the type of the local view
Definition: facecentered/staggered/gridvolumevariables.hh:144
typename Traits::Problem Problem
export the problem type
Definition: facecentered/staggered/gridvolumevariables.hh:135
void update(const GridGeometry &gridGeometry, const SolutionVector &sol)
Definition: facecentered/staggered/gridvolumevariables.hh:149
const Problem & problem() const
The problem we are solving.
Definition: facecentered/staggered/gridvolumevariables.hh:152