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 };
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",
86 "FOPTS", "FGPTS",
87 "FWIT" , "FGIT" , "FVIT",
88 "FOPTH", "FWPTH", "FGPTH",
89 "FWITH", "FGITH"};
90
91 const std::map<std::string, size_t> groupKeyToIndex = {
92 {"GOPR", 0},
93 {"GWPR", 1},
94 {"GGPR", 2},
95 {"GVPR", 3},
96 {"GWIR", 5},
97 {"GGIR", 6},
98 {"GWCT", 8},
99 {"GGOR", 9},
100 {"GOPT", 10},
101 {"GWPT", 11},
102 {"GGPT", 12},
103 {"GVPT", 13},
104 {"GWIT", 15},
105 {"GGIT", 16},
106 {"GVIT", 17},
107 {"GOPP", 22},
108 {"GWPP", 23},
109 {"GOPTS", 73},
110 {"GGPTS", 74},
111 {"GOPGR", 85},
112 {"GWPGR", 86},
113 {"GGPGR", 87},
114 {"GVPGR", 88},
115 {"GOIGR", 89},
116 {"GWIGR", 91},
117 {"GGIGR", 93},
118 {"GOPTH", 135},
119 {"GWPTH", 139},
120 {"GWITH", 140},
121 {"GGPTH", 143},
122 {"GGITH", 144},
123 };
124
125 const std::map<std::string, size_t> fieldKeyToIndex = {
126 {"FOPR", 0},
127 {"FWPR", 1},
128 {"FGPR", 2},
129 {"FVPR", 3},
130 {"FWIR", 5},
131 {"FGIR", 6},
132 {"FWCT", 8},
133 {"FGOR", 9},
134 {"FOPT", 10},
135 {"FWPT", 11},
136 {"FGPT", 12},
137 {"FVPT", 13},
138 {"FWIT", 15},
139 {"FGIT", 16},
140 {"FVIT", 17},
141 {"FOPP", 22},
142 {"FWPP", 23},
143 {"FOPTS", 73},
144 {"FGPTS", 74},
145 {"FOPTH", 135},
146 {"FWPTH", 139},
147 {"FWITH", 140},
148 {"FGPTH", 143},
149 {"FGITH", 144},
150 };
151
152private:
154 WindowedArray<int> iGroup_;
155
157 WindowedArray<float> sGroup_;
158
160 WindowedArray<double> xGroup_;
161
164
166 int nWGMax_;
167
169 int nGMaxz_;
170};
171
172}}} // Opm::RestartIO::Helpers
173
174#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:131
Definition Schedule.hpp:88
Definition SummaryState.hpp:68
Definition UnitSystem.hpp:34
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30