My Project
Loading...
Searching...
No Matches
ActionContext.hpp
1/*
2 Copyright 2018 Equinor ASA.
3
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM 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 OPM 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 OPM. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20
21#ifndef ActionContext_HPP
22#define ActionContext_HPP
23
24#include <map>
25#include <string>
26#include <vector>
27
28namespace Opm {
29
30class SummaryState;
31class WListManager;
32
33namespace Action {
34
35/*
36 The Action::Context class is used as context when the ACTIONX condition is
37 evaluated. The Action::Context class is mainly just a thin wrapper around the
38 SummaryState class.
39*/
40
41class Context {
42public:
43 explicit Context(const SummaryState& summary_state, const WListManager& wlm);
44
45 /*
46 The get methods will first check the internal storage in the 'values' map
47 and then subsequently query the SummaryState member.
48 */
49 double get(const std::string& func, const std::string& arg) const;
50 void add(const std::string& func, const std::string& arg, double value);
51
52 double get(const std::string& func) const;
53 void add(const std::string& func, double value);
54
55 std::vector<std::string> wells(const std::string& func) const;
56 const WListManager& wlist_manager() const;
57
58private:
59 const SummaryState& summary_state;
60 const WListManager& wlm;
61 std::map<std::string, double> values;
62};
63}
64}
65#endif
Definition ActionContext.hpp:41
Definition SummaryState.hpp:68
Definition WListManager.hpp:34
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30