intehead.hpp
Go to the documentation of this file.
1/*
2 Copyright 2016, 2017, 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_INTEHEAD_HEADER_INCLUDED
21#define OPM_INTEHEAD_HEADER_INCLUDED
22
23#include <array>
24#include <ctime>
25#include <memory>
26#include <vector>
27
28
29namespace Opm {
30
31class UnitSystem;
32
33namespace RestartIO {
34
36 {
37 public:
38 struct WellTableDim {
44 };
45
46 struct WellSegDims {
47 int nsegwl;
48 int nswlmx;
49 int nsegmx;
50 int nlbrmx;
51 int nisegz;
52 int nrsegz;
53 int nilbrz;
54 };
55
56 struct RegDims {
57 int ntfip;
58 int nmfipr;
59 int nrfreg;
60 int ntfreg;
61 int nplmix;
62 };
63
64 struct TimePoint {
65 int year;
66 int month; // 1..12
67 int day; // 1..31
68
69 int hour; // 0..23
70 int minute; // 0..59
71 int second; // 0..59
72
73 int microseconds; // 0..999999
74 };
75
76 struct Phases {
77 int oil;
78 int water;
79 int gas;
80 };
81
82 struct TuningPar {
83 int newtmx;
84 int newtmn;
85 int litmax;
86 int litmin;
87 int mxwsit;
88 int mxwpit;
89 };
90
91 struct Group {
93 };
94
95 struct UdqParam {
102 };
103
104 struct ActionParam {
109 };
110
113 };
114
116 ~InteHEAD() = default;
117
118 InteHEAD(const InteHEAD& rhs) = default;
119 InteHEAD(InteHEAD&& rhs) = default;
120
121 InteHEAD& operator=(const InteHEAD& rhs) = default;
122 InteHEAD& operator=(InteHEAD&& rhs) = default;
123
124 InteHEAD& dimensions(const int nx, const int ny, const int nz);
125 InteHEAD& dimensions(const std::array<int,3>& cartDims);
126 InteHEAD& numActive(const int nactive);
127
131 InteHEAD& activePhases(const Phases& phases);
132 InteHEAD& params_NWELZ(const int niwelz, const int nswelz, const int nxwelz, const int nzwelz);
133 InteHEAD& params_NCON(const int niconz, const int nsconz, const int nxconz);
134 InteHEAD& params_GRPZ(const std::array<int, 4>& grpz);
135 InteHEAD& params_NGCTRL(const int gct);
136 InteHEAD& params_NAAQZ(const int ncamax, const int niaaqz, const int nsaaqz, const int nxaaqz, const int nicaqz, const int nscaqz, const int nacaqz);
137 InteHEAD& stepParam(const int tstep, const int report_step);
139 InteHEAD& variousParam(const int version, const int iprog);
142 InteHEAD& ngroups(const Group& gr);
143 InteHEAD& udqParam_1(const UdqParam& udqpar);
148
149 const std::vector<int>& data() const
150 {
151 return this->data_;
152 }
153
154 private:
155 std::vector<int> data_;
156 };
157
158 std::time_t makeUTCTime(const std::tm& timePoint);
159
161 getSimulationTimePoint(const std::time_t start,
162 const double elapsed);
163}} // Opm::RestartIO
164
165#endif // OPM_INTEHEAD_HEADER_INCLUDED
Definition: intehead.hpp:36
InteHEAD & ngroups(const Group &gr)
InteHEAD & unitConventions(const UnitSystem &usys)
InteHEAD & dimensions(const int nx, const int ny, const int nz)
InteHEAD & params_NWELZ(const int niwelz, const int nswelz, const int nxwelz, const int nzwelz)
InteHEAD & params_NCON(const int niconz, const int nsconz, const int nxconz)
InteHEAD & udqParam_1(const UdqParam &udqpar)
InteHEAD & params_NAAQZ(const int ncamax, const int niaaqz, const int nsaaqz, const int nxaaqz, const int nicaqz, const int nscaqz, const int nacaqz)
InteHEAD(InteHEAD &&rhs)=default
InteHEAD & dimensions(const std::array< int, 3 > &cartDims)
InteHEAD & activePhases(const Phases &phases)
InteHEAD & variousUDQ_ACTIONXParam()
InteHEAD & variousParam(const int version, const int iprog)
InteHEAD & numActive(const int nactive)
InteHEAD & nominatedPhaseGuideRate(GuideRateNominatedPhase nphase)
InteHEAD & wellTableDimensions(const WellTableDim &wtdim)
InteHEAD & wellSegDimensions(const WellSegDims &wsdim)
const std::vector< int > & data() const
Definition: intehead.hpp:149
InteHEAD(const InteHEAD &rhs)=default
InteHEAD & params_NGCTRL(const int gct)
InteHEAD & stepParam(const int tstep, const int report_step)
InteHEAD & regionDimensions(const RegDims &rdim)
InteHEAD & whistControlMode(int mode)
InteHEAD & actionParam(const ActionParam &act_par)
InteHEAD & calendarDate(const TimePoint &date)
InteHEAD & params_GRPZ(const std::array< int, 4 > &grpz)
InteHEAD & tuningParam(const TuningPar &tunpar)
InteHEAD & operator=(const InteHEAD &rhs)=default
InteHEAD & operator=(InteHEAD &&rhs)=default
Definition: UnitSystem.hpp:32
std::time_t makeUTCTime(const std::tm &timePoint)
InteHEAD::TimePoint getSimulationTimePoint(const std::time_t start, const double elapsed)
Definition: A.hpp:4
static const char * version
Definition: exprtk.hpp:40016
static const char * date
Definition: exprtk.hpp:40020
Definition: intehead.hpp:104
int no_actions
Definition: intehead.hpp:105
int max_no_conditions_per_action
Definition: intehead.hpp:107
int max_no_characters_per_line
Definition: intehead.hpp:108
int max_no_sched_lines_per_action
Definition: intehead.hpp:106
Definition: intehead.hpp:91
int ngroups
Definition: intehead.hpp:92
int nominated_phase
Definition: intehead.hpp:112
Definition: intehead.hpp:76
int oil
Definition: intehead.hpp:77
int water
Definition: intehead.hpp:78
int gas
Definition: intehead.hpp:79
Definition: intehead.hpp:56
int nmfipr
Definition: intehead.hpp:58
int nplmix
Definition: intehead.hpp:61
int ntfreg
Definition: intehead.hpp:60
int ntfip
Definition: intehead.hpp:57
int nrfreg
Definition: intehead.hpp:59
Definition: intehead.hpp:64
int second
Definition: intehead.hpp:71
int microseconds
Definition: intehead.hpp:73
int day
Definition: intehead.hpp:67
int minute
Definition: intehead.hpp:70
int month
Definition: intehead.hpp:66
int year
Definition: intehead.hpp:65
int hour
Definition: intehead.hpp:69
Definition: intehead.hpp:82
int newtmx
Definition: intehead.hpp:83
int newtmn
Definition: intehead.hpp:84
int mxwpit
Definition: intehead.hpp:88
int litmax
Definition: intehead.hpp:85
int litmin
Definition: intehead.hpp:86
int mxwsit
Definition: intehead.hpp:87
Definition: intehead.hpp:95
int no_gudqs
Definition: intehead.hpp:98
int no_wudqs
Definition: intehead.hpp:97
int udqParam_1
Definition: intehead.hpp:96
int no_iuaps
Definition: intehead.hpp:101
int no_fudqs
Definition: intehead.hpp:99
int no_iuads
Definition: intehead.hpp:100
Definition: intehead.hpp:46
int nsegmx
Definition: intehead.hpp:49
int nisegz
Definition: intehead.hpp:51
int nlbrmx
Definition: intehead.hpp:50
int nilbrz
Definition: intehead.hpp:53
int nsegwl
Definition: intehead.hpp:47
int nrsegz
Definition: intehead.hpp:52
int nswlmx
Definition: intehead.hpp:48
Definition: intehead.hpp:38
int maxPerf
Definition: intehead.hpp:40
int maxWellInGroup
Definition: intehead.hpp:41
int maxGroupInField
Definition: intehead.hpp:42
int numWells
Definition: intehead.hpp:39
int maxWellsInField
Definition: intehead.hpp:43