3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/volumevariables.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 *****************************************************************************/
26#ifndef DUMUX_POROUSMEDIUMFLOW_VOLUME_VARIABLES_HH
27#define DUMUX_POROUSMEDIUMFLOW_VOLUME_VARIABLES_HH
28
30
31namespace Dumux {
32
40template<class Traits>
42{
43 using Scalar = typename Traits::PrimaryVariables::value_type;
44
45public:
47 using PrimaryVariables = typename Traits::PrimaryVariables;
49 using Indices = typename Traits::ModelTraits::Indices;
50
52 static constexpr int numFluidPhases() { return Traits::ModelTraits::numFluidPhases(); }
54 static constexpr int numFluidComponents() { return Traits::ModelTraits::numFluidComponents(); }
55
65 template<class ElemSol, class Problem, class Element, class Scv>
66 void update(const ElemSol& elemSol,
67 const Problem& problem,
68 const Element& element,
69 const Scv& scv)
70 {
71 priVars_ = elemSol[scv.localDofIndex()];
72 extrusionFactor_ = Deprecated::extrusionFactor(problem, element, scv, elemSol);
73 }
74
79 { return priVars_; }
80
86 Scalar priVar(const int pvIdx) const
87 { return priVars_[pvIdx]; }
88
98 Scalar extrusionFactor() const
99 { return extrusionFactor_; }
100
101private:
102 PrimaryVariables priVars_;
103 Scalar extrusionFactor_;
104};
105
106} // end namespace Dumux
107
108#endif
Helpers for deprecation.
Definition: adapt.hh:29
The isothermal base class.
Definition: porousmediumflow/volumevariables.hh:42
static constexpr int numFluidComponents()
Return number of components considered by the model.
Definition: porousmediumflow/volumevariables.hh:54
Scalar priVar(const int pvIdx) const
Returns a component of primary variable vector.
Definition: porousmediumflow/volumevariables.hh:86
Scalar extrusionFactor() const
Returns how much the sub-control volume is extruded.
Definition: porousmediumflow/volumevariables.hh:98
const PrimaryVariables & priVars() const
Returns the vector of primary variables.
Definition: porousmediumflow/volumevariables.hh:78
static constexpr int numFluidPhases()
Return number of phases considered by the model.
Definition: porousmediumflow/volumevariables.hh:52
void update(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv)
Updates all quantities for a given control volume.
Definition: porousmediumflow/volumevariables.hh:66
typename Traits::PrimaryVariables PrimaryVariables
Export the type used for the primary variables.
Definition: porousmediumflow/volumevariables.hh:47
typename Traits::ModelTraits::Indices Indices
Export the type encapsulating primary variable indices.
Definition: porousmediumflow/volumevariables.hh:49