My Project
Loading...
Searching...
No Matches
Actions.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 ActionCOnfig_HPP
22#define ActionCOnfig_HPP
23
24#include <string>
25#include <ctime>
26#include <vector>
27
28#include <opm/input/eclipse/Schedule/Action/ActionX.hpp>
29#include <opm/input/eclipse/Schedule/Action/PyAction.hpp>
30
31namespace Opm {
32namespace Action {
33
34class State;
35
36/*
37 The Actions class is a container of ACTIONX keywords. The main functionality
38 is to provide a list of ACTIONX keywords which are ready to be evaluated.
39*/
40
41class Actions {
42public:
43 Actions() = default;
44 Actions(const std::vector<ActionX>& action, const std::vector<PyAction>& pyactions);
45
46 static Actions serializationTestObject();
47
48 std::size_t py_size() const;
49 std::size_t ecl_size() const;
50 int max_input_lines() const;
51 bool empty() const;
52 void add(const ActionX& action);
53 void add(const PyAction& pyaction);
54 bool ready(const State& state, std::time_t sim_time) const;
55 const ActionX& operator[](const std::string& name) const;
56 const ActionX& operator[](std::size_t index) const;
57 std::vector<const ActionX *> pending(const State& state, std::time_t sim_time) const;
58 std::vector<const PyAction *> pending_python(const State& state) const;
59
60 bool has(const std::string& name) const;
61 std::vector<ActionX>::const_iterator begin() const;
62 std::vector<ActionX>::const_iterator end() const;
63
64 bool operator==(const Actions& data) const;
65
66 template<class Serializer>
67 void serializeOp(Serializer& serializer)
68 {
69 serializer(actions);
70 serializer(pyactions);
71 }
72
73private:
74 std::vector<ActionX> actions;
75 std::vector<PyAction> pyactions;
76};
77}
78}
79#endif
Definition ActionX.hpp:74
Definition Actions.hpp:41
Definition PyAction.hpp:41
Definition State.hpp:40
Class for (de-)serializing.
Definition Serializer.hpp:84
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30