Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FluRegion.C
Go to the documentation of this file.
1 /* *******************************************************************
2  * Rocstar Simulation Suite *
3  * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4  * *
5  * Illinois Rocstar LLC *
6  * Champaign, IL *
7  * www.illinoisrocstar.com *
8  * sales@illinoisrocstar.com *
9  * *
10  * License: See LICENSE file in top level of distribution package or *
11  * http://opensource.org/licenses/NCSA *
12  *********************************************************************/
13 /* *******************************************************************
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17  * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21  * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22  *********************************************************************/
23 #include <iostream>
24 #include <vector>
25 #include <string>
26 #include <iomanip>
27 #include <sstream>
28 #include <fstream>
29 #include <map>
30 #include <list>
31 #include <cmath>
32 #include <cassert>
33 
34 using namespace std;
35 
36 #include "roccom.h"
37 
38 #include "GEM.H"
39 #include "FluRegion.H"
40 
41 unsigned int
43  return(_ntet + _npyr + _npris + _nhex);
44 }
45 
46 void
48 {
49  if(_out){
50  *_out << "********************************************************"
51  << "\n"
52  << "Region ID: " << _id << "\n"
53  << "Number of Nodes: (" << _nnodes << "," << _ngnodes << ")" << "\n"
54  << "Number of Elements: " << nelem() << "\n"
55  << "Tets: (" << _ntet << "," << _ngtet << ")" << "\n"
56  << "Pyramids: (" << _npyr << "," << _ngpyr << ")" << "\n"
57  << "Prisms: (" << _npris << "," << _ngpris << ")" << "\n"
58  << "Hexes: (" << _nhex << "," << _nghex << ")" << "\n"
59  << "Region Borders: " << "\n"
60  << "========================================================"
61  << "\n" ;
62  unsigned int border = 0;
63  while(border < _borders.size()){
64  *_out << " Local Border #" << border+1 << "\n" ;
65  FluBorder *fb = &_borders[border++];
66  *_out << "-----------------------------------------------------" << "\n"
67  << " Region/Border: (" << fb->_rpart << "," << fb->_rbid
68  << ")" << "\n"
69  << " Nodes: (" << fb->_sharenodes.size() << ","
70  << fb->_sendnodes.size()
71  << "," << fb->_recvnodes.size() << ")" << "\n"
72  << " Cells: (" << fb->_sendcells.size() << ","
73  << fb->_recvcells.size()
74  << ")" << "\n"
75  << "-----------------------------------------------------" << "\n";
76  }
77  *_out
78  << "========================================================" << "\n"
79  << "Domain Boundaries: " << "\n"
80  << "========================================================" << "\n";
81  unsigned int patch = 0;
82  while(patch < _patches.size()){
83  *_out << " Local patch #" << patch+1 << "\n"
84  << "-----------------------------------------------------" << "\n";
85  FluPatch *fp = &_patches[patch++];
86  *_out
87  << " Patch ID: " << fp->_id << "\n"
88  << " Triangles: (" << fp->_ntri << "," << fp->_ngtri << ")" << "\n"
89  << " Quads: (" << fp->_nquad << "," << fp->_ngquad << ")"
90  << "\n"
91  << "-----------------------------------------------------" << "\n";
92  }
93  *_out
94  << "========================================================" << "\n"
95  << "\n"
96  << "********************************************************" << "\n";
97  }
98 }
99 
100 bool
102 {
103  ifstream Inf;
104  Inf.open("Rocflu/RocfluControl.txt");
105  if(!Inf)
106  Inf.open("RocfluControl.txt");
107  if(!Inf)
108  return(false);
109  Inf >> _casename >> _casepath;
110  Inf.close();
111  return(true);
112 }
113 bool
114 FluRegion::WriteFluNative(const string &prefix)
115 {
116  string pre(prefix);
117  if(pre.empty()){
118  if(_casepath.empty())
119  pre = "./";
120  else
121  pre = _casepath + "/" + _casename;
122  }
123  WriteFluCMP(pre);
124  WriteFluDIM(pre);
125  WriteFluCOM(pre);
126  return(true);
127 }
128 
129 bool
130 FluRegion::WriteFluCOM(const string &prefix)
131 {
132  string pre(prefix);
133  if(pre.empty()){
134  if(_casename.empty())
135  pre = "./";
136  else
137  pre = _casepath + "/" + _casename + ".";
138  }
139  else
140  pre += ".";
141  // if(pre.empty())
142  // pre = "./";
143  ofstream Ouf;
144  ostringstream Ostr;
145  Ostr << pre << "com_";
146  Ostr << setw(5) << setfill('0');
147  Ostr << _id;
148  Ouf.open(Ostr.str().c_str());
149  if(!Ouf)
150  return(false);
151  Ouf << "# ROCFLU communication lists file" << endl
152  << "# Dimensions" << endl
153  << setw(8) << _borders.size() << endl
154  << "# Information" << endl;
155  vector<FluBorder>::iterator fbi = _borders.begin();
156  while(fbi != _borders.end()){
157  Ouf << setw(8) << fbi->_rpart << setw(8) << fbi->_rbid << endl;
158  fbi++;
159  }
160  Ouf << "# Cells" << endl;
161  fbi = _borders.begin();
162  while(fbi != _borders.end()){
163  Ouf << setw(8) << fbi->_sendcells.size() << setw(8)
164  << fbi->_recvcells.size() << endl;
165  int line = 0;
166  vector<unsigned int>::iterator sci = fbi->_sendcells.begin();
167  while(sci != fbi->_sendcells.end()){
168  Ouf << setw(8) << *sci++;
169  line++;
170  if(line == 10){
171  Ouf << endl;
172  line = 0;
173  }
174  }
175  if(line){
176  Ouf << endl;
177  line = 0;
178  }
179  sci = fbi->_recvcells.begin();
180  while(sci != fbi->_recvcells.end()){
181  Ouf << setw(8) << *sci++;
182  line++;
183  if(line == 10){
184  Ouf << endl;
185  line = 0;
186  }
187  }
188  if(line){
189  Ouf << endl;
190  line = 0;
191  }
192  fbi++;
193  }
194  Ouf << "# Vertices" << endl;
195  fbi = _borders.begin();
196  while(fbi != _borders.end()){
197  Ouf << setw(8) << fbi->_sendnodes.size() << setw(8)
198  << fbi->_recvnodes.size() << setw(8) << fbi->_sharenodes.size()
199  << endl;
200  vector<unsigned int>::iterator ni = fbi->_sendnodes.begin();
201  int line = 0;
202  while(ni != fbi->_sendnodes.end()){
203  Ouf << setw(8) << *ni++;
204  line++;
205  if(line == 10){
206  Ouf << endl;
207  line = 0;
208  }
209  }
210  if(line || fbi->_sendnodes.empty()){
211  Ouf << endl;
212  line = 0;
213  }
214  ni = fbi->_recvnodes.begin();
215  line = 0;
216  while(ni != fbi->_recvnodes.end()){
217  Ouf << setw(8) << *ni++;
218  line++;
219  if(line == 10){
220  Ouf << endl;
221  line = 0;
222  }
223  }
224  if(line || fbi->_recvnodes.empty()){
225  Ouf << endl;
226  line = 0;
227  }
228  ni = fbi->_sharenodes.begin();
229  line = 0;
230  while(ni != fbi->_sharenodes.end()){
231  Ouf << setw(8) << *ni++;
232  line++;
233  if(line == 10){
234  Ouf << endl;
235  line = 0;
236  }
237  }
238  if(line || fbi->_sharenodes.empty()){
239  Ouf << endl;
240  line = 0;
241  }
242  fbi++;
243  }
244  Ouf << "# End" << endl;
245  return(true);
246 }
247 
248 bool
249 FluRegion::ReadFluCOM(const string &prefix)
250 {
251  string pre(prefix);
252  if(pre.empty()){
253  if(_casename.empty())
254  pre = "./";
255  else
256  pre = _casepath + "/" + _casename;
257  }
258  // if(pre.empty())
259  // pre = "./";
260  ifstream Inf;
261  ostringstream Ostr;
262  Ostr << pre << ".com_";
263  Ostr << setw(5) << setfill('0');
264  Ostr << _id;
265  Inf.open(Ostr.str().c_str());
266  if(!Inf)
267  return(false);
268  string line;
269  SkipLines(Inf,2);
270  unsigned int nborders = 0;
271  Inf >> nborders;
272  if(_debug && _out)
273  *_out << "FluRegion::ReadFluCOM(" << _id << "): nborders: "
274  << nborders << "\n";
275  assert(nborders == _borders.size());
276  SkipLines(Inf,2);
277  vector<FluBorder>::iterator fbi = _borders.begin();
278  while(fbi != _borders.end()){
279  unsigned int rpart,rbid;
280  Inf >> rpart >> rbid;
281  assert(fbi->_rpart == rpart && fbi->_rbid == rbid);
282  fbi++;
283  }
284  SkipLines(Inf,2);
285  fbi = _borders.begin();
286  while(fbi != _borders.end()){
287  unsigned int rcells,scells;
288  Inf >> scells >> rcells;
289  assert(scells == fbi->_sendcells.size() &&
290  rcells == fbi->_recvcells.size());
291  int cell = 0;
292  int ncells = fbi->_sendcells.size();
293  while(cell < ncells)
294  Inf >> fbi->_sendcells[cell++];
295  cell = 0;
296  ncells = fbi->_recvcells.size();
297  while(cell < ncells)
298  Inf >> fbi->_recvcells[cell++];
299  fbi++;
300  }
301  SkipLines(Inf,2);
302  fbi = _borders.begin();
303  while(fbi != _borders.end()){
304  unsigned int nshare,nsend,nrecv;
305  Inf >> nsend >> nrecv >> nshare;
306  assert(nsend == fbi->_sendnodes.size() &&
307  nrecv == fbi->_recvnodes.size() &&
308  nshare == fbi->_sharenodes.size());
309  unsigned int node = 0;
310  unsigned int nnodes = fbi->_sendnodes.size();
311  while(node < nnodes)
312  Inf >> fbi->_sendnodes[node++];
313  node = 0;
314  nnodes = fbi->_recvnodes.size();
315  while(node < nnodes)
316  Inf >> fbi->_recvnodes[node++];
317  nnodes = fbi->_sharenodes.size();
318  node = 0;
319  while(node < nnodes)
320  Inf >> fbi->_sharenodes[node++];
321  fbi++;
322  }
323  Inf.close();
324  return(true);
325 }
326 
327 bool
328 FluRegion::CreateRegionMapFile(const string &prefix,unsigned int nproc,
329  unsigned int nregions)
330 {
331  string pre(prefix);
332  if(pre.empty()){
333  if(_casename.empty())
334  pre = "./";
335  else
336  pre = _casepath + "/" + _casename + ".";
337  }
338  else
339  pre += ".";
340  // if(pre.empty())
341  // pre = "./";
342  ofstream Ouf;
343  ostringstream Ostr;
344  Ostr << pre << "map";
345  Ouf.open(Ostr.str().c_str());
346  if(!Ouf)
347  return(false);
348  Ouf << "# ROCFLU region mapping file" << endl
349  << "# Number of regions" << endl
350  << setw(8) << nregions << endl
351  << "# Number of processes" << endl
352  << setw(8) << nproc << endl;
353  unsigned int regpproc = nregions/nproc;
354  if(regpproc == 0)
355  return(false);
356  unsigned int left = nregions%nproc;
357  unsigned int proc = 0;
358  unsigned int reg = 0;
359  while(proc < nproc){
360  unsigned int nreg = regpproc;
361  if(left > 0){
362  nreg++;
363  left--;
364  }
365  Ouf << "# Process " << setw(6) << setfill('0') << proc+1 << endl
366  << setfill(' ') << setw(8) << nreg << endl;
367  unsigned int uplimit = reg + nreg;
368  while(reg < uplimit)
369  Ouf << setw(8) << (1+reg++) << endl;
370  proc++;
371  }
372  Ouf << "# End" << endl;
373  Ouf.close();
374  return(true);
375 }
376 
377 bool
378 FluRegion::WriteFluDIM(const string &prefix,double t,bool unsteady)
379 {
380  string pre(prefix);
381  if(pre.empty()){
382  if(_casename.empty())
383  pre = "./";
384  else
385  pre = _casepath + "/" + _casename + ".";
386  }
387  else
388  pre += ".";
389  // if(pre.empty())
390  // pre = "./";
391  ofstream Ouf;
392  ostringstream Ostr;
393  Ostr << pre << "dim_";
394  Ostr << setw(5) << setfill('0');
395  Ostr << _id;
396  string filebase(Ostr.str());
397  if(unsteady){
398  Ostr.clear();
399  Ostr.str("");
400  Ostr << "_" << scientific << setprecision(5) << t;
401  string timestring(Ostr.str());
402  timestring.replace(8,1,"E");
403  filebase+=timestring;
404  }
405  Ouf.open(filebase.c_str());
406  if(!Ouf)
407  return(false);
408  _ntet = _tetconn.size()/4;
409  _nnodes = _nc.size()/3;
410  _nhex = _hexconn.size()/8;
411  _npris = _prisconn.size()/6;
412  _npyr = _pyrconn.size()/5;
413  Ouf << "# ROCFLU dimensions file" << endl
414  << "# Vertices" << endl
415  << setw(8) << _nnodes - _ngnodes << setw(8) << _nnodes
416  << setw(8) << _nnodes+(_nnodes/5) << endl
417  << "# Cells" << endl
418  << setw(8) << (nelem()-_ngtet-_ngpyr-_ngpris-_nghex)
419  << setw(8) << nelem()
420  << setw(8) << (nelem()+(nelem()/5)) << endl
421  << "# Tetrahedra" << endl
422  << setw(8) << _ntet - _ngtet << setw(8) << _ntet << setw(8)
423  << (_ntet+(_ntet/5))
424  << endl
425  << "# Hexahedra" << endl
426  << setw(8) << _nhex - _nghex << setw(8) << _nhex << setw(8)
427  << (_nhex+(_nhex/5))
428  << endl
429  << "# Prisms" << endl
430  << setw(8) << _npris - _ngpris << setw(8) << _npris << setw(8)
431  << _npris+(_npris/5)
432  << endl
433  << "# Pyramids" << endl
434  << setw(8) << _npyr - _ngpyr << setw(8) << _npyr
435  << setw(8) << _npyr+(_npyr/5)
436  << endl
437  << "# Patches" << endl
438  << setw(8) << _patches.size() << setw(8) << _npatches_total << endl;
439  vector<FluPatch>::iterator fpi = _patches.begin();
440  while(fpi != _patches.end()){
441  Ouf << setw(8) << fpi->_id << setw(8) << fpi->_ntri - fpi->_ngtri
442  << setw(8) << fpi->_ntri << setw(8) << fpi->_nquad - fpi->_ngquad
443  << setw(8) << fpi->_nquad << endl;
444  fpi++;
445  }
446  Ouf << "# Borders" << endl
447  << setw(8) << _borders.size() << endl;
448  vector<FluBorder>::iterator fbi = _borders.begin();
449  while(fbi != _borders.end()){
450  Ouf << setw(8) << fbi->_rpart << setw(8) << fbi->_rbid << setw(8)
451  << fbi->_sendcells.size() << setw(8) << fbi->_recvcells.size()
452  << setw(8)
453  << fbi->_sendnodes.size() << setw(8) << fbi->_recvnodes.size()
454  << setw(8)
455  << fbi->_sharenodes.size() << endl;
456  fbi++;
457  }
458  Ouf << "# End" << endl;
459  return(true);
460 }
461 
462 bool
463 FluRegion::ReadFluDIM(const string &prefix,double t,bool unsteady)
464 {
465  string pre(prefix);
466  if(pre.empty()){
467  if(_casename.empty())
468  pre = "./";
469  else
470  pre = _casepath + "/" + _casename;
471  }
472  // if(pre.empty())
473  // pre = "./";
474  if(_debug && _out)
475  *_out << "FluRegion::ReadFluDIM: Entry" << "\n";
476  _soln._current_time = t;
477  _soln._unsteady = unsteady;
478  ifstream Inf;
479  ostringstream Ostr;
480  Ostr << pre << ".dim_";
481  Ostr << setw(5) << setfill('0');
482  Ostr << _id;
483  string filebase(Ostr.str());
484  if(unsteady){
485  Ostr.clear();
486  Ostr.str("");
487  Ostr << "_" << scientific << setprecision(5) << t;
488  string timestring(Ostr.str());
489  timestring.replace(8,1,"E");
490  filebase+=timestring;
491  }
492  Inf.open(filebase.c_str());
493  if(!Inf){
494  if(_debug && _out)
495  *_out << "FluRegion::ReadFluDIM: Unable to open " << filebase
496  << " for reading." << endl;
497  return(false);
498  }
499  string line;
500  unsigned int nreal_cells = 0;
501  unsigned int ncells = 0;
502  unsigned int npatches = 0;
503  unsigned int nreal_tets = 0;
504  unsigned int nreal_hex = 0;
505  unsigned int nreal_pris = 0;
506  unsigned int nreal_pyr = 0;
507  unsigned int nreal_nodes = 0;
508  SkipLines(Inf,2);
509  Inf >> nreal_nodes >> _nnodes;
510  SkipLines(Inf,2);
511  Inf >> nreal_cells >> ncells;
512  SkipLines(Inf,2);
513  Inf >> nreal_tets >> _ntet;
514  SkipLines(Inf,2);
515  Inf >> nreal_hex >> _nhex;
516  SkipLines(Inf,2);
517  Inf >> nreal_pris >> _npris;
518  SkipLines(Inf,2);
519  Inf >> nreal_pyr >> _npyr;
520  SkipLines(Inf,2);
521  Inf >> npatches >> _npatches_total;
522  _ngnodes = _nnodes - nreal_nodes;
523  _ngtet = _ntet - nreal_tets;
524  _nghex = _nhex - nreal_hex;
525  _ngpyr = _npyr - nreal_pyr;
526  _ngpris = _npris - nreal_pris;
527  assert(nelem() == ncells);
528  if(_debug && _out)
529  *_out << "FluRegion::ReadFluDIM:: Elems: (" << nelem() << ","
530  << _ngtet+_nghex+_ngpyr+_ngpris << ")" << endl
531  << "FluRegion::ReadFluDIM:: Nodes: (" << _nnodes << ","
532  << _ngnodes << ")" << endl
533  << "FluRegion::ReadFluDIM:: Patches: (" << npatches << ","
534  << _npatches_total << ")" << endl;
535  _patches.resize(npatches);
536  _tetconn.resize(4*_ntet);
537  _hexconn.resize(8*_nhex);
538  _prisconn.resize(6*_npris);
539  _pyrconn.resize(5*_npyr);
540  _nc.resize(3*_nnodes);
541  vector<FluPatch>::iterator fpi = _patches.begin();
542  while(fpi != _patches.end()){
543  unsigned int nreal_tri = 0;
544  unsigned int nreal_quad = 0;
545  Inf >> fpi->_id >> nreal_tri >> fpi->_ntri >> nreal_quad >> fpi->_nquad;
546  fpi->_ngtri = fpi->_ntri - nreal_tri;
547  fpi->_ngquad = fpi->_nquad - nreal_quad;
548  fpi->_triconn.resize(fpi->_ntri*3);
549  fpi->_quadconn.resize(fpi->_nquad*4);
550  fpi++;
551  }
552  unsigned int nborders = 0;
553  SkipLines(Inf,2);
554  Inf >> nborders;
555  if(_debug && _out)
556  *_out << "FluRegion::ReadFluDIM:: Number of borders: " << nborders << endl;
557  _borders.resize(nborders);
558  vector<FluBorder>::iterator fbi = _borders.begin();
559  while(fbi != _borders.end()){
560  unsigned int nsend,nrecv,nshared,csend,crecv;
561  Inf >> fbi->_rpart >> fbi->_rbid >> csend >> crecv
562  >> nsend >> nrecv >> nshared;
563  if(_debug && _out)
564  *_out << "FluRegion::ReadFluDIM:: Border: (" << fbi->_rpart << ","
565  << fbi->_rbid << "," << csend << "," << crecv << "," << nsend
566  << "," << nrecv << "," << nshared << ")" << endl;
567  fbi->_sharenodes.resize(nshared);
568  fbi->_sendnodes.resize(nsend);
569  fbi->_recvnodes.resize(nrecv);
570  fbi->_sendcells.resize(csend);
571  fbi->_recvcells.resize(crecv);
572  fbi++;
573  }
574  Inf.close();
575  if(_debug && _out)
576  *_out << "FluRegion::ReadFluDIM: Exit" << endl;
577  return(true);
578 }
579 
580 bool
581 FluRegion::PopRemBordIndFILE(const string &prefix,double t,bool unsteady)
582 {
583  string pre(prefix);
584  if(pre.empty()){
585  if(_casename.empty())
586  pre = "./";
587  else
588  pre = _casepath + "/" + _casename;
589  }
590  vector<FluBorder>::iterator fbi = _borders.begin();
591  while(fbi != _borders.end()){
592  ifstream Inf;
593  ostringstream Ostr;
594  Ostr << pre << ".dim_";
595  Ostr << setw(5) << setfill('0');
596  Ostr << fbi->_rpart;
597  string filebase(Ostr.str());
598  if(unsteady){
599  Ostr.clear();
600  Ostr.str("");
601  Ostr << "_" << scientific << setprecision(5) << t;
602  string timestring(Ostr.str());
603  timestring.replace(8,1,"E");
604  filebase+=timestring;
605  }
606  Inf.open(filebase.c_str());
607  if(!Inf){
608  if(_debug && _out)
609  *_out
610  << "FluRegion(" << _id << ")::PopRemBordIndFILE: Unable to open "
611  << filebase << " for reading.\n";
612  return(false);
613  }
614  string line;
615  unsigned int fakeout = 0;
616  unsigned int nreal_cells = 0;
617  unsigned int nnodes = 0;
618  unsigned int nhex = 0;
619  unsigned int ntet = 0;
620  unsigned int npris = 0;
621  unsigned int npyr = 0;
622  unsigned int ncells = 0;
623  unsigned int npatches = 0;
624  unsigned int nreal_tets = 0;
625  unsigned int nreal_hex = 0;
626  unsigned int nreal_pris = 0;
627  unsigned int nreal_pyr = 0;
628  unsigned int nreal_nodes = 0;
629  unsigned int npatches_total = 0;
630  unsigned int ngnodes = 0;
631  unsigned int ngtet = 0;
632  unsigned int nghex = 0;
633  unsigned int ngpris = 0;
634  unsigned int ngpyr = 0;
635  SkipLines(Inf,2);
636  Inf >> nreal_nodes >> nnodes;
637  SkipLines(Inf,2);
638  Inf >> nreal_cells >> ncells;
639  SkipLines(Inf,2);
640  Inf >> nreal_tets >> ntet;
641  SkipLines(Inf,2);
642  Inf >> nreal_hex >> nhex;
643  SkipLines(Inf,2);
644  Inf >> nreal_pris >> npris;
645  SkipLines(Inf,2);
646  Inf >> nreal_pyr >> npyr;
647  SkipLines(Inf,2);
648  Inf >> npatches >> npatches_total;
649  ngnodes = nnodes - nreal_nodes;
650  ngtet = ntet - nreal_tets;
651  nghex = nhex - nreal_hex;
652  ngpyr = npyr - nreal_pyr;
653  ngpris = npris - nreal_pris;
654  if(_debug && _out)
655  *_out << "FluRegion(" << _id << ")::PopRemBordIndFILE::Elems: ("
656  << ntet+npris+nhex+npyr
657  << "," << ngtet+nghex+ngpyr+ngpris << ")\n"
658  << "FluRegion(" << _id << ")::PopRemBordIndFILE" << "::Nodes: ("
659  << nnodes << ","
660  << ngnodes << ")\n"
661  << "FluRegion(" << _id << ")::PopRemBordIndFILE:: Patches: ("
662  << npatches << ","
663  << npatches_total << ")\n";
664  for(unsigned int pind = 0;pind < npatches;pind++){
665  unsigned int nreal_tri = 0;
666  unsigned int nreal_quad = 0;
667  Inf >> fakeout >> nreal_tri >> fakeout >> nreal_quad >> fakeout;
668  }
669  unsigned int nborders = 0;
670  SkipLines(Inf,2);
671  Inf >> nborders;
672  if(_debug && _out)
673  *_out << "FluRegion(" << _id << ")::PopRemBordIndFILE:: "
674  << "Number of borders: " << nborders
675  << "\n";
676  bool done = false;
677  for(unsigned int bind = 0;(bind < nborders && !done);bind++){
678  unsigned int rpart;
679  Inf >> rpart;
680  if(rpart == this->_id){
681  fbi->_rbid = bind+1;
682  done = true;
683  }
684  else
685  Inf >> fakeout >> fakeout >> fakeout >> fakeout >> fakeout >> fakeout;
686  }
687  if(!done)
688  return(false);
689  Inf.close();
690  // this->WriteFluDIM(prefix,t,unsteady);
691  fbi++;
692  }
693  return(true);
694 }
695 
696 bool
697 FluRegion::WriteFluCMP(const string &prefix)
698 {
699  string pre(prefix);
700  if(pre.empty()){
701  if(_casename.empty())
702  pre = "./";
703  else
704  pre = _casepath + "/" + _casename + ".";
705  }
706  else
707  pre += ".";
708  ofstream Ouf;
709  ostringstream Ostr;
710  Ostr << pre << "cmp_";
711  Ostr << setw(5) << setfill('0');
712  Ostr << _id;
713  Ouf.open(Ostr.str().c_str());
714  if(!Ouf)
715  return(false);
716  _ntet = _tetconn.size()/4;
717  _nhex = _hexconn.size()/8;
718  _npris = _prisconn.size()/6;
719  _npyr = _pyrconn.size()/5;
720  // BuildCellMapping();
721  Ouf << "# ROCFLU cell mapping file" << endl
722  << "# Dimensions" << endl
723  << setw(8) << _ntet << setw(8) << _nhex << setw(8) << _npris
724  << setw(8) << _npyr << endl;
725  vector<pair<unsigned int,unsigned int> >::iterator ci = _cellmap.begin();
726  // int line = 0;
727  unsigned int el = 0;
728  unsigned int npl = 10;
729  if(_ntet > 0){
730  el = 0;
731  Ouf << "# Tetrahedra" << endl;
732  while(el < _ntet){
733  Ouf << setw(8) << Elem2Cell(make_pair(1,++el));
734  if(!(el%npl))
735  Ouf << endl;
736  }
737  if(el%npl) Ouf << endl;
738  }
739  if(_nhex > 0){
740  el = 0;
741  Ouf << "# Hexahedra" << endl;
742  while(el < _nhex){
743  Ouf << setw(8) << Elem2Cell(make_pair(4,++el));
744  if(!(el%npl))
745  Ouf << endl;
746  }
747  if(el%npl) Ouf << endl;
748  }
749  if(_npris > 0){
750  el = 0;
751  Ouf << "# Prisms" << endl;
752  while(el < _npris){
753  Ouf << setw(8) << Elem2Cell(make_pair(3,++el));
754  if(!(el%npl))
755  Ouf << endl;
756  }
757  if(el%npl) Ouf << endl;
758  }
759  if(_npyr > 0){
760  el = 0;
761  Ouf << "# Pyramids" << endl;
762  while(el<_npyr){
763  Ouf << setw(8) << Elem2Cell(make_pair(2,++el));
764  if(!(el%npl))
765  Ouf << endl;
766  }
767  if(el%npl) Ouf << endl;
768  }
769  Ouf << "# End" << endl;
770  Ouf.close();
771  return(true);
772 }
773 
774 
775 bool
776 FluRegion::InitVolumeSoln(const string &prefix)
777 {
778  string pre(prefix);
779  if(pre.empty()){
780  if(_casename.empty())
781  pre = "./";
782  else
783  pre = _casepath + "/" + _casename;
784  }
785  string fname(pre+".inp");
786  ifstream Inf;
787  Inf.open(fname.c_str());
788  if(!Inf)
789  return false;
790  string line;
791  double cp = -1.0;
792  double gamma = -1.0;
793  double velx = 0.0;
794  double vely = 0.0;
795  double velz = 0.0;
796  double press = -1.0;
797  double rho = -1.0;
798  while(getline(Inf,line)){
799  if(line[0] != '#'){
800  string::size_type xtime = line.find("STARTTIME");
801  string::size_type ftype = line.find("FLOWTYPE");
802  string::size_type xgamma = line.find("GAMMA");
803  string::size_type xpress = line.find("PRESS");
804  string::size_type x_dens = line.find("DENS");
805  string::size_type x_velx = line.find("VELX");
806  string::size_type x_vely = line.find("VELY");
807  string::size_type x_velz = line.find("VELZ");
808  string::size_type x_cp = line.find("CP");
809  string tstr;
810  istringstream Istr(line);
811  if(xtime != string::npos)
812  Istr >> tstr >> _soln._current_time;
813  if(ftype != string::npos)
814  Istr >> tstr >> _soln._unsteady;
815  if(xgamma != string::npos)
816  Istr >> tstr >> gamma;
817  if(xpress != string::npos)
818  Istr >> tstr >> press;
819  if(x_dens != string::npos)
820  Istr >> tstr >> rho;
821  if(x_velx != string::npos)
822  Istr >> tstr >> velx;
823  if(x_vely != string::npos)
824  Istr >> tstr >> vely;
825  if(x_velz != string::npos)
826  Istr >> tstr >> velz;
827  if(x_cp != string::npos)
828  Istr >> tstr >> cp;
829  }
830  }
831  if(gamma < 0 || press < 0 || rho < 0 || cp < 0)
832  return(false);
833  _ntet = _tetconn.size()/4;
834  _npyr = _pyrconn.size()/5;
835  _nhex = _hexconn.size()/8;
836  _npris = _prisconn.size()/6;
837  unsigned int nelem = _ntet + _npyr + _npris + _nhex;
838  _soln._rhof.resize(nelem,rho);
839  double E = press/(rho*(gamma - 1.0)) +
840  (velx*velx + vely*vely + velz*velz)/2.0;
841  _soln._rhovf.resize(3*nelem,0.0);
842  if(velx != 0.0 || vely != 0.0 || velz != 0.0){
843  unsigned int index = 0;
844  for(unsigned int el = 0;el < nelem;el++){
845  _soln._rhovf[index++] = rho*velx;
846  _soln._rhovf[index++] = rho*vely;
847  _soln._rhovf[index++] = rho*velz;
848  }
849  }
850  double R = (cp*(gamma-1.0))/gamma;
851  double Ti = press/(rho*R);
852  double C = sqrt(gamma*press/rho);
853  _soln._rhoEf.resize(nelem,rho*E);
854  _soln._pf.resize(nelem,press);
855  _soln._Tf.resize(nelem,Ti);
856  _soln._af.resize(nelem,C);
857  _soln._gsp.resize(_nvface,0.0);
858  return(true);
859 }
860 
861 bool
862 FluRegion::InitSurfaceSoln(const string &prefix)
863 {
864  string pre(prefix);
865  if(pre.empty()){
866  if(_casename.empty())
867  pre = "./";
868  else
869  pre = _casepath + "/" + _casename;
870  }
871  vector<FluPatch>::iterator fpi = _patches.begin();
872  while(fpi != _patches.end()){
873  FluPatch &fp = *fpi++;
874  if(!fp.InitSurfaceSoln(pre,true))
875  return(false);
876  }
877  return(true);
878 }
879 
880 
881 bool
882 FluPatch::InitSurfaceSoln(const string &prefix,bool all)
883 {
884  string pre(prefix);
885  if(_debug && _out)
886  *_out << "FluPatch(" << _id << ")::InitSurfaceSoln Enter" << endl;
887  if(pre.empty())
888  pre = "./";
889  if(all){
890  _ntri = _triconn.size()/3;
891  _nquad = _quadconn.size()/4;
892  //#ifdef _ROCSTAR_X_
893  _soln.Resize(_ntri+_nquad,surface_coordinates.size()/3);
894  //#else
895  // _soln.gsp.resize(_ntri+_nquad - (_ngtri+_ngquad),0.0);
896  //#endif
897  }
898  //#ifdef _ROCSTAR_X_
899  int constraint_map[] = { 2 , 120, 121, 122, -122, -121, -120, 0};
900  // Populate the Rocstar data living on the surface
901  string fname(pre+".bc");
902  ifstream Inf;
903  Inf.open(fname.c_str());
904  if(!Inf){
905  if(_out){
906  *_out << "FluPatch::InitSurfaceSoln: Error: could not locate bc file."
907  << endl;
908  }
909  return false;
910  }
911  string line;
912  bool found_patch = false;
913  while(getline(Inf,line) && !found_patch){
914  if(line[0] != '#'){
915  string::size_type patchx = line.find("PATCH");
916  if( patchx != string::npos){
917  string tstr;
918  unsigned int ubound,lbound;
919  istringstream Istr(line);
920  Istr >> tstr >> lbound >> ubound;
921  if(_id >= lbound && _id <= ubound)
922  found_patch = true;
923  }
924  }
925  }
926  if(!found_patch){
927  if(_out){
928  *_out << "FluPatch::InitSurfaceSoln: Error: Did not find patch "
929  << _id << " in bc file." << endl;
930  }
931  return(false);
932  }
933  // Now we want to search forward for the relevant data until we encounter #
934  bool end_section = false;
935  _constr_type = 2;
936  _bcflag = 2;
937  while(getline(Inf,line) && !end_section){
938  if(line[0] == '#') end_section = true;
939  else{
940  string::size_type movx = line.find("MOVEDIR");
941  string::size_type coupx = line.find("COUPLED");
942  string::size_type burn = line.find("BFLAG");
943  if(movx != string::npos){
944  string tstr;
945  int mvdir;
946  istringstream Istr(line);
947  Istr >> tstr >> mvdir;
948  _constr_type = constraint_map[mvdir];
949  }
950  if(coupx != string::npos){
951  string tstr;
952  istringstream Istr(line);
953  Istr >> tstr >> _bcflag;
954  }
955  if(burn != string::npos){
956  string tstr;
957  unsigned int burnf = 0;
958  istringstream Istr(line);
959  Istr >> tstr >> burnf;
960  _soln._bflag.resize(_ntri+_nquad,burnf);
961  }
962  }
963  }
964  //#endif
965  Inf.close();
966  if(_debug && _out)
967  *_out << "FluPatch(" << _id << ")::InitSurfaceSoln Exit" << endl;
968  return true;
969 }
970 
971 // Populates our connectivites from the ASCII grid files
972 // pre should contain the path + casename
973 // Ex: /my/directory/StarSlice
974 bool
975 FluRegion::ReadFluGridASCII(const string &prefix,double t,bool unsteady)
976 {
977  string pre(prefix);
978  if(pre.empty()){
979  if(_casename.empty())
980  pre = "./";
981  else
982  pre = _casepath + "/" + _casename;
983  }
984  ostringstream Ostr;
985  Ostr << pre << ".grda_" << setw(5) << setfill('0') << _id;
986  string filebase(Ostr.str());
987  Ostr.clear();
988  Ostr.str("");
989  Ostr << "_" << scientific << setprecision(5) << t;
990  string timestring(Ostr.str());
991  timestring.replace(8,1,"E");
992  if(unsteady) filebase+=timestring;
993  ifstream Inf;
994  Inf.open(filebase.c_str());
995  if(!Inf){
996  if(_debug && _out)
997  *_out << "FluRegion::ReadFluGridASCII: Unable to open " << filebase
998  << " for reading.\n";
999  return(false);
1000  }
1001  string line;
1002  SkipLines(Inf,6);
1003  unsigned int nnode,ntet,nhex,npris,npyr;
1004  Inf >> nnode >> ntet >> nhex >> npris >> npyr;
1005  assert(nnode == _nnodes && ntet == _ntet &&
1006  nhex == _nhex && npris == _npris &&
1007  npyr == _npyr && _nc.size() == _nnodes*3);
1008  SkipLines(Inf,2);
1009  for(int i = 0; i < 3;i++){
1010  unsigned int node = 0;
1011  while(node < _nnodes)
1012  Inf >> _nc[(node++)*3+i];
1013  }
1014  if(_ntet > 0){
1015  _tetconn.resize(_ntet*4);
1016  SkipLines(Inf,2);
1017  for(int i = 0;i < 4;i++){
1018  unsigned int el = 0;
1019  while(el < _ntet)
1020  Inf >> _tetconn[(el++)*4+i];
1021  }
1022  }
1023  if(_nhex > 0){
1024  _hexconn.resize(_nhex*8);
1025  SkipLines(Inf,2);
1026  for(int i = 0;i < 8;i++){
1027  unsigned int el = 0;
1028  while(el < _nhex)
1029  Inf >> _hexconn[(el++)*8+i];
1030  }
1031  }
1032  if(_npris > 0){
1033  _prisconn.resize(_npris*6);
1034  SkipLines(Inf,2);
1035  for(int i = 0;i < 6;i++){
1036  unsigned int el = 0;
1037  while(el < _npris)
1038  Inf >> _prisconn[(el++)*6+i];
1039  }
1040  }
1041  if(_npyr > 0){
1042  _pyrconn.resize(_npyr*5);
1043  SkipLines(Inf,2);
1044  for(int i = 0;i < 5;i++){
1045  unsigned int el = 0;
1046  while(el < _npyr)
1047  Inf >> _pyrconn[(el++)*5+i];
1048  }
1049  }
1050  SkipLines(Inf,2);
1051  unsigned int npatches = 0;
1052  unsigned int patch = 0;
1053  Inf >> npatches;
1054  assert(npatches == _patches.size());
1055  while(patch < npatches){
1056  FluPatch &fp = _patches[patch++];
1057  unsigned int ntri,nquad;
1058  Inf >> ntri >> nquad;
1059  assert(ntri == fp._ntri && nquad == fp._nquad);
1060  if(fp._ntri > 0){
1061  fp._triconn.resize(3*fp._ntri);
1062  for(int i = 0;i < 3;i++){
1063  unsigned int tri = 0;
1064  while(tri < fp._ntri)
1065  Inf >> fp._triconn[(tri++)*3+i];
1066  }
1067  }
1068  if(fp._nquad > 0){
1069  fp._quadconn.resize(4*fp._nquad);
1070  for(int i = 0;i < 4;i++){
1071  unsigned int quad = 0;
1072  while(quad < fp._nquad)
1073  Inf >> fp._quadconn[(quad++)*4+i];
1074  }
1075  }
1076  }
1077  Inf.close();
1078  return true;
1079 }
1080 
1081 // Populates our connectivites from the ASCII grid files
1082 // pre should contain the path + casename
1083 // Ex: /my/directory/StarSlice
1084 bool
1085 FluRegion::WriteFluGridASCII(const string &prefix,double t,bool unsteady)
1086 {
1087  string pre(prefix);
1088  if(pre.empty()){
1089  if(_casename.empty())
1090  pre = "./";
1091  else
1092  pre = _casepath + "/" + _casename + ".";
1093  }
1094  else
1095  pre += ".";
1096  ostringstream Ostr;
1097  Ostr << pre << "grda_" << setw(5) << setfill('0') << _id;
1098  string filebase(Ostr.str());
1099  if(unsteady){
1100  Ostr.clear();
1101  Ostr.str("");
1102  Ostr << "_" << scientific << setprecision(5) << t;
1103  string timestring(Ostr.str());
1104  timestring.replace(8,1,"E");
1105  filebase+=timestring;
1106  }
1107  ofstream Ouf;
1108  Ouf.open(filebase.c_str());
1109  if(!Ouf)
1110  return(false);
1111  _nnodes = _nc.size()/3;
1112  _ntet = _tetconn.size()/4;
1113  _nhex = _hexconn.size()/8;
1114  _npyr = _pyrconn.size()/5;
1115  _npris = _prisconn.size()/6;
1116  Ouf << "# ROCFLU grid file" << endl
1117  << "# Precision and range" << endl
1118  << setw(8) << 15 << setw(8) << 307 << endl
1119  << "# Physical time" << endl
1120  << scientific << setprecision(16) << setw(23)
1121  << _soln._current_time << endl
1122  << "# Dimensions" << endl
1123  << setw(8) << _nnodes << setw(8) << _ntet << setw(8)
1124  << _nhex << setw(8) << _npris << setw(8) << _npyr << endl
1125  << "# Coordinates" << endl;
1126  unsigned int ll = 5;
1127  for(int i = 0; i < 3;i++){
1128  unsigned int node = 0;
1129  while(node < _nnodes){
1130  Ouf << setw(23) << scientific << setprecision(16)
1131  << _nc[(node++)*3+i];
1132  if(!(node%ll))
1133  Ouf << endl;
1134  }
1135  if(node%ll)
1136  Ouf << endl;
1137  }
1138  ll = 10;
1139  if(_ntet > 0){
1140  Ouf << "# Tetrahedra" << endl;
1141  for(int i = 0;i < 4;i++){
1142  unsigned int el = 0;
1143  while(el < _ntet){
1144  Ouf << setw(8) << _tetconn[(el++)*4+i];
1145  if(!(el%ll))
1146  Ouf << endl;
1147  }
1148  if(el%ll)
1149  Ouf << endl;
1150  }
1151  }
1152  if(_nhex > 0){
1153  Ouf << "# Hexahedra" << endl;
1154  for(int i = 0;i < 8;i++){
1155  unsigned int el = 0;
1156  while(el < _nhex){
1157  Ouf << setw(8) << _hexconn[(el++)*8+i];
1158  if(!(el%ll))
1159  Ouf << endl;
1160  }
1161  if(el%ll)
1162  Ouf << endl;
1163  }
1164  }
1165  if(_npris > 0){
1166  Ouf << "# Prisms" << endl;
1167  for(int i = 0;i < 6;i++){
1168  unsigned int el = 0;
1169  while(el < _nhex){
1170  Ouf << setw(8) << _prisconn[(el++)*6+i];
1171  if(!(el%ll))
1172  Ouf << endl;
1173  }
1174  if(el%ll)
1175  Ouf << endl;
1176  }
1177  }
1178  if(_npyr > 0){
1179  Ouf << "# Pyramids" << endl;
1180  for(int i = 0;i < 5;i++){
1181  unsigned int el = 0;
1182  while(el < _npyr){
1183  Ouf << setw(8) << _pyrconn[(el++)*5+i];
1184  if(!(el%ll))
1185  Ouf << endl;
1186  }
1187  if(el%ll)
1188  Ouf << endl;
1189  }
1190  }
1191  Ouf << "# Boundaries" << endl
1192  << setw(8) << _patches.size() << endl;
1193  unsigned int npatches = _patches.size();
1194  unsigned int patch = 0;
1195  while(patch < npatches){
1196  FluPatch &fp = _patches[patch++];
1197  Ouf << setw(8) << fp._ntri << setw(8) << fp._nquad << endl;
1198  if(fp._ntri > 0){
1199  for(int i = 0;i < 3;i++){
1200  unsigned int tri = 0;
1201  while(tri < fp._ntri){
1202  Ouf << setw(8) << fp._triconn[(tri++)*3+i];
1203  if(!(tri%ll))
1204  Ouf << endl;
1205  }
1206  if(tri%ll)
1207  Ouf << endl;
1208  }
1209  }
1210  if(fp._nquad > 0){
1211  for(int i = 0;i < 4;i++){
1212  unsigned int quad = 0;
1213  while(quad < fp._nquad){
1214  Ouf << setw(8) << fp._quadconn[(quad++)*4+i];
1215  if(!(quad%ll))
1216  Ouf << endl;
1217  }
1218  if(quad%ll)
1219  Ouf << endl;
1220  }
1221  }
1222  }
1223  Ouf << "# End" << endl;
1224  Ouf.close();
1225  return true;
1226 }
1227 
1228 bool
1229 FluRegion::ReadFluSolnASCII(const string &prefix,unsigned int n,
1230  double t,bool unsteady)
1231 {
1232  string pre(prefix);
1233  if(pre.empty()){
1234  if(_casename.empty())
1235  pre = "./";
1236  else
1237  pre = _casepath + "/" + _casename;
1238  }
1239  ostringstream Ostr;
1240  Ostr << pre << ".mixt.cva_" << setw(5) << setfill('0') << _id << "_";
1241  string filebase(Ostr.str());
1242  Ostr.str("");
1243  Ostr << setw(6) << setfill('0') << n;
1244  string iterstring(Ostr.str());
1245  Ostr.clear();
1246  Ostr.str("");
1247  Ostr << scientific << setprecision(5) << t;
1248  string timestring(Ostr.str());
1249  timestring.replace(7,1,"E");
1250  ifstream Inf;
1251  if(unsteady) filebase+=timestring;
1252  else filebase+=iterstring;
1253  Inf.open(filebase.c_str());
1254  if(!Inf){
1255  if(_debug && _out)
1256  *_out << "FluRegion::ReadFluSolnASCII: Unable to open " << filebase
1257  << " for reading.\n";
1258  return(false);
1259  }
1260  string line;
1261  SkipLines(Inf,4);
1262  Inf >> _soln._resid;
1263  SkipLines(Inf,2);
1264  Inf >> _soln._current_time;
1265  SkipLines(Inf,2);
1266  unsigned int ncells = 0;
1267  Inf >> ncells;
1268  assert(ncells == nelem());
1269  SkipLines(Inf,2);
1270  unsigned int cell = 0;
1271  _soln._rhof.resize(ncells,0.0);
1272  _soln._rhovf.resize(3*ncells,0.0);
1273  _soln._rhoEf.resize(ncells,0.0);
1274  while(cell < ncells)
1275  Inf >> _soln._rhof[cell++];
1276  SkipLines(Inf,2);
1277  for(int i = 0;i < 3;i++){
1278  cell = 0;
1279  while(cell < ncells)
1280  Inf >> _soln._rhovf[(cell++)*3+i];
1281  SkipLines(Inf,2);
1282  }
1283  cell = 0;
1284  while(cell < ncells)
1285  Inf >> _soln._rhoEf[cell++];
1286  if(!ReadGSPASCII(pre,n,t,unsteady)){
1287  if(_debug && _out)
1288  *_out
1289  << "FluRegion::ReadFluSolnASCII: Unable to process grid speed file."
1290  << "\n";
1291  return(false);
1292  }
1293  Inf.close();
1294  return(true);
1295 }
1296 
1297 bool
1298 FluRegion::WriteFluSolnASCII(const string &prefix,unsigned int n,
1299  double t,bool unsteady)
1300 {
1301  if(_debug && _out)
1302  *_out << "FluRegion::WriteFluSolnASCII: Enter\n";
1303  string pre(prefix);
1304  if(pre.empty()){
1305  if(_casename.empty())
1306  pre = "./";
1307  else
1308  pre = _casepath + "/" + _casename + ".";
1309  }
1310  else
1311  pre += ".";
1312  ostringstream Ostr;
1313  Ostr << pre << "mixt.cva_" << setw(5) << setfill('0') << _id << "_";
1314  string filebase(Ostr.str());
1315  Ostr.str("");
1316  Ostr << setw(6) << setfill('0') << n;
1317  string iterstring(Ostr.str());
1318  Ostr.clear();
1319  Ostr.str("");
1320  Ostr << scientific << setprecision(5) << t;
1321  string timestring(Ostr.str());
1322  timestring.replace(7,1,"E");
1323  ofstream Ouf;
1324  if(!unsteady)
1325  filebase+=iterstring;
1326  else
1327  filebase+=timestring;
1328  Ouf.open(filebase.c_str());
1329  if(!Ouf)
1330  return false;
1331  unsigned int ncells = nelem();
1332  unsigned int n_cvar = 5;
1333  Ouf << "# ROCFLU flow file" << endl
1334  << "# Precision and range" << endl
1335  << setw(8) << 15 << setw(8) << 307 << endl
1336  << "# Initial residual" << endl
1337  << setw(23) << scientific << setprecision(16)
1338  << _soln._resid << endl
1339  << "# Physical time" << endl
1340  << setw(23) << scientific << setprecision(16)
1341  << _soln._current_time << endl
1342  << "# Dimensions" << endl
1343  << setw(8) << ncells << setw(8) << n_cvar << endl
1344  << "# Mixture density" << endl;
1345  unsigned int cell = 0;
1346  unsigned int ll = 5;
1347  while(cell < ncells){
1348  Ouf << setw(23) << scientific << setprecision(16)
1349  << _soln._rhof[cell++];
1350  if(!(cell%ll))
1351  Ouf << endl;
1352  }
1353  if(cell%ll)
1354  Ouf << endl;
1355  for(int i = 0;i < 3;i++){
1356  Ouf << "# Mixture "
1357  << (i == 0 ? "x-momentum" :
1358  i == 1 ? "y-momentum" : "z-momentum")
1359  << endl;
1360  cell = 0;
1361  while(cell < ncells){
1362  Ouf << setw(23) << scientific << setprecision(16)
1363  << _soln._rhovf[(cell++)*3+i];
1364  if(!(cell%ll))
1365  Ouf << endl;
1366  }
1367  if(cell%ll)
1368  Ouf << endl;
1369  }
1370  Ouf << "# Mixture total internal energy" << endl;
1371  cell = 0;
1372  while(cell < ncells){
1373  Ouf << setw(23) << scientific << setprecision(16)
1374  << _soln._rhoEf[cell++];
1375  if(!(cell%ll))
1376  Ouf << endl;
1377  }
1378  if(cell%ll)
1379  Ouf << endl;
1380  Ouf << "# End" << endl;
1381  Ouf.close();
1382  WriteGSPASCII(pre,n,t);
1383  if(_debug && _out)
1384  *_out << "FluRegion::WriteFluSolnASCII: Exit\n";
1385  return(true);
1386 }
1387 
1388 bool
1389 FluRegion::WriteGSPASCII(const string &prefix,unsigned int n,
1390  double t,bool unsteady)
1391 {
1392  if(_debug && _out)
1393  *_out << "FluRegion::WriteGSPASCII: Enter\n";
1394  string pre(prefix);
1395  if(pre.empty()){
1396  if(_casename.empty())
1397  pre = "./";
1398  else
1399  pre = _casepath + "/" + _casename + ".";
1400  }
1401  else
1402  pre += ".";
1403  ostringstream Ostr;
1404  Ostr << pre << "gspa_" << setw(5) << setfill('0') << _id << "_";
1405  string filebase(Ostr.str());
1406  Ostr.str("");
1407  Ostr << setw(6) << setfill('0') << n;
1408  string iterstring(Ostr.str());
1409  Ostr.clear();
1410  Ostr.str("");
1411  Ostr << scientific << setprecision(5) << t;
1412  string timestring(Ostr.str());
1413  timestring.replace(7,1,"E");
1414  ofstream Ouf;
1415  if(!unsteady) filebase+=iterstring;
1416  else filebase+=timestring;
1417  Ouf.open(filebase.c_str());
1418  if(!Ouf)
1419  return false;
1420  Ouf << "# ROCFLU grid speeds file" << endl
1421  << "# Precision and range" << endl
1422  << setw(8) << 15 << setw(8) << 307 << endl
1423  << "# Physical time" << endl
1424  << setw(23) << scientific << setprecision(16)
1425  << t << endl
1426  << "# Dimensions" << endl
1427  << setw(8) << _nvface << endl
1428  << "# Grid speeds" << endl;
1429  unsigned int face = 0;
1430  unsigned int ll = 5;
1431  bool gsp = (_soln._gsp.size() != 0);
1432  if(_debug && _out){
1433  *_out << "FluRegion::WriteGSPASCII: nvface = " << _nvface << "\n";
1434  if(!gsp)
1435  *_out
1436  << "FluRegion::WriteGSPASCII:no gridspeeds for the volume faces.\n";
1437  }
1438  while(face < _nvface){
1439  Ouf << setw(23) << scientific << setprecision(16)
1440  << (gsp ? _soln._gsp[face] : 0);
1441  face++;
1442  if(!(face%ll))
1443  Ouf << endl;
1444  }
1445  if(face%ll)
1446  Ouf << endl;
1447  if(_debug && _out)
1448  *_out << "FluRegion::WriteGSPASCII: npatches = " << _patches.size()
1449  << "\n";
1450  vector<FluPatch>::iterator fpi = _patches.begin();
1451  while(fpi != _patches.end()){
1452  FluPatch &fp = *fpi++;
1453  gsp = (fp._soln._gsp.size() != 0);
1454  unsigned int nfaces = fp._ntri+fp._nquad-(fp._ngtri+fp._ngquad);
1455  if(_debug && _out){
1456  *_out << "FluRegion::WriteGSPASCII: npatch_faces = " << nfaces << "\n";
1457  if(!gsp)
1458  *_out << "FluRegion::WriteGSPASCII: no gridspeeds for patch faces."
1459  << "\n";
1460  }
1461  face = 0;
1462  while(face < nfaces){
1463  Ouf << setw(23) << scientific << setprecision(16)
1464  << (gsp ? fp._soln._gsp[face] : 0);
1465  face++;
1466  if(!(face%ll))
1467  Ouf << endl;
1468  }
1469  if(face%ll)
1470  Ouf << endl;
1471  }
1472  Ouf << "# End" << endl;
1473  Ouf.close();
1474  if(_debug && _out)
1475  *_out << "FluRegion::WriteGSPASCII: Exit\n";
1476  return true;
1477 }
1478 
1479 bool
1480 FluRegion::ReadGSPASCII(const string &prefix,unsigned int n,
1481  double t,bool unsteady)
1482 {
1483  if(_debug && _out)
1484  *_out << "FluRegion::ReadGSPASCII: Enter\n";
1485  string pre(prefix);
1486  if(pre.empty()){
1487  if(_casename.empty())
1488  pre = "./";
1489  else
1490  pre = _casepath + "/" + _casename;
1491  }
1492  ostringstream Ostr;
1493  Ostr << pre << ".gspa_" << setw(5) << setfill('0') << _id << "_";
1494  string filebase(Ostr.str());
1495  Ostr.str("");
1496  Ostr << setw(6) << setfill('0') << n;
1497  string iterstring(Ostr.str());
1498  Ostr.clear();
1499  Ostr.str("");
1500  Ostr << scientific << setprecision(5) << t;
1501  string timestring(Ostr.str());
1502  timestring.replace(7,1,"E");
1503  ifstream Inf;
1504  if(!unsteady)
1505  Inf.open((filebase+iterstring).c_str());
1506  else
1507  Inf.open((filebase+timestring).c_str());
1508  if(!Inf)
1509  return false;
1510  string line;
1511  SkipLines(Inf,6);
1512  Inf >> _nvface;
1513  _soln._gsp.resize(_nvface,0.0);
1514  SkipLines(Inf,2);
1515  unsigned int face = 0;
1516  while(face < _nvface)
1517  Inf >> _soln._gsp[face++];
1518  vector<FluPatch>::iterator fpi = _patches.begin();
1519  while(fpi != _patches.end()){
1520  FluPatch &fp = *fpi++;
1521  unsigned int nfaces = fp._ntri+fp._nquad-(fp._ngtri+fp._ngquad);
1522  fp._soln._gsp.resize(nfaces,0.0);
1523  face = 0;
1524  while(face < nfaces)
1525  Inf >> fp._soln._gsp[face++];
1526  fp.InitSurfaceSoln(pre,false);
1527  }
1528  Inf.close();
1529  return true;
1530 }
1531 
1532 
1533 bool
1534 FluRegion::BuildPatchMapping(map<unsigned int,unsigned int> &patch_mapping,
1535  const string &prefix)
1536 {
1537  // Build the patch mapping from the hand produced patch mapping file
1538  ostringstream Ostr;
1539  string pre(prefix);
1540  if(pre.empty()){
1541  if(_casename.empty())
1542  pre = "./";
1543  else
1544  pre = _casepath + "/" + _casename;
1545  }
1546  Ostr << pre << ".cgi";
1547  ifstream bcfile;
1548  bcfile.open(Ostr.str().c_str());
1549  if(!bcfile)
1550  return(false);
1551  // map< unsigned int,unsigned int > patch_mapping;
1552  unsigned int nggpatch_mapping_lines;
1553  bcfile >> _npatches_total >> nggpatch_mapping_lines;
1554  unsigned int patch_line = 0;
1555  while(patch_line < nggpatch_mapping_lines){
1556  unsigned int low, high, flupatch;
1557  bcfile >> low >> high >> flupatch;
1558  unsigned int p = low;
1559  while(p <= high)
1560  patch_mapping[p++] = flupatch;
1561  patch_line++;
1562  }
1563  if(_debug && _out){
1564  *_out << "FluRegion::BuildPatchMapping: Patch Mapping:\n";
1565  map<unsigned int,unsigned int>::iterator mi = patch_mapping.begin();
1566  while(mi != patch_mapping.end()){
1567  *_out << "FluRegion::BuildPatchMapping: (" << mi->first << ","
1568  << mi->second << ")\n";
1569  mi++;
1570  }
1571  }
1572  bcfile.close();
1573  return(true);
1574 }
1575 
1576 bool
1577 FluRegion::ReadRegionASCII(const string &prefix,unsigned int region_id,
1578  unsigned int n,double t,bool unsteady)
1579 {
1580  if(_debug && _out)
1581  *_out << "FluRegion::ReadRegionASCII:: Reading Rocflu Region "
1582  << "from Rocflu native files...\n";
1583  string pre(prefix);
1584  if(pre.empty()){
1585  if(_casename.empty())
1586  pre = "./";
1587  else
1588  pre = _casepath + "/" + _casename;
1589  }
1590  _id = region_id;
1591  if(!ReadFluDIM(pre,t,unsteady))
1592  return(false);
1593  if(!ReadFluCOM(pre)){
1594  if(_debug && _out)
1595  *_out << "FluRegion::ReadRegionASCII: ReadFluCOM failed.\n";
1596  return(false);
1597  }
1598  if(!ReadFluGridASCII(pre,t,unsteady)){
1599  if(_debug && _out)
1600  *_out << "FluRegion::ReadRegionASCII: ReadFluGridASCII failed.\n";
1601  return(false);
1602  }
1603  if(!ReadFluSolnASCII(pre,n,t,unsteady)){
1604  if(_debug && _out)
1605  *_out << "FluRegion::ReadRegionASCII: ReadFluSolnASCII failed.\n";
1606  return(false);
1607  }
1608  if(_debug && _out)
1609  *_out << "FluRegion::ReadRegionASCII:: Done reading Rocflu Region "
1610  << "from Rocflu native files.\n";
1611  return(true);
1612 }
1613 
1614 void
1616 {
1617  // Assumes rank = partition - 1
1618  int *local_index = NULL;
1619  int *remote_index = NULL;
1620  MPI_Request *req = NULL;
1621  int ind = 0;
1622  MPI_Status *status = NULL;
1623  if(_borders.size() > 0){
1624  local_index = new int [_borders.size()];
1625  req = new MPI_Request [2*_borders.size()];
1626  remote_index = new int [_borders.size()];
1627  status = new MPI_Status [_borders.size()*2];
1628  }
1629  vector<FluBorder>::iterator fbi = _borders.begin();
1630  while(fbi != _borders.end()){
1631  int remote_proc = fbi->_rpart - 1;
1632  local_index[ind] = ind + 1;
1633  MPI_Isend(&local_index[ind],1,MPI_INT,remote_proc,remote_proc,
1634  MPI_COMM_WORLD,&req[ind]);
1635  fbi++;
1636  ind++;
1637  }
1638  int ind2 = 0;
1639  fbi = _borders.begin();
1640  while(fbi != _borders.end()){
1641  int remote_proc = fbi->_rpart - 1;
1642  MPI_Irecv(&remote_index[ind2++],1,MPI_INT,remote_proc,_id-1,
1643  MPI_COMM_WORLD,&req[ind]);
1644  fbi++;
1645  ind++;
1646  }
1647  if(_borders.size() > 0)
1648  MPI_Waitall(_borders.size()*2,req,status);
1649 }
1650 
1651 //#ifdef _ROCSTAR_X_
1652 bool
1653 FluRegion::ComRemeshInitData(const string &wname,double *cell_data,
1654  int nval_cells, double *node_data,int nval_nodes)
1655 {
1656  _ntet = _tetconn.size()/4;
1657  _nhex = _hexconn.size()/8;
1658  _npris = _prisconn.size()/6;
1659  _npyr = _pyrconn.size()/5;
1660  _nnodes = _nc.size()/3;
1661  unsigned int n_elem = nelem();
1662  _soln.Resize(n_elem,0,_nnodes);
1663  _soln._unsteady = true;
1664  unsigned int ind = 0;
1665  unsigned int cdind = 0;
1666  unsigned int vind = 0;
1667  while(ind < n_elem){
1668  _soln._rhof[ind] = cell_data[cdind++];
1669  _soln._rhovf[vind++] = cell_data[cdind++];
1670  _soln._rhovf[vind++] = cell_data[cdind++];
1671  _soln._rhovf[vind++] = cell_data[cdind++];
1672  _soln._rhoEf[ind] = cell_data[cdind++];
1673  _soln._pf[ind] = cell_data[cdind++];
1674  _soln._Tf[ind] = cell_data[cdind++];
1675  _soln._af[ind] = cell_data[cdind++];
1676  ind++;
1677  }
1678  ind = 0;
1679  while(ind < _nnodes){
1680  _soln._disp[ind*3] = node_data[ind*3];
1681  _soln._disp[ind*3+1] = node_data[ind*3+1];
1682  _soln._disp[ind*3+2] = node_data[ind*3+2];
1683  ind++;
1684  }
1685  return(true);
1686 }
1687 
1688 bool
1690 {
1691  Create_com_volsoln("rhof",_soln._rhof,1,"kg/m^3");
1692  Create_com_volsoln("rhovf",_soln._rhovf,3,"kg/(m^2s)");
1693  Create_com_volsoln("rhoEf",_soln._rhoEf,1,"J/m^3");
1694  COM_new_attribute((volume_window+".gs"),'p',COM_DOUBLE,1,"m/s");
1695  COM_set_size((volume_window+".gs"),pane_id,_nvface);
1696  if(_soln._gsp.size() != 0)
1697  COM_set_array((volume_window+".gs"),pane_id,&(_soln._gsp[0]));
1698  Create_com_volsoln("pf",_soln._pf,1,"Pa");
1699  Create_com_volsoln("Tf",_soln._Tf,1,"K");
1700  Create_com_volsoln("af",_soln._af,1,"m/s");
1701  return(true);
1702 }
1703 
1704 bool
1705 FluPatch::RegisterSoln(const string &wname,bool all)
1706 {
1707  if(_debug && _out)
1708  *_out << "FluPatch(" << _id << ")::RegisterSoln: "
1709  << "Registering pane " << pane_id << "." << endl;
1710  if(_soln._gsp.size() != 0){
1711  COM_set_array((wname+".gs"),pane_id,&(_soln._gsp[0]));
1712  }
1713  bool do_t0 = (t0_coords.size() != 0);
1714  COM_set_size((wname+".patchNo"),pane_id,1);
1715  COM_set_array((wname+".patchNo"),pane_id,&_id);
1716  if(do_t0){
1717  COM_set_size((wname+"0"+".bcflag"),pane_id,1);
1718  COM_set_array((wname+"0"+".bcflag"),pane_id,&_bcflag);
1719  }
1720  COM_set_size((wname+".bcflag"),pane_id,1);
1721  COM_set_array((wname+".bcflag"),pane_id,&_bcflag);
1722  COM_set_size((wname+".constr_type"),pane_id,1);
1723  COM_set_array((wname+".constr_type"),pane_id,&_constr_type);
1724  if(all){
1725  COM_set_array((wname+".du_alp"),pane_id,&_soln._du_alp[0]);
1726  Create_com_surfsoln(wname,"rhofvf_alp",_soln._rhofvf_alp,3,"kg/(m^2s)");
1727  Create_com_surfsoln(wname,"nf_alp",_soln._nf_alp,3,"");
1728  Create_com_surfsoln(wname,"rhof_alp",_soln._rhof_alp,1,"kg/m^3");
1729  Create_com_surfsoln(wname,"pf",_soln._pf,1,"Pa");
1730  Create_com_surfsoln(wname,"qc",_soln._qc,1,"W/m^2");
1731  Create_com_surfsoln(wname,"qr",_soln._qr,1,"W/m^2");
1732  Create_com_surfsoln(wname,"tf",_soln._tf,3,"Pa");
1733  Create_com_surfsoln(wname,"Tb_alp",_soln._Tb_alp,1,"K");
1734  Create_com_surfsoln(wname,"mdot_alp",_soln._mdot_alp,1,"kg/(m^2s)");
1735  Create_com_surfsoln(wname,"Tflm_alp",_soln._Tflm_alp,1,"K");
1736  COM_set_array((wname+".bflag"),pane_id,&(_soln._bflag[0]));
1737  }
1738  return(true);
1739 }
1740 
1741 bool
1743 {
1744 
1745  if(_debug && _out)
1746  *_out << "FluRegion(" << _id << ")::RegisterSurfaceSoln Enter" << endl;
1747  COM_new_attribute((surface_window+".gs"),'e',COM_DOUBLE,1,"m/s");
1748  if(_t0_coords.size() != 0)
1749  COM_new_attribute((surface_window+"0"+".bcflag"),'p',COM_INT,1,"");
1750  COM_new_attribute((surface_window+".bcflag"),'p',COM_INT,1,"");
1751  COM_new_attribute((surface_window+".constr_type"),'p',COM_INT,1,"");
1752  COM_new_attribute((surface_window+".patchNo"),'p',COM_INT,1,"");
1753  if(all){
1754  COM_new_attribute((surface_window+".du_alp"),'n',COM_DOUBLE,3,"m");
1755  COM_new_attribute((surface_window+".bflag"),'e',COM_INT,1,"");
1756  COM_new_attribute(surface_window+".rhofvf_alp",'e',
1757  COM_DOUBLE,3,"kg/(m^2s)");
1758  COM_new_attribute(surface_window+".nf_alp",'e',COM_DOUBLE,3,"");
1759  COM_new_attribute(surface_window+".rhof_alp",'e',COM_DOUBLE,1,"kg/m^3");
1760  COM_new_attribute(surface_window+".pf",'e',COM_DOUBLE,1,"Pa");
1761  COM_new_attribute(surface_window+".qc",'e',COM_DOUBLE,1,"W/m^2");
1762  COM_new_attribute(surface_window+".qr",'e',COM_DOUBLE,1,"W/m^2");
1763  COM_new_attribute(surface_window+".tf",'e',COM_DOUBLE,3,"Pa");
1764  COM_new_attribute(surface_window+".Tb_alp",'e',COM_DOUBLE,1,"K");
1765  COM_new_attribute(surface_window+".mdot_alp",'e',COM_DOUBLE,1,"kg/(m^2s)");
1766  COM_new_attribute(surface_window+".Tflm_alp",'e',COM_DOUBLE,1,"K");
1767  }
1768  vector<FluPatch>::iterator fpi = _patches.begin();
1769  if(_debug && _out)
1770  *_out << "FluRegion(" << _id << ")::RegisterSurfaceSoln: "
1771  << "Registering patches..." << endl;
1772  while(fpi != _patches.end()){
1773  FluPatch &fp = *fpi++;
1774  fp.RegisterSoln(surface_window,all);
1775  }
1776  if(_debug && _out)
1777  *_out << "FluRegion(" << _id << ")::RegisterSurfaceSoln: "
1778  << "Registering patche done." << endl;
1779  return(true);
1780 }
1781 
1782 bool
1784 {
1785  COM_new_attribute((surface_window+".t3g:real"),'p',COM_INT,3,"");
1786  COM_new_attribute((surface_window+".t3g:virtual"),'p',COM_INT,3,"");
1787  COM_new_attribute((surface_window+".q4g:real"),'p',COM_INT,4,"");
1788  COM_new_attribute((surface_window+".q4g:virtual"),'p',COM_INT,4,"");
1789 
1790  vector<FluPatch>::iterator fpi = _patches.begin();
1791  while(fpi != _patches.end()){
1792  FluPatch &fp = *fpi++;
1793  unsigned int nreal = fp._triconn.size()/3 - fp._ngtri;
1794  if(nreal > 0){
1795  COM_set_size((surface_window+".t3g:real"),fp.pane_id,nreal);
1796  COM_set_array((surface_window+".t3g:real"),fp.pane_id,
1797  &(fp._triconn[0]),3);
1798  }
1799  nreal = fp._quadconn.size()/4 - fp._ngquad;
1800  if(nreal > 0){
1801  COM_set_size((surface_window+".q4g:real"),fp.pane_id,nreal);
1802  COM_set_array((surface_window+".q4g:real"),fp.pane_id,
1803  &(fp._quadconn[0]),4);
1804  }
1805  if(fp._ngtri > 0){
1806  nreal = fp._triconn.size()/3 - fp._ngtri;
1807  COM_set_size((surface_window+".t3g:virtual"),fp.pane_id,
1808  fp._ngtri,fp._ngtri);
1809  COM_set_array((surface_window+".t3g:virtual"),fp.pane_id,
1810  &(fp._triconn[nreal*3]),3);
1811  }
1812  if(fp._ngquad > 0){
1813  nreal = fp._quadconn.size()/4 - fp._ngquad;
1814  COM_set_size((surface_window+".q4g:virtual"),fp.pane_id,
1815  fp._ngquad,fp._ngquad);
1816  COM_set_array((surface_window+".q4g:virtual"),fp.pane_id,
1817  &(fp._quadconn[nreal*4]),4);
1818  }
1819  }
1820  return(true);
1821 }
1822 //#endif
1823 
1824 istream &
1825 SkipLines(istream &ioo,unsigned int n)
1826 {
1827  string line;
1828  unsigned int l = 0;
1829  while(l++ < n)
1830  getline(ioo,line);
1831  return(ioo);
1832 }
1833 
1834 
1835 
1836 
1837 
1838 
bool PopRemBordIndFILE(const string &p="", double=0.0, bool=true)
Definition: FluRegion.C:581
unsigned int _rbid
Definition: FluRegion.H:115
bool WriteFluCOM(const string &p="")
Definition: FluRegion.C:130
bool ReadFluSolnASCII(const std::string &p="", unsigned int=0, double=0.0, bool=true)
Definition: FluRegion.C:1229
void PopRemBordIndMPI()
Definition: FluRegion.C:1615
here we put it at the!beginning of the common block The point to point and collective!routines know about but MPI_TYPE_STRUCT as yet does not!MPI_STATUS_IGNORE and MPI_STATUSES_IGNORE are similar objects!Until the underlying MPI library implements the C version of these are declared as arrays of MPI_STATUS_SIZE!The types and are OPTIONAL!Their values are zero if they are not available Note that!using these reduces the portability of MPI_IO INTEGER MPI_BOTTOM INTEGER MPI_DOUBLE_PRECISION INTEGER MPI_LOGICAL INTEGER MPI_2REAL INTEGER MPI_2DOUBLE_COMPLEX INTEGER MPI_LB INTEGER MPI_WTIME_IS_GLOBAL INTEGER MPI_COMM_WORLD
bool ComRemeshInitData(const string &wname, double *cell_data, int nval_cells, double *node_data, int nval_nodes)
Definition: FluRegion.C:1653
bool WriteFluCMP(const string &p="")
Definition: FluRegion.C:697
bool InitSurfaceSoln(const string &prefix="", bool=false)
Definition: FluRegion.C:882
bool WriteFluSolnASCII(const std::string &p="", unsigned int=0, double=0.0, bool=true)
Definition: FluRegion.C:1298
Definition: face.h:90
bool CreateRegionMapFile(const string &p="", unsigned int=0, unsigned int=0)
Definition: FluRegion.C:328
bool ReadRegionASCII(const string &p="", unsigned int=0, unsigned int=0, double=0.0, bool=true)
Definition: FluRegion.C:1577
std::vector< unsigned int > _recvnodes
Definition: GEM.H:230
std::vector< unsigned int > _sendcells
Definition: GEM.H:227
void COM_set_size(const char *wa_str, int pane_id, int size, int ng=0)
Set sizes of for a specific attribute.
Definition: roccom_c++.h:136
bool ReadControlFile()
Definition: FluRegion.C:101
This file contains the prototypes for Roccom API.
bool ReadFluGridASCII(const std::string &p="", double=0.0, bool=true)
Definition: FluRegion.C:975
unsigned int _ntri
Definition: FluRegion.H:102
bool ReadFluCOM(const string &p="")
Definition: FluRegion.C:249
double sqrt(double d)
Definition: double.h:73
std::vector< unsigned int > _quadconn
Definition: GEM.H:132
Definition: adj.h:150
unsigned int _nquad
Definition: FluRegion.H:103
std::vector< unsigned int > _sharenodes
Definition: GEM.H:231
std::vector< unsigned int > _recvcells
Definition: GEM.H:228
std::vector< unsigned int > _sendnodes
Definition: GEM.H:229
bool RegisterSoln(const string &, bool)
Definition: FluRegion.C:1705
unsigned int nelem()
Definition: FluRegion.C:42
Definition: patch.h:74
unsigned int _id
Definition: GEM.H:127
std::vector< unsigned int > _triconn
Definition: GEM.H:131
bool BuildPatchMapping(map< unsigned int, unsigned int > &, const string &p="")
Definition: FluRegion.C:1534
bool RegisterVolumeSoln(bool)
Definition: FluRegion.C:1689
bool WriteGSPASCII(const std::string &p="", unsigned int=0, double=0.0, bool=true)
Definition: FluRegion.C:1389
unsigned int _ngquad
Definition: GEM.H:129
void report()
Definition: FluRegion.C:47
bool WriteFluDIM(const string &p="", double=0.0, bool=true)
Definition: FluRegion.C:378
blockLoc i
Definition: read.cpp:79
const NT & n
bool ReadFluDIM(const string &p="", double=0.0, bool=true)
Definition: FluRegion.C:463
bool WriteFluNative(const string &p="")
Definition: FluRegion.C:114
FluSurfSoln _soln
Definition: FluRegion.H:104
void COM_set_array(const char *wa_str, int pane_id, void *addr, int strd=0, int cap=0)
Associates an array with an attribute for a specific pane.
Definition: roccom_c++.h:156
vector< double > _gsp
Definition: FluRegion.H:74
bool RegisterSurfaceSoln(bool)
Definition: FluRegion.C:1742
static T_VertexSet * face
Definition: vinci_lass.c:79
bool InitSurfaceSoln(const string &p="")
Definition: FluRegion.C:862
bool InitVolumeSoln(const string &p="")
Definition: FluRegion.C:776
void int int REAL REAL REAL *z blockDim dim * ni
Definition: read.cpp:77
void COM_new_attribute(const char *wa_str, const char loc, const int type, int ncomp, const char *unit)
Registering an attribute type.
Definition: roccom_c++.h:118
istream & SkipLines(istream &, unsigned int=1)
bool WriteFluGridASCII(const string &pre="", double=0.0, bool=true)
Definition: FluRegion.C:1085
unsigned int _rpart
Definition: GEM.H:226
bool ReadGSPASCII(const std::string &p="", unsigned int=0, double=0.0, bool=true)
Definition: FluRegion.C:1480
bool RegisterFluSurfaceMesh()
Definition: FluRegion.C:1783
unsigned int _ngtri
Definition: GEM.H:128