3.2-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
parametercachebase.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 *****************************************************************************/
24#ifndef DUMUX_PARAMETER_CACHE_BASE_HH
25#define DUMUX_PARAMETER_CACHE_BASE_HH
26
27namespace Dumux {
28
33template <class Implementation>
35{
36public:
38 None = 0,
41 Composition = 4
42 };
43
51 template <class FluidState>
52 void updateAll(const FluidState &fs, int exceptQuantities = None)
53 {
54 for (int phaseIdx = 0; phaseIdx < FluidState::numPhases; ++phaseIdx)
55 asImp_().updatePhase(fs, phaseIdx);
56 }
57
62 template <class FluidState>
63 void updateAllPressures(const FluidState &fs)
64 {
65 for (int phaseIdx = 0; phaseIdx < FluidState::numPhases; ++phaseIdx)
66 asImp_().updatePhase(fs, phaseIdx);
67 }
68
73 template <class FluidState>
74 void updateAllTemperatures(const FluidState &fs)
75 {
76 for (int phaseIdx = 0; phaseIdx < FluidState::numPhases; ++phaseIdx)
77 asImp_().updatePhase(fs, phaseIdx);
78 }
79
86 template <class FluidState>
87 void updatePhase(const FluidState &fs, int phaseIdx, int exceptQuantities = None)
88 {}
89
98 template <class FluidState>
99 void updateTemperature(const FluidState &fs, int phaseIdx)
100 {
101 asImp_().updatePhase(fs, phaseIdx);
102 }
103
112 template <class FluidState>
113 void updatePressure(const FluidState &fs, int phaseIdx)
114 {
115 asImp_().updatePhase(fs, phaseIdx);
116 }
117
126 template <class FluidState>
127 void updateComposition(const FluidState &fs, int phaseIdx)
128 {
129 asImp_().updatePhase(fs, phaseIdx, /*except=*/Temperature | Pressure);
130 }
131
141 template <class FluidState>
142 void updateSingleMoleFraction(const FluidState &fs,
143 int phaseIdx,
144 int compIdx)
145 {
146 asImp_().updateComposition(fs, phaseIdx);
147 }
148
149private:
150 Implementation &asImp_()
151 { return *static_cast<Implementation*>(this); }
152};
153
154} // end namespace
155
156#endif
Definition: adapt.hh:29
The base class of the parameter cache classes for fluid systems.
Definition: parametercachebase.hh:35
void updateSingleMoleFraction(const FluidState &fs, int phaseIdx, int compIdx)
Update all cached parameters of a specific fluid phase which depend on the mole fraction of a single ...
Definition: parametercachebase.hh:142
void updatePhase(const FluidState &fs, int phaseIdx, int exceptQuantities=None)
Update all cached parameters of a specific fluid phase.
Definition: parametercachebase.hh:87
void updateAll(const FluidState &fs, int exceptQuantities=None)
Update all cached quantities for all phases.
Definition: parametercachebase.hh:52
void updateAllPressures(const FluidState &fs)
Update all cached quantities which depend on the pressure of any fluid phase.
Definition: parametercachebase.hh:63
void updateComposition(const FluidState &fs, int phaseIdx)
Update all cached parameters of a specific fluid phase which depend on composition.
Definition: parametercachebase.hh:127
void updateTemperature(const FluidState &fs, int phaseIdx)
Update all cached parameters of a specific fluid phase which depend on temperature.
Definition: parametercachebase.hh:99
void updateAllTemperatures(const FluidState &fs)
Update all cached quantities which depend on the temperature of any fluid phase.
Definition: parametercachebase.hh:74
ExceptQuantities
Definition: parametercachebase.hh:37
@ Composition
Definition: parametercachebase.hh:41
@ Pressure
Definition: parametercachebase.hh:40
@ Temperature
Definition: parametercachebase.hh:39
@ None
Definition: parametercachebase.hh:38
void updatePressure(const FluidState &fs, int phaseIdx)
Update all cached parameters of a specific fluid phase which depend on pressure.
Definition: parametercachebase.hh:113