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-FileCopyrightText: 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 PorousmediumflowModels | ||
10 | * \brief Base class for the model specific class which provides | ||
11 | * access to all volume averaged quantities. | ||
12 | */ | ||
13 | |||
14 | #ifndef DUMUX_POROUSMEDIUMFLOW_VOLUME_VARIABLES_HH | ||
15 | #define DUMUX_POROUSMEDIUMFLOW_VOLUME_VARIABLES_HH | ||
16 | |||
17 | namespace Dumux { | ||
18 | |||
19 | /*! | ||
20 | * \ingroup PorousmediumflowModels | ||
21 | * \brief The isothermal base class. | ||
22 | * | ||
23 | * \tparam Traits The volume variables traits | ||
24 | * \tparam Impl The implementation of the volume variables | ||
25 | */ | ||
26 | template<class Traits> | ||
27 |
20/26✗ Branch 0 not taken.
✓ Branch 1 taken 1054103 times.
✓ Branch 2 taken 15494 times.
✓ Branch 3 taken 116506 times.
✓ Branch 4 taken 403901 times.
✓ Branch 5 taken 174064 times.
✓ Branch 7 taken 290240 times.
✓ Branch 8 taken 161136 times.
✓ Branch 9 taken 2373419 times.
✓ Branch 10 taken 497431 times.
✓ Branch 12 taken 12207432 times.
✓ Branch 13 taken 3384 times.
✓ Branch 14 taken 77648 times.
✓ Branch 15 taken 517000 times.
✗ Branch 16 not taken.
✓ Branch 17 taken 609154 times.
✓ Branch 18 taken 40 times.
✓ Branch 19 taken 80 times.
✓ Branch 20 taken 8112 times.
✗ Branch 21 not taken.
✓ Branch 23 taken 97376 times.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✓ Branch 26 taken 1354 times.
✓ Branch 6 taken 183235 times.
✗ Branch 11 not taken.
|
200772075 | class PorousMediumFlowVolumeVariables |
28 | { | ||
29 | using Scalar = typename Traits::PrimaryVariables::value_type; | ||
30 | |||
31 | public: | ||
32 | //! Export the type used for the primary variables | ||
33 | using PrimaryVariables = typename Traits::PrimaryVariables; | ||
34 | //! Export the type encapsulating primary variable indices | ||
35 | using Indices = typename Traits::ModelTraits::Indices; | ||
36 | |||
37 | //! Return number of phases considered by the model | ||
38 | static constexpr int numFluidPhases() { return Traits::ModelTraits::numFluidPhases(); } | ||
39 | //! Return number of components considered by the model | ||
40 | static constexpr int numFluidComponents() { return Traits::ModelTraits::numFluidComponents(); } | ||
41 | |||
42 | /*! | ||
43 | * \brief Updates all quantities for a given control volume. | ||
44 | * | ||
45 | * \param elemSol A vector containing all primary variables connected to the element | ||
46 | * \param problem The object specifying the problem which ought to | ||
47 | * be simulated | ||
48 | * \param element An element which contains part of the control volume | ||
49 | * \param scv The sub-control volume | ||
50 | */ | ||
51 | template<class ElemSol, class Problem, class Element, class Scv> | ||
52 |
2/2✓ Branch 0 taken 5160 times.
✓ Branch 1 taken 36120 times.
|
378842439 | void update(const ElemSol& elemSol, |
53 | const Problem& problem, | ||
54 | const Element& element, | ||
55 | const Scv& scv) | ||
56 | { | ||
57 |
2/2✓ Branch 0 taken 5160 times.
✓ Branch 1 taken 36120 times.
|
378842599 | priVars_ = elemSol[scv.localDofIndex()]; |
58 |
9/13✓ Branch 6 taken 80 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 80 times.
✓ Branch 10 taken 60 times.
✓ Branch 12 taken 80 times.
✗ Branch 13 not taken.
✗ Branch 11 not taken.
✓ Branch 4 taken 1200 times.
✓ Branch 5 taken 644 times.
✓ Branch 2 taken 3262 times.
✗ Branch 3 not taken.
✓ Branch 0 taken 9012498 times.
✓ Branch 1 taken 6490004 times.
|
378648131 | extrusionFactor_ = problem.spatialParams().extrusionFactor(element, scv, elemSol); |
59 | 4634250 | } | |
60 | |||
61 | /*! | ||
62 | * \brief Returns the vector of primary variables. | ||
63 | */ | ||
64 | 12463493 | const PrimaryVariables &priVars() const | |
65 |
2/3✓ Branch 1 taken 3392 times.
✗ Branch 2 not taken.
✓ Branch 0 taken 1 times.
|
81766364 | { return priVars_; } |
66 | |||
67 | /*! | ||
68 | * \brief Returns a component of primary variable vector. | ||
69 | * | ||
70 | * \param pvIdx The index of the primary variable of interest | ||
71 | */ | ||
72 | Scalar priVar(const int pvIdx) const | ||
73 | { return priVars_[pvIdx]; } | ||
74 | |||
75 | /*! | ||
76 | * \brief Returns how much the sub-control volume is extruded. | ||
77 | * | ||
78 | * This means the factor by which a lower-dimensional (1D or 2D) | ||
79 | * entity needs to be expanded to get a full dimensional cell. The | ||
80 | * default is 1.0 which means that 1D problems are actually | ||
81 | * thought as pipes with a cross section of 1 m^2 and 2D problems | ||
82 | * are assumed to extend 1 m to the back. | ||
83 | */ | ||
84 | 6222432288 | Scalar extrusionFactor() const | |
85 |
28/37✓ Branch 1 taken 184204945 times.
✓ Branch 2 taken 451608267 times.
✓ Branch 4 taken 420754596 times.
✓ Branch 5 taken 46130561 times.
✓ Branch 6 taken 78272035 times.
✓ Branch 7 taken 130099540 times.
✓ Branch 8 taken 22017097 times.
✓ Branch 9 taken 76693092 times.
✓ Branch 10 taken 10490331 times.
✓ Branch 11 taken 986909 times.
✓ Branch 12 taken 96495384 times.
✓ Branch 13 taken 212730 times.
✓ Branch 14 taken 1723148 times.
✓ Branch 15 taken 2710 times.
✓ Branch 16 taken 1650840 times.
✓ Branch 17 taken 114544 times.
✓ Branch 18 taken 41630 times.
✓ Branch 19 taken 33696 times.
✓ Branch 21 taken 20439 times.
✓ Branch 22 taken 55944 times.
✓ Branch 3 taken 413297648 times.
✓ Branch 0 taken 652226847 times.
✓ Branch 20 taken 137516 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 27972 times.
✗ Branch 26 not taken.
✓ Branch 24 taken 145040 times.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✓ Branch 29 taken 55944 times.
✗ Branch 30 not taken.
✓ Branch 31 taken 27972 times.
✓ Branch 32 taken 27972 times.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
✗ Branch 36 not taken.
✗ Branch 37 not taken.
|
6026031251 | { return extrusionFactor_; } |
86 | |||
87 | private: | ||
88 | PrimaryVariables priVars_; | ||
89 | Scalar extrusionFactor_; | ||
90 | }; | ||
91 | |||
92 | } // end namespace Dumux | ||
93 | |||
94 | #endif | ||
95 |