My Project
Loading...
Searching...
No Matches
action.hpp
1/*
2 Copyright 2021 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 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 OPM is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with OPM. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#ifndef RST_ACTIONX
20#define RST_ACTIONX
21
22#include <ctime>
23#include <optional>
24#include <string>
25#include <variant>
26#include <vector>
27
28#include <opm/input/eclipse/Schedule/Action/Enums.hpp>
29#include <opm/input/eclipse/Deck/DeckKeyword.hpp>
30
31namespace Opm {
32
33namespace RestartIO {
34
35struct RstAction {
36 struct Quantity {
37 std::variant<std::string, double> quantity;
38 std::optional<std::string> wgname;
39
40 Quantity() = default;
41 Quantity(const std::string * zacn, double sacn_value);
42 explicit Quantity(const std::string& quantity);
43 explicit Quantity(double value);
44 };
45
46
47 struct Condition {
48 static bool valid(const std::string * zacn, const int * iacn);
49 Condition(const std::string * zacn, const int * iacn, const double * sacn);
50 Action::Logical logic;
51 Action::Comparator cmp_op;
52 Quantity lhs;
53 Quantity rhs;
54 bool left_paren{false};
55 bool right_paren{false};
56
57 std::vector<std::string> tokens() const;
58 };
59
60
61 RstAction(const std::string& name_arg, int max_run_arg, int run_count_arg,
62 double min_wait_arg, std::time_t start_time, std::time_t last_run,
63 const std::vector<Condition>& conditions_arg);
64
65 std::string name;
66 int max_run;
67 int run_count;
68 double min_wait;
69 std::time_t start_time;
70 std::optional<std::time_t> last_run;
71 std::vector<Condition> conditions;
72 std::vector<DeckKeyword> keywords;
73};
74
75}
76}
77
78
79
80#endif
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
Definition action.hpp:47
Definition action.hpp:36
Definition action.hpp:35