Line |
Branch |
Exec |
Source |
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 |
|
|
// |
7 |
|
|
/*! |
8 |
|
|
* \file |
9 |
|
|
* \ingroup Core |
10 |
|
|
* \brief Basic volume variables for finite volume methods |
11 |
|
|
*/ |
12 |
|
|
#ifndef DUMUX_COMMON_BASIC_VOLUME_VARIABLES_HH |
13 |
|
|
#define DUMUX_COMMON_BASIC_VOLUME_VARIABLES_HH |
14 |
|
|
|
15 |
|
|
#include <memory> |
16 |
|
|
|
17 |
|
|
namespace Dumux { |
18 |
|
|
|
19 |
|
|
template <class Traits> |
20 |
|
98880 |
class BasicVolumeVariables |
21 |
|
|
{ |
22 |
|
|
using Scalar = typename Traits::PrimaryVariables::value_type; |
23 |
|
|
public: |
24 |
|
|
//! export the type used for the primary variables |
25 |
|
|
using PrimaryVariables = typename Traits::PrimaryVariables; |
26 |
|
|
|
27 |
|
|
/*! |
28 |
|
|
* \brief Update all quantities for a given control volume |
29 |
|
|
*/ |
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 |
|
3273984 |
priVars_ = elemSol[scv.indexInElement()]; |
37 |
|
✗ |
} |
38 |
|
|
|
39 |
|
✗ |
Scalar priVar(const int pvIdx) const |
40 |
|
707883840 |
{ return priVars_[pvIdx]; } |
41 |
|
|
|
42 |
|
|
const PrimaryVariables& priVars() const |
43 |
|
49152 |
{ return priVars_; } |
44 |
|
|
|
45 |
|
|
// for compatibility with more general models |
46 |
|
✗ |
Scalar extrusionFactor() const |
47 |
|
✗ |
{ return 1.0; } |
48 |
|
|
|
49 |
|
|
private: |
50 |
|
|
PrimaryVariables priVars_; |
51 |
|
|
}; |
52 |
|
|
|
53 |
|
|
} // end namespace Dumux |
54 |
|
|
|
55 |
|
|
#endif |
56 |
|
|
|