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#include <opm/input/eclipse/Schedule/Group/Group.hpp>
27#include <cstddef>
28#include <string>
29#include <vector>
30#include <map>
31
32namespace Opm {
33class Schedule;
34class SummaryState;
35//class Group;
36class UnitSystem;
37} // Opm
38
39namespace Opm { namespace RestartIO { namespace Helpers {
40
42{
43public:
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",
75 "GOPTS", "GGPTS",
76 "GWIT" , "GGIT" , "GVIT",
77 "GOPTH", "GWPTH", "GGPTH",
78 "GWITH", "GGITH",
79 "GOPGR", "GWPGR", "GGPGR", "GVPGR",
80 "GOIGR", "GWIGR", "GGIGR",
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 "FWITH", "FGITH"};
91
92 const std::map<std::string, size_t> groupKeyToIndex = {
93 {"GOPR", 0},
94 {"GWPR", 1},
95 {"GGPR", 2},
96 {"GVPR", 3},
97 {"GWIR", 5},
98 {"GGIR", 6},
99 {"GWCT", 8},
100 {"GGOR", 9},
101 {"GOPT", 10},
102 {"GWPT", 11},
103 {"GGPT", 12},
104 {"GVPT", 13},
105 {"GWIT", 15},
106 {"GGIT", 16},
107 {"GVIT", 17},
108 {"GOPP", 22},
109 {"GWPP", 23},
110 {"GOPTS", 73},
111 {"GGPTS", 74},
112 {"GOPGR", 85},
113 {"GWPGR", 86},
114 {"GGPGR", 87},
115 {"GVPGR", 88},
116 {"GOIGR", 89},
117 {"GWIGR", 91},
118 {"GGIGR", 93},
119 {"GOPTH", 135},
120 {"GWPTH", 139},
121 {"GWITH", 140},
122 {"GGPTH", 143},
123 {"GGITH", 144},
124 };
125
126 const std::map<std::string, size_t> fieldKeyToIndex = {
127 {"FOPR", 0},
128 {"FWPR", 1},
129 {"FGPR", 2},
130 {"FVPR", 3},
131 {"FWIR", 5},
132 {"FGIR", 6},
133 {"FWCT", 8},
134 {"FGOR", 9},
135 {"FOPT", 10},
136 {"FWPT", 11},
137 {"FGPT", 12},
138 {"FVPT", 13},
139 {"FWIT", 15},
140 {"FGIT", 16},
141 {"FVIT", 17},
142 {"FOPP", 22},
143 {"FWPP", 23},
144 {"FOPTS", 73},
145 {"FGPTS", 74},
146 {"FOPTH", 135},
147 {"FWPTH", 139},
148 {"FWITH", 140},
149 {"FGPTH", 143},
150 {"FGITH", 144},
151 };
152
153private:
155 WindowedArray<int> iGroup_;
156
158 WindowedArray<float> sGroup_;
159
161 WindowedArray<double> xGroup_;
162
165
167 int nWGMax_;
168
170 int nGMaxz_;
171};
172
173}}} // Opm::RestartIO::Helpers
174
175#endif // OPM_AGGREGATE_WELL_DATA_HPP
Provide facilities to simplify constructing restart vectors such as IWEL or RSEG.
Definition AggregateGroupData.hpp:42
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:131
Definition Schedule.hpp:133
Definition SummaryState.hpp:68
Definition UnitSystem.hpp:33
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30