My Project
AggregateGroupData.hpp
1 /*
2  Copyright (c) 2018 Statoil 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 #ifndef OPM_AGGREGATE_GROUP_DATA_HPP
21 #define OPM_AGGREGATE_GROUP_DATA_HPP
22 
24 
25 #include <opm/io/eclipse/PaddedOutputString.hpp>
26 #include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
27 #include <cstddef>
28 #include <string>
29 #include <vector>
30 #include <map>
31 
32 namespace Opm {
33 class Schedule;
34 class SummaryState;
35 //class Group;
36 class UnitSystem;
37 } // Opm
38 
39 namespace Opm { namespace RestartIO { namespace Helpers {
40 
42 {
43 public:
44  explicit AggregateGroupData(const std::vector<int>& inteHead);
45 
46  void captureDeclaredGroupData(const Opm::Schedule& sched,
47  const Opm::UnitSystem& units,
48  const std::size_t simStep,
49  const Opm::SummaryState& sumState,
50  const std::vector<int>& inteHead);
51 
52  const std::vector<int>& getIGroup() const
53  {
54  return this->iGroup_.data();
55  }
56 
57  const std::vector<float>& getSGroup() const
58  {
59  return this->sGroup_.data();
60  }
61 
62  const std::vector<double>& getXGroup() const
63  {
64  return this->xGroup_.data();
65  }
66 
67  const std::vector<EclIO::PaddedOutputString<8>>& getZGroup() const
68  {
69  return this->zGroup_.data();
70  }
71 
72  const std::vector<std::string> restart_group_keys = {"GOPP", "GWPP", "GOPR", "GWPR", "GGPR",
73  "GVPR", "GWIR", "GGIR", "GWCT", "GGOR",
74  "GOPT", "GWPT", "GGPT", "GVPT", "GWIT",
75  "GGIT", "GVIT",
76  "GOPTH", "GWPTH", "GGPTH",
77  "GWITH", "GGITH",
78  "GOPGR", "GWPGR", "GGPGR", "GVPGR",
79  "GOIGR", "GWIGR", "GGIGR",
80  };
81 
82  // Note: guide rates don't exist at the FIELD level.
83  const std::vector<std::string> restart_field_keys = {"FOPP", "FWPP", "FOPR", "FWPR", "FGPR",
84  "FVPR", "FWIR", "FGIR", "FWCT", "FGOR",
85  "FOPT", "FWPT", "FGPT", "FVPT", "FWIT",
86  "FGIT", "FVIT",
87  "FOPTH", "FWPTH", "FGPTH",
88  "FWITH", "FGITH"};
89 
90  const std::map<std::string, size_t> groupKeyToIndex = {
91  {"GOPR", 0},
92  {"GWPR", 1},
93  {"GGPR", 2},
94  {"GVPR", 3},
95  {"GWIR", 5},
96  {"GGIR", 6},
97  {"GWCT", 8},
98  {"GGOR", 9},
99  {"GOPT", 10},
100  {"GWPT", 11},
101  {"GGPT", 12},
102  {"GVPT", 13},
103  {"GWIT", 15},
104  {"GGIT", 16},
105  {"GVIT", 17},
106  {"GOPP", 22},
107  {"GWPP", 23},
108  {"GOPGR", 85},
109  {"GWPGR", 86},
110  {"GGPGR", 87},
111  {"GVPGR", 88},
112  {"GOIGR", 89},
113  {"GWIGR", 91},
114  {"GGIGR", 93},
115  {"GOPTH", 135},
116  {"GWPTH", 139},
117  {"GWITH", 140},
118  {"GGPTH", 143},
119  {"GGITH", 144},
120  };
121 
122  const std::map<std::string, size_t> fieldKeyToIndex = {
123  {"FOPR", 0},
124  {"FWPR", 1},
125  {"FGPR", 2},
126  {"FVPR", 3},
127  {"FWIR", 5},
128  {"FGIR", 6},
129  {"FWCT", 8},
130  {"FGOR", 9},
131  {"FOPT", 10},
132  {"FWPT", 11},
133  {"FGPT", 12},
134  {"FVPT", 13},
135  {"FWIT", 15},
136  {"FGIT", 16},
137  {"FVIT", 17},
138  {"FOPP", 22},
139  {"FWPP", 23},
140  {"FOPTH", 135},
141  {"FWPTH", 139},
142  {"FWITH", 140},
143  {"FGPTH", 143},
144  {"FGITH", 144},
145  };
146 
147 private:
149  WindowedArray<int> iGroup_;
150 
152  WindowedArray<float> sGroup_;
153 
155  WindowedArray<double> xGroup_;
156 
159 
161  int nWGMax_;
162 
164  int nGMaxz_;
165 };
166 
167 }}} // Opm::RestartIO::Helpers
168 
169 #endif // OPM_AGGREGATE_WELL_DATA_HPP
Provide facilities to simplify constructing restart vectors such as IWEL or RSEG.
Definition: AggregateGroupData.hpp:42
const std::vector< T > & data() const
Get read-only access to full, linearised data items for all windows.
Definition: WindowedArray.hpp:131
Definition: Schedule.hpp:135
Definition: SummaryState.hpp:69
Definition: UnitSystem.hpp:34
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29