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