version 3.8
common/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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_COMMON_BASIC_VOLUME_VARIABLES_HH
13#define DUMUX_COMMON_BASIC_VOLUME_VARIABLES_HH
14
15#include <memory>
16
17namespace Dumux {
18
19template <class Traits>
21{
22 using Scalar = typename Traits::PrimaryVariables::value_type;
23public:
25 using PrimaryVariables = typename Traits::PrimaryVariables;
26
30 template<class ElementSolution, class Problem, class Element, class SubControlVolume>
31 void update(const ElementSolution& elemSol,
32 const Problem& problem,
33 const Element& element,
34 const SubControlVolume& scv)
35 {
36 priVars_ = elemSol[scv.indexInElement()];
37 }
38
39 Scalar priVar(const int pvIdx) const
40 { return priVars_[pvIdx]; }
41
43 { return priVars_; }
44
45 // for compatibility with more general models
46 Scalar extrusionFactor() const
47 { return 1.0; }
48
49private:
50 PrimaryVariables priVars_;
51};
52
53} // end namespace Dumux
54
55#endif
Definition: common/volumevariables.hh:21
const PrimaryVariables & priVars() const
Definition: common/volumevariables.hh:42
Scalar priVar(const int pvIdx) const
Definition: common/volumevariables.hh:39
Scalar extrusionFactor() const
Definition: common/volumevariables.hh:46
typename Traits::PrimaryVariables PrimaryVariables
export the type used for the primary variables
Definition: common/volumevariables.hh:25
void update(const ElementSolution &elemSol, const Problem &problem, const Element &element, const SubControlVolume &scv)
Update all quantities for a given control volume.
Definition: common/volumevariables.hh:31
Definition: adapt.hh:17