OpenCAEPoro  0.2.0 Sep/22/2022
A simulator for multicomponent porous media flow
Public Member Functions | Public Attributes | List of all members
ParamOutput Class Reference

#include <ParamOutput.hpp>

Public Member Functions

void InputSUMMARY (ifstream &ifs)
 
void InputType_A (ifstream &ifs, Type_A_o &obj)
 
void InputType_B (ifstream &ifs, Type_B_o &obj)
 
void InputRPTSCHED (ifstream &ifs)
 

Public Attributes

OutputSummary summary
 See OutputSummary.
 
OutputDetail detailInfo
 See OutputDetail.
 

Detailed Description

ParamOutput is an internal structure used to stores the information of outputting from input files. It is an intermediate interface and independent of the main simulator. After all file inputting finishs, the params in it will pass to corresponding modules.

Definition at line 122 of file ParamOutput.hpp.

Member Function Documentation

◆ InputRPTSCHED()

void ParamOutput::InputRPTSCHED ( ifstream &  ifs)

Input the keyword RPTSCHED, which tells which detailed information will be output to the RPTfile.

Definition at line 183 of file ParamOutput.cpp.

184 {
185  vector<string> vbuf;
186  while (ReadLine(ifs, vbuf)) {
187  if (vbuf[0] == "/") break;
188 
189  USI len = vbuf.size();
190 
191  for (USI i = 0; i < len; i++) {
192 
193  string keyword = vbuf[i];
194 
195  switch (Map_Str2Int(&keyword[0], keyword.size())) {
196  case Map_Str2Int("PRES", 4):
197  case Map_Str2Int("PRESSURE", 8):
198  detailInfo.PRE = true;
199  break;
200  case Map_Str2Int("PGAS", 4):
201  detailInfo.PGAS = true;
202  break;
203  case Map_Str2Int("PWAT", 4):
204  detailInfo.PWAT = true;
205  break;
206  case Map_Str2Int("SOIL", 4):
207  detailInfo.SOIL = true;
208  break;
209  case Map_Str2Int("SGAS", 4):
210  detailInfo.SGAS = true;
211  break;
212  case Map_Str2Int("SWAT", 4):
213  detailInfo.SWAT = true;
214  break;
215  case Map_Str2Int("DENO", 4):
216  detailInfo.DENO = true;
217  break;
218  case Map_Str2Int("DENG", 4):
219  detailInfo.DENG = true;
220  break;
221  case Map_Str2Int("DENW", 4):
222  detailInfo.DENW = true;
223  break;
224  case Map_Str2Int("KRO", 3):
225  detailInfo.KRO = true;
226  break;
227  case Map_Str2Int("KRG", 3):
228  detailInfo.KRG = true;
229  break;
230  case Map_Str2Int("KRW", 3):
231  detailInfo.KRW = true;
232  break;
233  case Map_Str2Int("BOIL", 4):
234  detailInfo.BOIL = true;
235  break;
236  case Map_Str2Int("BGAS", 4):
237  detailInfo.BGAS = true;
238  break;
239  case Map_Str2Int("BWAT", 4):
240  detailInfo.BWAT = true;
241  break;
242  case Map_Str2Int("VOIL", 4):
243  detailInfo.VOIL = true;
244  break;
245  case Map_Str2Int("VGAS", 4):
246  detailInfo.VGAS = true;
247  break;
248  case Map_Str2Int("VWAT", 4):
249  detailInfo.VWAT = true;
250  break;
251  case Map_Str2Int("XMF", 3):
252  detailInfo.XMF = true;
253  break;
254  case Map_Str2Int("YMF", 3):
255  detailInfo.YMF = true;
256  break;
257  case Map_Str2Int("PCW", 3):
258  detailInfo.PCW = true;
259  break;
260  default:
261  break;
262  }
263  }
264  }
265  cout << "RPTSCHDE" << endl;
266 }
unsigned int USI
Generic unsigned integer.
Definition: OCPConst.hpp:22
constexpr long long Map_Str2Int(const char *mystr, const USI &len)
Definition: UtilInput.hpp:34
bool ReadLine(ifstream &ifs, vector< string > &result)
Definition: UtilInput.cpp:14
OutputDetail detailInfo
See OutputDetail.

References OutputDetail::BGAS, OutputDetail::BOIL, OutputDetail::BWAT, OutputDetail::DENG, OutputDetail::DENO, OutputDetail::DENW, detailInfo, OutputDetail::KRG, OutputDetail::KRO, OutputDetail::KRW, Map_Str2Int(), OutputDetail::PCW, OutputDetail::PGAS, OutputDetail::PRE, OutputDetail::PWAT, ReadLine(), OutputDetail::SGAS, OutputDetail::SOIL, OutputDetail::SWAT, OutputDetail::VGAS, OutputDetail::VOIL, OutputDetail::VWAT, OutputDetail::XMF, and OutputDetail::YMF.

◆ InputSUMMARY()

void ParamOutput::InputSUMMARY ( ifstream &  ifs)

Input the keyword SUMMARY, which contains many subkeyword, indicating which results are interested by user. After the simulation, these results will be output into a summary file.

Definition at line 14 of file ParamOutput.cpp.

15 {
16  vector<string> vbuf;
17  while (ReadLine(ifs, vbuf)) {
18  if (vbuf[0] == "/") break;
19  string keyword = vbuf[0];
20 
21  switch (Map_Str2Int(&keyword[0], keyword.size())) {
22  case Map_Str2Int("FPR", 3):
23  summary.FPR = true;
24  break;
25 
26  // Field
27  case Map_Str2Int("FOPR", 4):
28  summary.FOPR = true;
29  break;
30 
31  case Map_Str2Int("FOPT", 4):
32  summary.FOPT = true;
33  break;
34 
35  case Map_Str2Int("FGPR", 4):
36  summary.FGPR = true;
37  break;
38 
39  case Map_Str2Int("FGPT", 4):
40  summary.FGPt = true;
41  break;
42 
43  case Map_Str2Int("FWPR", 4):
44  summary.FWPR = true;
45  break;
46 
47  case Map_Str2Int("FWPT", 4):
48  summary.FWPT = true;
49  break;
50 
51  case Map_Str2Int("FGIR", 4):
52  summary.FGIR = true;
53  break;
54 
55  case Map_Str2Int("FGIT", 4):
56  summary.FGIT = true;
57  break;
58 
59  case Map_Str2Int("FWIR", 4):
60  summary.FWIR = true;
61  break;
62 
63  case Map_Str2Int("FWIT", 4):
64  summary.FWIT = true;
65  break;
66 
67  // Well
68  case Map_Str2Int("WOPR", 4):
69  InputType_A(ifs, summary.WOPR);
70  break;
71 
72  case Map_Str2Int("WOPT", 4):
73  InputType_A(ifs, summary.WOPT);
74  break;
75 
76  case Map_Str2Int("WGPR", 4):
77  InputType_A(ifs, summary.WGPR);
78  break;
79 
80  case Map_Str2Int("WGPT", 4):
81  InputType_A(ifs, summary.WGPT);
82  break;
83 
84  case Map_Str2Int("WWPR", 4):
85  InputType_A(ifs, summary.WWPR);
86  break;
87 
88  case Map_Str2Int("WWPT", 4):
89  InputType_A(ifs, summary.WWPT);
90  break;
91 
92  case Map_Str2Int("WGIR", 4):
93  InputType_A(ifs, summary.WGIR);
94  break;
95 
96  case Map_Str2Int("WGIT", 4):
97  InputType_A(ifs, summary.WGIT);
98  break;
99 
100  case Map_Str2Int("WWIR", 4):
101  InputType_A(ifs, summary.WWIR);
102  break;
103 
104  case Map_Str2Int("WWIT", 4):
105  InputType_A(ifs, summary.WWIT);
106  break;
107 
108  case Map_Str2Int("WBHP", 4):
109  InputType_A(ifs, summary.WBHP);
110  break;
111 
112  case Map_Str2Int("DG", 2):
113  InputType_A(ifs, summary.DG);
114  break;
115 
116  case Map_Str2Int("BPR", 3):
117  InputType_B(ifs, summary.BPR);
118  break;
119 
120  case Map_Str2Int("SOIL", 4):
121  InputType_B(ifs, summary.SOIL);
122  break;
123 
124  case Map_Str2Int("SGAS", 4):
125  InputType_B(ifs, summary.SGAS);
126  break;
127 
128  case Map_Str2Int("SWAT", 4):
129  InputType_B(ifs, summary.SWAT);
130  break;
131  default:
132  break;
133  }
134  }
135  cout << "SUMMARY" << endl;
136 }
void InputType_A(ifstream &ifs, Type_A_o &obj)
void InputType_B(ifstream &ifs, Type_B_o &obj)
OutputSummary summary
See OutputSummary.

References OutputSummary::BPR, OutputSummary::DG, OutputSummary::FGIR, OutputSummary::FGIT, OutputSummary::FGPR, OutputSummary::FGPt, OutputSummary::FOPR, OutputSummary::FOPT, OutputSummary::FPR, OutputSummary::FWIR, OutputSummary::FWIT, OutputSummary::FWPR, OutputSummary::FWPT, InputType_A(), InputType_B(), Map_Str2Int(), ReadLine(), OutputSummary::SGAS, OutputSummary::SOIL, summary, OutputSummary::SWAT, OutputSummary::WBHP, OutputSummary::WGIR, OutputSummary::WGIT, OutputSummary::WGPR, OutputSummary::WGPT, OutputSummary::WOPR, OutputSummary::WOPT, OutputSummary::WWIR, OutputSummary::WWIT, OutputSummary::WWPR, and OutputSummary::WWPT.

◆ InputType_A()

void ParamOutput::InputType_A ( ifstream &  ifs,
Type_A_o obj 
)

Input the subkeyword in SUMMARY, the contents in these keyword is in the form of string.

Definition at line 138 of file ParamOutput.cpp.

139 {
140  obj.activity = true;
141  vector<string> vbuf;
142  ReadLine(ifs, vbuf);
143  if (vbuf[0] == "/") {
144  obj.obj.push_back("All");
145  } else {
146  OCP_INT len = vbuf.size();
147  for (OCP_INT i = 0; i < len - 1; i++) {
148  obj.obj.push_back(vbuf[i]);
149  }
150  if (vbuf.back() != "/") obj.obj.push_back(vbuf.back());
151 
152  while (ReadLine(ifs, vbuf)) {
153  if (vbuf[0] == "/") break;
154 
155  OCP_INT len = vbuf.size();
156  for (OCP_INT i = 0; i < len - 1; i++) {
157  obj.obj.push_back(vbuf[i]);
158  }
159  if (vbuf.back() != "/") obj.obj.push_back(vbuf.back());
160  }
161  }
162  cout << "Type_A" << endl;
163 }
int OCP_INT
Long integer.
Definition: OCPConst.hpp:25

References ReadLine().

◆ InputType_B()

void ParamOutput::InputType_B ( ifstream &  ifs,
Type_B_o obj 
)

Input the subkeyword in SUMMARY, the contents in these keyword is in the form of coordinates.

Definition at line 165 of file ParamOutput.cpp.

166 {
167 
168  vector<string> vbuf;
169  while (ReadLine(ifs, vbuf)) {
170  if (vbuf[0] == "/") break;
171 
172  obj.activity = true;
173  DealDefault(vbuf);
174  USI i = stoi(vbuf[0]);
175  USI j = stoi(vbuf[1]);
176  USI k = stoi(vbuf[2]);
177 
178  obj.obj.push_back(COOIJK(i, j, k));
179  }
180  cout << "Type_B" << endl;
181 }
void DealDefault(vector< string > &result)
Definition: UtilInput.cpp:50
A structure of three-dimensional coordinates.
Definition: ParamOutput.hpp:24

References DealDefault(), and ReadLine().


The documentation for this class was generated from the following files: