OpenCAEPoro  v0.5.0
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, const string &keyword)
 

Public Attributes

OutputSummary summary
 See OutputSummary.
 
OutputRPTParam outRPTParam
 See OutputRPTParam.
 
OutputVTKParam outVTKParam
 See OutputVTKParam.
 

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 finishes, the params in it will pass to corresponding modules.

Definition at line 137 of file ParamOutput.hpp.

Member Function Documentation

◆ InputRPTSCHED()

void ParamOutput::InputRPTSCHED ( ifstream &  ifs,
const string &  keyword 
)

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

Definition at line 187 of file ParamOutput.cpp.

188 {
189  BasicGridPropertyParam* tmpBgpp;
190  if (keyword == "RPTSCHED") {
191  outRPTParam.useRPT = OCP_TRUE;
192  tmpBgpp = &outRPTParam.bgp;
193  } else if (keyword == "VTKSCHED") {
194  outVTKParam.useVTK = OCP_TRUE;
195  tmpBgpp = &outVTKParam.bgp;
196  } else {
197  return;
198  }
199 
200  vector<string> vbuf;
201  while (ReadLine(ifs, vbuf)) {
202  if (vbuf[0] == "/") break;
203 
204  USI len = vbuf.size();
205 
206  for (USI i = 0; i < len; i++) {
207 
208  string keyword = vbuf[i];
209 
210  switch (Map_Str2Int(&keyword[0], keyword.size())) {
211  case Map_Str2Int("PRES", 4):
212  case Map_Str2Int("PRESSURE", 8):
213  tmpBgpp->PRE = OCP_TRUE;
214  break;
215  case Map_Str2Int("PGAS", 4):
216  tmpBgpp->PGAS = OCP_TRUE;
217  break;
218  case Map_Str2Int("PWAT", 4):
219  tmpBgpp->PWAT = OCP_TRUE;
220  break;
221  case Map_Str2Int("SOIL", 4):
222  tmpBgpp->SOIL = OCP_TRUE;
223  break;
224  case Map_Str2Int("SGAS", 4):
225  tmpBgpp->SGAS = OCP_TRUE;
226  break;
227  case Map_Str2Int("SWAT", 4):
228  tmpBgpp->SWAT = OCP_TRUE;
229  break;
230  case Map_Str2Int("DENO", 4):
231  tmpBgpp->DENO = OCP_TRUE;
232  break;
233  case Map_Str2Int("DENG", 4):
234  tmpBgpp->DENG = OCP_TRUE;
235  break;
236  case Map_Str2Int("DENW", 4):
237  tmpBgpp->DENW = OCP_TRUE;
238  break;
239  case Map_Str2Int("KRO", 3):
240  tmpBgpp->KRO = OCP_TRUE;
241  break;
242  case Map_Str2Int("KRG", 3):
243  tmpBgpp->KRG = OCP_TRUE;
244  break;
245  case Map_Str2Int("KRW", 3):
246  tmpBgpp->KRW = OCP_TRUE;
247  break;
248  case Map_Str2Int("BOIL", 4):
249  tmpBgpp->BOIL = OCP_TRUE;
250  break;
251  case Map_Str2Int("BGAS", 4):
252  tmpBgpp->BGAS = OCP_TRUE;
253  break;
254  case Map_Str2Int("BWAT", 4):
255  tmpBgpp->BWAT = OCP_TRUE;
256  break;
257  case Map_Str2Int("VOIL", 4):
258  tmpBgpp->VOIL = OCP_TRUE;
259  break;
260  case Map_Str2Int("VGAS", 4):
261  tmpBgpp->VGAS = OCP_TRUE;
262  break;
263  case Map_Str2Int("VWAT", 4):
264  tmpBgpp->VWAT = OCP_TRUE;
265  break;
266  case Map_Str2Int("XMF", 3):
267  tmpBgpp->XMF = OCP_TRUE;
268  break;
269  case Map_Str2Int("YMF", 3):
270  tmpBgpp->YMF = OCP_TRUE;
271  break;
272  case Map_Str2Int("PCW", 3):
273  tmpBgpp->PCW = OCP_TRUE;
274  break;
275  default:
276  break;
277  }
278  }
279  }
280  // cout << keyword << endl;
281 }
unsigned int USI
Generic unsigned integer.
Definition: OCPConst.hpp:23
OCP_BOOL ReadLine(ifstream &ifs, vector< string > &result)
Definition: UtilInput.cpp:14
constexpr long long Map_Str2Int(const char *mystr, const USI &len)
Definition: UtilInput.hpp:34
OutputVTKParam outVTKParam
See OutputVTKParam.
OutputRPTParam outRPTParam
See OutputRPTParam.

References outRPTParam.

◆ InputSUMMARY()

void ParamOutput::InputSUMMARY ( ifstream &  ifs)

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

References OutputSummary::FPR, Map_Str2Int(), ReadLine(), and summary.

◆ InputType_A()

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

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

Definition at line 142 of file ParamOutput.cpp.

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

◆ InputType_B()

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

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

Definition at line 169 of file ParamOutput.cpp.

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

References ReadLine().


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