79 fname = prefix +
"/RocfluControl.txt";
80 Inf.open(fname.c_str());
96 *gp.
_out <<
"TRAIL_FluWriteCOM::Error: No casename or path found."
104 <<
"TRAIL_FluWriteCOM: Error, called with empty rbid's."
111 Ostr << pre <<
".com_";
112 Ostr << setw(5) << setfill(
'0');
114 Ouf.open(Ostr.str().c_str());
118 <<
"TRAIL_FluWriteCOM: Error: Could not open " << Ostr.str() <<
"."
122 Ouf <<
"# ROCFLU communication lists file" << endl
123 <<
"# Dimensions" << endl
124 << setw(8) << gp.
_pb.size() << endl
125 <<
"# Information" << endl;
127 vector<GEM_PartitionBoundary>::iterator fbi = gp.
_pb.begin();
128 while(fbi != gp.
_pb.end()){
129 Ouf << setw(8) << fbi->_rpart << setw(8)
134 Ouf <<
"# Cells" << endl;
135 fbi = gp.
_pb.begin();
136 while(fbi != gp.
_pb.end()){
137 Ouf << setw(8) << fbi->_sendcells.size() << setw(8)
138 << fbi->_recvcells.size() << endl;
140 vector<unsigned int>::iterator sci = fbi->_sendcells.begin();
141 while(sci != fbi->_sendcells.end()){
142 Ouf << setw(8) << *sci++;
153 sci = fbi->_recvcells.begin();
154 while(sci != fbi->_recvcells.end()){
155 Ouf << setw(8) << *sci++;
168 Ouf <<
"# Vertices" << endl;
169 fbi = gp.
_pb.begin();
170 while(fbi != gp.
_pb.end()){
171 Ouf << setw(8) << fbi->_sendnodes.size() << setw(8)
172 << fbi->_recvnodes.size() << setw(8) << fbi->_sharenodes.size()
174 vector<unsigned int>::iterator
ni = fbi->_sendnodes.begin();
176 while(ni != fbi->_sendnodes.end()){
177 Ouf << setw(8) << *ni++;
184 if(line || fbi->_sendnodes.empty()){
188 ni = fbi->_recvnodes.begin();
190 while(ni != fbi->_recvnodes.end()){
191 Ouf << setw(8) << *ni++;
198 if(line || fbi->_recvnodes.empty()){
202 ni = fbi->_sharenodes.begin();
204 while(ni != fbi->_sharenodes.end()){
205 Ouf << setw(8) << *ni++;
212 if(line || fbi->_sharenodes.empty()){
218 Ouf <<
"# End" << endl;
227 *gp.
_out <<
"TRAIL_FluReadCOM::Error: No casename or path found."
237 <<
"TRAIL_FluReadCOM: Error,called with empty _int_data."
244 Ostr << pre <<
".com_";
245 Ostr << setw(5) << setfill(
'0');
247 Inf.open(Ostr.str().c_str());
251 <<
"TRAIL_FluReadCOM: Error: Cannot open " << Ostr.str() <<
"."
257 unsigned int nborders = 0;
260 *gp.
_out <<
"TRAIL_FluReadCOM(" << gp.
_id <<
"): nborders: "
262 assert(nborders == gp.
_pb.size() && nborders ==
265 unsigned int pbindex = 0;
266 vector<GEM_PartitionBoundary>::iterator fbi = gp.
_pb.begin();
267 while(fbi != gp.
_pb.end()){
270 Inf >> rpart >> rbid;
271 assert(fbi->_rpart == rpart &&
276 fbi = gp.
_pb.begin();
277 while(fbi != gp.
_pb.end()){
278 unsigned int rcells,scells;
279 Inf >> scells >> rcells;
280 assert(scells == fbi->_sendcells.size() &&
281 rcells == fbi->_recvcells.size());
283 int ncells = fbi->_sendcells.size();
285 Inf >> fbi->_sendcells[cell++];
287 ncells = fbi->_recvcells.size();
289 Inf >> fbi->_recvcells[cell++];
293 fbi = gp.
_pb.begin();
294 while(fbi != gp.
_pb.end()){
295 unsigned int nshare,nsend,nrecv;
296 Inf >> nsend >> nrecv >> nshare;
297 assert(nsend == fbi->_sendnodes.size() &&
298 nrecv == fbi->_recvnodes.size() &&
299 nshare == fbi->_sharenodes.size());
300 unsigned int node = 0;
301 unsigned int nnodes = fbi->_sendnodes.size();
303 Inf >> fbi->_sendnodes[node++];
305 nnodes = fbi->_recvnodes.size();
307 Inf >> fbi->_recvnodes[node++];
308 nnodes = fbi->_sharenodes.size();
311 Inf >> fbi->_sharenodes[node++];
320 unsigned int nregions,
const std::string &path)
324 *gp.
_out <<
"TRAIL_FluWriteMAP::Error: No casename or path found."
331 Ostr << pre <<
".map";
332 Ouf.open(Ostr.str().c_str());
335 Ouf <<
"# ROCFLU region mapping file" << endl
336 <<
"# Number of regions" << endl
337 << setw(8) << nregions << endl
338 <<
"# Number of processes" << endl
339 << setw(8) << nproc << endl;
340 unsigned int regpproc = nregions/nproc;
343 unsigned int left = nregions%nproc;
344 unsigned int proc = 0;
345 unsigned int reg = 0;
347 unsigned int nreg = regpproc;
352 Ouf <<
"# Process " << setw(6) << setfill(
'0') << proc+1 << endl
353 << setfill(
' ') << setw(8) << nreg << endl;
354 unsigned int uplimit = reg + nreg;
356 Ouf << setw(8) << (1+reg++) << endl;
359 Ouf <<
"# End" << endl;
366 const std::string &path)
370 *gp.
_out <<
"TRAIL_FluWriteDIM::Error: No casename or path found."
376 std::ostringstream Ostr;
377 Ostr << pre <<
".dim_";
378 Ostr << setw(5) << setfill(
'0');
380 std::string filebase(Ostr.str());
384 Ostr <<
"_" << scientific << setprecision(5) << t;
385 std::string timestring(Ostr.str());
386 timestring.replace(8,1,
"E");
387 filebase+=timestring;
389 Ouf.open(filebase.c_str());
392 *gp.
_out <<
"TRAIL_FluWriteDIM::Error: Could not open " << filebase <<
"."
396 unsigned int ntet = gp.
_tetconn.size()/4;
397 unsigned int nnodes = gp.
_nc.size()/3;
398 unsigned int nhex = gp.
_hexconn.size()/8;
399 unsigned int npris = gp.
_prisconn.size()/6;
400 unsigned int npyr = gp.
_pyrconn.size()/5;
401 unsigned int nelem = ntet + nhex + npris + npyr;
402 Ouf <<
"# ROCFLU dimensions file" << endl
403 <<
"# Vertices" << endl
404 << setw(8) << nnodes - gp.
_ngnodes << setw(8) << nnodes
405 << setw(8) << nnodes+(nnodes/5) << endl
409 << setw(8) << (nelem+(nelem/5)) << endl
410 <<
"# Tetrahedra" << endl
411 << setw(8) << ntet - gp.
_ngtet << setw(8) << ntet << setw(8)
414 <<
"# Hexahedra" << endl
415 << setw(8) << nhex - gp.
_nghex << setw(8) << nhex << setw(8)
418 <<
"# Prisms" << endl
419 << setw(8) << npris - gp.
_ngpris << setw(8) << npris << setw(8)
422 <<
"# Pyramids" << endl
423 << setw(8) << npyr - gp.
_ngpyr << setw(8) << npyr
424 << setw(8) << npyr+(npyr/5)
426 <<
"# Patches" << endl
427 << setw(8) << gp.
_db.size() << setw(8)
429 vector<GEM_DomainBoundary>::iterator fpi = gp.
_db.begin();
430 while(fpi != gp.
_db.end()){
431 Ouf << setw(8) << fpi->_id << setw(8)
432 << fpi->_triconn.size()/3 - fpi->_ngtri
433 << setw(8) << fpi->_triconn.size()/3 << setw(8)
434 << fpi->_quadconn.size()/4 - fpi->_ngquad
435 << setw(8) << fpi->_quadconn.size()/4 << endl;
438 Ouf <<
"# Borders" << endl
439 << setw(8) << gp.
_pb.size() << endl;
440 vector<GEM_PartitionBoundary>::iterator fbi = gp.
_pb.begin();
441 unsigned int pbindex = 0;
443 while(fbi != gp.
_pb.end()){
444 Ouf << setw(8) << fbi->_rpart << setw(8)
447 << fbi->_sendcells.size() << setw(8) << fbi->_recvcells.size()
449 << fbi->_sendnodes.size() << setw(8) << fbi->_recvnodes.size()
451 << fbi->_sharenodes.size() << endl;
454 Ouf <<
"# End" << endl;
462 *gp.
_out <<
"TRAIL_FluReadDIM: Entry" <<
"\n";
465 *gp.
_out <<
"TRAIL_FluReadDIM::Error: No casename or path found."
473 Ostr << pre <<
".dim_";
474 Ostr << setw(5) << setfill(
'0');
476 string filebase(Ostr.str());
480 Ostr <<
"_" << scientific << setprecision(5) << t;
481 string timestring(Ostr.str());
482 timestring.replace(8,1,
"E");
483 filebase+=timestring;
485 Inf.open(filebase.c_str());
488 *gp.
_out <<
"TRAIL_FluReadDIM: Unable to open " << filebase
489 <<
" for reading." << endl;
493 unsigned int nreal_cells = 0;
494 unsigned int ncells = 0;
495 unsigned int npatches = 0;
496 unsigned int nreal_tets = 0;
497 unsigned int nreal_hex = 0;
498 unsigned int nreal_pris = 0;
499 unsigned int nreal_pyr = 0;
500 unsigned int nreal_nodes = 0;
501 unsigned int ntet = 0;
502 unsigned int nhex = 0;
503 unsigned int npris = 0;
504 unsigned int npyr = 0;
505 unsigned int nnodes = 0;
507 Inf >> nreal_nodes >> nnodes;
509 Inf >> nreal_cells >> ncells;
511 Inf >> nreal_tets >> ntet;
513 Inf >> nreal_hex >> nhex;
515 Inf >> nreal_pris >> npris;
517 Inf >> nreal_pyr >> npyr;
519 unsigned int nelem = ntet + nhex + npyr + npris;
522 gp.
_ngtet = ntet - nreal_tets;
523 gp.
_nghex = nhex - nreal_hex;
524 gp.
_ngpyr = npyr - nreal_pyr;
525 gp.
_ngpris = npris - nreal_pris;
526 assert(nelem == ncells);
528 *gp.
_out <<
"TRAIL_FluReadDIM: Elems: (" << nelem <<
","
530 <<
"TRAIL_FluReadDIM: Nodes: (" << nnodes <<
","
532 <<
"TRAIL_FluReadDIM: Patches: (" << npatches <<
","
534 gp.
_db.resize(npatches);
539 gp.
_nc.resize(3*nnodes);
540 vector<GEM_DomainBoundary>::iterator fpi = gp.
_db.begin();
541 while(fpi != gp.
_db.end()){
542 unsigned int nreal_tri = 0;
543 unsigned int nreal_quad = 0;
544 unsigned int ntri = 0;
545 unsigned int nquad = 0;
546 Inf >> fpi->_id >> nreal_tri >> ntri >> nreal_quad >> nquad;
547 fpi->_ngtri = ntri - nreal_tri;
548 fpi->_ngquad = nquad - nreal_quad;
549 fpi->_triconn.resize(ntri*3);
550 fpi->_quadconn.resize(nquad*4);
553 unsigned int nborders = 0;
557 *gp.
_out <<
"TRAIL_FluReadDIM: Number of borders: " << nborders
559 gp.
_pb.resize(nborders);
561 unsigned int pbindex = 0;
562 vector<GEM_PartitionBoundary>::iterator fbi = gp.
_pb.begin();
563 while(fbi != gp.
_pb.end()){
564 unsigned int nsend,nrecv,nshared,csend,crecv;
567 >> nsend >> nrecv >> nshared;
569 *gp.
_out <<
"TRAIL_FluReadDIM: Border: ("
570 << fbi->_rpart <<
","
572 << csend <<
"," << crecv <<
"," << nsend <<
"," << nrecv
573 <<
"," << nshared <<
")" << endl;
574 fbi->_sharenodes.resize(nshared);
575 fbi->_sendnodes.resize(nsend);
576 fbi->_recvnodes.resize(nrecv);
577 fbi->_sendcells.resize(csend);
578 fbi->_recvcells.resize(crecv);
583 *gp.
_out <<
"TRAIL_FluReadDIM: Exit" << endl;
589 const std::string &path)
593 *gp.
_out <<
"TRAIL_FluPopRemBordIndFILE:Error: No casename or path found."
598 unsigned int pbindex = 0;
599 std::vector<GEM_PartitionBoundary>::iterator fbi = gp.
_pb.begin();
600 while(fbi != gp.
_pb.end()){
602 std::ostringstream Ostr;
603 Ostr << pre <<
".dim_";
604 Ostr << setw(5) << setfill(
'0');
606 std::string filebase(Ostr.str());
610 Ostr <<
"_" << scientific << setprecision(5) << t;
611 std::string timestring(Ostr.str());
612 timestring.replace(8,1,
"E");
613 filebase+=timestring;
615 Inf.open(filebase.c_str());
619 <<
"TRAIL_FluPopRemBordIndFILE: Unable to open "
620 << filebase <<
" for reading.\n";
624 unsigned int fakeout = 0;
625 unsigned int nreal_cells = 0;
626 unsigned int nnodes = 0;
627 unsigned int nhex = 0;
628 unsigned int ntet = 0;
629 unsigned int npris = 0;
630 unsigned int npyr = 0;
631 unsigned int ncells = 0;
632 unsigned int npatches = 0;
633 unsigned int nreal_tets = 0;
634 unsigned int nreal_hex = 0;
635 unsigned int nreal_pris = 0;
636 unsigned int nreal_pyr = 0;
637 unsigned int nreal_nodes = 0;
638 unsigned int npatches_total = 0;
639 unsigned int ngnodes = 0;
640 unsigned int ngtet = 0;
641 unsigned int nghex = 0;
642 unsigned int ngpris = 0;
643 unsigned int ngpyr = 0;
645 Inf >> nreal_nodes >> nnodes;
647 Inf >> nreal_cells >> ncells;
649 Inf >> nreal_tets >> ntet;
651 Inf >> nreal_hex >> nhex;
653 Inf >> nreal_pris >> npris;
655 Inf >> nreal_pyr >> npyr;
657 Inf >> npatches >> npatches_total;
658 ngnodes = nnodes - nreal_nodes;
659 ngtet = ntet - nreal_tets;
660 nghex = nhex - nreal_hex;
661 ngpyr = npyr - nreal_pyr;
662 ngpris = npris - nreal_pris;
664 *gp.
_out <<
"GEM_Partition(" << gp.
_id
665 <<
")::PopRemBordIndFILE::Elems: ("
666 << ntet+npris+nhex+npyr
667 <<
"," << ngtet+nghex+ngpyr+ngpris <<
")\n"
668 <<
"GEM_Partition(" << gp.
_id <<
")::PopRemBordIndFILE"
672 <<
"GEM_Partition(" << gp.
_id
673 <<
")::PopRemBordIndFILE:: Patches: ("
675 << npatches_total <<
")\n";
676 for(
unsigned int pind = 0;pind < npatches;pind++){
677 unsigned int nreal_tri = 0;
678 unsigned int nreal_quad = 0;
679 Inf >> fakeout >> nreal_tri >> fakeout >> nreal_quad >> fakeout;
681 unsigned int nborders = 0;
685 *gp.
_out <<
"GEM_Partition(" << gp.
_id <<
")::PopRemBordIndFILE:: "
686 <<
"Number of borders: " << nborders
689 for(
unsigned int bind = 0;(bind < nborders && !done);bind++){
697 Inf >> fakeout >> fakeout >> fakeout >> fakeout >> fakeout >> fakeout;
713 *gp.
_out <<
"TRAIL_FluWriteCMP:Error: No casename or path found."
719 std::ostringstream Ostr;
720 Ostr << pre <<
".cmp_";
721 Ostr << setw(5) << setfill(
'0');
723 Ouf.open(Ostr.str().c_str());
726 unsigned int ntet = gp.
_tetconn.size()/4;
727 unsigned int nhex = gp.
_hexconn.size()/8;
728 unsigned int npris = gp.
_prisconn.size()/6;
729 unsigned int npyr = gp.
_pyrconn.size()/5;
731 Ouf <<
"# ROCFLU cell mapping file" << endl
732 <<
"# Dimensions" << endl
733 << setw(8) << ntet << setw(8) << nhex << setw(8) << npris
734 << setw(8) << npyr << endl;
738 unsigned int npl = 10;
741 Ouf <<
"# Tetrahedra" << endl;
743 Ouf << setw(8) << gp.
Elem2Cell(make_pair(1,++el));
747 if(el%npl) Ouf << endl;
751 Ouf <<
"# Hexahedra" << endl;
753 Ouf << setw(8) << gp.
Elem2Cell(make_pair(4,++el));
757 if(el%npl) Ouf << endl;
761 Ouf <<
"# Prisms" << endl;
763 Ouf << setw(8) << gp.
Elem2Cell(make_pair(3,++el));
767 if(el%npl) Ouf << endl;
771 Ouf <<
"# Pyramids" << endl;
773 Ouf << setw(8) << gp.
Elem2Cell(make_pair(2,++el));
777 if(el%npl) Ouf << endl;
779 Ouf <<
"# End" << endl;
789 unsigned int nnodes = gp.
_nc.size()/3;
790 unsigned int nvfaces = gp.
_nvface;
792 *gp.
_out <<
"TRAIL_FluResizeVolSoln: Allocating for " << ncells <<
" cells"
793 <<
", " << nnodes <<
" nodes and " << nvfaces <<
" volume faces."
824 *gp.
_out <<
"TRAIL_FluResizeVolSoln: Volume data allocated." << std::endl;
833 *gp.
_out <<
" TRAIL_FluInitVolSoln::Error: Solver data contains no path."
840 string fname(pre+
".inp");
842 Inf.open(fname.c_str());
845 *gp.
_out <<
" TRAIL_FluInitVolSoln::Error: Could not open " << fname
850 unsigned int ntet = gp.
_tetconn.size()/4;
851 unsigned int npyr = gp.
_pyrconn.size()/5;
852 unsigned int nhex = gp.
_hexconn.size()/8;
853 unsigned int npris = gp.
_prisconn.size()/6;
854 unsigned int nelem = ntet + npyr + npris + nhex;
866 *gp.
_out <<
"TRAIL_FluInitVolSoln: Initializing volume data." << std::endl;
867 while(getline(Inf,line)){
869 string::size_type xtime = line.find(
"STARTTIME");
870 string::size_type ftype = line.find(
"FLOWTYPE");
871 string::size_type xgamma = line.find(
"GAMMA");
872 string::size_type xpress = line.find(
"PRESS");
873 string::size_type x_dens = line.find(
"DENS");
874 string::size_type x_velx = line.find(
"VELX");
875 string::size_type x_vely = line.find(
"VELY");
876 string::size_type x_velz = line.find(
"VELZ");
877 string::size_type x_cp = line.find(
"CP");
879 istringstream Istr(line);
880 if(xtime != string::npos)
882 if(ftype != string::npos)
884 if(xgamma != string::npos)
885 Istr >> tstr >> gamma;
886 if(xpress != string::npos)
887 Istr >> tstr >> press;
888 if(x_dens != string::npos)
890 if(x_velx != string::npos)
891 Istr >> tstr >> velx;
892 if(x_vely != string::npos)
893 Istr >> tstr >> vely;
894 if(x_velz != string::npos)
895 Istr >> tstr >> velz;
896 if(x_cp != string::npos)
900 if(gamma < 0 || press < 0 || rho < 0 || cp < 0)
904 double E = press/(rho*(gamma - 1.0)) +
905 (velx*velx + vely*vely + velz*velz)/2.0;
908 if(velx != 0.0 || vely != 0.0 || velz != 0.0){
909 unsigned int index = 0;
910 for(
unsigned int el = 0;el < nelem;el++){
916 double R = (cp*(gamma-1.0))/gamma;
917 double Ti = press/(rho*R);
918 double C =
sqrt(gamma*press/rho);
932 *gp.
_out <<
"TRAIL_FluInitVolSoln: Volume data initialized." << std::endl;
941 unsigned int nvert = db.
NNodes();
943 *db.
_out <<
"TRAIL_FluResizeSurfSoln: Resizing with " << nfaces <<
" faces"
944 <<
" and " << nvert <<
" vertices." << std::endl;
998 *db.
_out <<
"TRAIL_FluResizeSurfSoln: Resizing done." << std::endl;
1007 unsigned int ntri = db.
_triconn.size()/3;
1008 unsigned int nquad = db.
_quadconn.size()/4;
1009 unsigned int nfaces = ntri + nquad;
1026 int constraint_map[] = { 2 , 120, 121, 122, -122, -121, -120, 0};
1028 string fname(pre+
".bc");
1030 Inf.open(fname.c_str());
1033 *db.
_out <<
"TRAIL_FluInitSurfSoln: Error: could not locate bc file, "
1034 << fname <<
"." << std::endl;
1038 bool found_patch =
false;
1039 while(getline(Inf,line) && !found_patch){
1041 string::size_type patchx = line.find(
"PATCH");
1042 if( patchx != string::npos){
1044 unsigned int ubound,lbound;
1045 istringstream Istr(line);
1046 Istr >> tstr >> lbound >> ubound;
1047 if(db.
_id >= lbound && db.
_id <= ubound)
1054 *db.
_out <<
"TRAIL_FluInitSurfSoln: Error: "
1055 <<
"Did not find patch " << db.
_id <<
" in bc file." << endl;
1059 bool end_section =
false;
1064 while(getline(Inf,line) && !end_section){
1065 if(line[0] ==
'#') end_section =
true;
1067 string::size_type movx = line.find(
"MOVEDIR");
1068 string::size_type coupx = line.find(
"COUPLED");
1069 string::size_type burn = line.find(
"BFLAG");
1070 if(movx != string::npos){
1073 istringstream Istr(line);
1074 Istr >> tstr >> mvdir;
1077 if(coupx != string::npos){
1079 istringstream Istr(line);
1082 if(burn != string::npos){
1084 unsigned int burnf = 0;
1085 istringstream Istr(line);
1086 Istr >> tstr >> burnf;
1095 *db.
_out <<
"TRAIL_FluInitSurfSoln: Exit" << endl;
1106 *gp.
_out <<
"TRAIL_FluNumPatches:Error: solver data has no casename"
1107 <<
" or path." << std::endl;
1112 string filename(pre+
".bc");
1114 Inf.open(filename.c_str());
1126 while(getline(Inf,line) && !found){
1128 string::size_type patchx = line.find(
"PATCH");
1129 if( patchx != string::npos){
1131 unsigned int ubound,lbound;
1132 istringstream Istr(line);
1133 Istr >> tstr >> lbound >> ubound;
1134 npatches += ((ubound - lbound) + 1);
1150 *gp.
_out <<
"TRAIL_FluInitSurfSoln::Error: Solver data contains no"
1151 <<
" path." << std::endl;
1154 unsigned int ndb = gp.
_db.size();
1186 *db.
_out <<
"TRAIL_FluRegisterSoln: "
1187 <<
"Registering pane " << db.
pane_id <<
"." << endl;
1241 *gp.
_out <<
"TRAIL_FluRegisterSurfSoln Enter"
1275 vector<GEM_DomainBoundary>::iterator fpi = gp.
_db.begin();
1277 *gp.
_out <<
"TRAIL_FluRegisterSurfSoln: "
1278 <<
"Registering domain boundaries..." << endl;
1279 while(fpi != gp.
_db.end()){
1284 *gp.
_out <<
"TRAIL_FluRegisterSurfSoln: "
1285 <<
"Registering domain boundaries done." << endl;
1297 vector<GEM_DomainBoundary>::iterator fpi = gp.
_db.begin();
1298 while(fpi != gp.
_db.end()){
1332 const string &prefix)
1343 Ostr << pre <<
".cgi";
1345 bcfile.open(Ostr.str().c_str());
1349 unsigned int nggpmap_lines;
1350 unsigned int npatches_total;
1352 bcfile >> npatches_total >> nggpmap_lines;
1353 unsigned int patch_line = 0;
1354 while(patch_line < nggpmap_lines){
1355 unsigned int low, high, flupatch;
1356 bcfile >> low >> high >> flupatch;
1357 unsigned int p = low;
1359 pmap[p++] = flupatch;
1383 *gp.
_out <<
"TRAIL_FluPopulatePatches:Error: solver data has no casename"
1384 <<
" or path." << std::endl;
1389 map<unsigned int,unsigned int> patch_mapping;
1408 *(gp.
_out) <<
"TRAIL_FluWriteNative: Error. Called with empty"
1409 <<
" solver data." << endl;
1437 *gp.
_out <<
"TRAIL_FluReadGridASCII:Error: solver data has no casename"
1438 <<
" or path." << std::endl;
1444 Ostr << pre <<
".grda_" << setw(5) << setfill(
'0') << gp.
_id;
1445 string filebase(Ostr.str());
1448 Ostr <<
"_" << scientific << setprecision(5) << t;
1449 string timestring(Ostr.str());
1450 timestring.replace(8,1,
"E");
1451 if(unsteady) filebase+=timestring;
1453 Inf.open(filebase.c_str());
1456 *gp.
_out <<
"TRAIL_FluReadGridASCII: Unable to open " << filebase
1457 <<
" for reading.\n";
1462 unsigned int nnode,ntet,nhex,npris,npyr;
1463 Inf >> nnode >> ntet >> nhex >> npris >> npyr;
1464 assert(nnode == gp.
_nc.size()/3 &&
1470 for(
int i = 0;
i < 3;
i++){
1471 unsigned int node = 0;
1473 Inf >> gp.
_nc[(node++)*3+
i];
1478 for(
int i = 0;
i < 4;
i++){
1479 unsigned int el = 0;
1487 for(
int i = 0;
i < 8;
i++){
1488 unsigned int el = 0;
1496 for(
int i = 0;
i < 6;
i++){
1497 unsigned int el = 0;
1505 for(
int i = 0;
i < 5;
i++){
1506 unsigned int el = 0;
1512 unsigned int npatches = 0;
1513 unsigned int patch = 0;
1515 assert(npatches == gp.
_db.size());
1516 while(patch < npatches){
1518 unsigned int ntri,nquad;
1519 Inf >> ntri >> nquad;
1523 for(
int i = 0;
i < 3;
i++){
1524 unsigned int tri = 0;
1531 for(
int i = 0;
i < 4;
i++){
1532 unsigned int quad = 0;
1549 std::string filename;
1550 filename.assign(casename+
".bc");
1551 Inf.open((casepath+
"/"+filename).c_str());
1552 Ouf.open((path+
"/"+filename).c_str());
1558 filename.assign(casename+
".cgi");
1559 Inf.open((casepath+
"/"+filename).c_str());
1560 Ouf.open((path+
"/"+filename).c_str());
1566 filename.assign(casename+
".inp");
1567 Inf.open((casepath+
"/"+filename).c_str());
1568 Ouf.open((path+
"/"+filename).c_str());
1574 filename.assign(casename+
".map");
1575 Inf.open((casepath+
"/"+filename).c_str());
1576 Ouf.open((path+
"/"+filename).c_str());
void TRAIL_FluResizeSurfSoln(GEM_DomainBoundary &db)
bool TRAIL_FluWriteCOM(GEM_Partition &gp, const std::string &path)
bool TRAIL_FluReadControlFile(GEM_Partition &gp, const std::string &prefix="./")
void Create_com_surfsoln(const std::string &wname, const std::string &fname, std::vector< double > &fvec, unsigned int ncomp, const std::string &unit)
void MapDomainBoundaries(std::map< unsigned int, unsigned int > &bcmap)
void Create_com_volsoln(const std::string &fname, std::vector< double > &fvec, unsigned int ncomp, const std::string &unit)
bool TRAIL_FluWriteMAP(GEM_Partition &gp, unsigned int nproc, unsigned int nregions, const std::string &path)
bool TRAIL_FluInitSolver(GEM_Partition &gp, const std::string &prefix="./")
std::vector< unsigned int > _tetconn
bool TRAIL_FluBuildPatchMapping(std::map< unsigned int, unsigned int > &pmap, const std::string &prefix)
std::vector< std::vector< int > > _int_data
bool TRAIL_FluReadCOM(GEM_Partition &gp)
void COM_set_size(const char *wa_str, int pane_id, int size, int ng=0)
Set sizes of for a specific attribute.
std::vector< std::string > _string_data
This file contains the prototypes for Roccom API.
unsigned int NNodes(void)
bool TRAIL_FluInitVolSoln(GEM_Partition &gp)
std::vector< unsigned int > _quadconn
std::vector< std::vector< double > > _field_data
bool TRAIL_FluInitSurfSoln(GEM_DomainBoundary &db, const std::string &, bool all=true)
bool TRAIL_FluWriteCMP(GEM_Partition &gp, const std::string &path)
std::vector< int > _stride_int
bool TRAIL_FluRegisterSurfMesh(GEM_Partition &gp)
unsigned int Elem2Cell(std::pair< unsigned int, unsigned int >)
std::vector< unsigned int > _triconn
bool TRAIL_FluPopulatePatches(GEM_Partition &gp)
std::vector< GEM_DomainBoundary > _db
bool TRAIL_FluRegisterSurfSoln(GEM_DomainBoundary &db, const std::string &wname, bool all=true)
bool TRAIL_FluWriteNative(GEM_Partition &gp, const std::string &path)
std::vector< unsigned int > _pyrconn
std::vector< unsigned int > _hexconn
void TRAIL_FluResizeVolSoln(GEM_Partition &gp)
std::vector< int > _stride_field
bool TRAIL_FluReadDIM(GEM_Partition &gp, double t=0.0, bool unsteady=true)
bool TRAIL_FluPopRemBordIndFILE(GEM_Partition &gp, double t=0.0, bool unsteady=true, const std::string &path="./")
std::vector< GEM_PartitionBoundary > _pb
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.
bool TRAIL_FluReadGridASCII(GEM_Partition &gp, double t=0.0, bool unsteady=true)
std::string volume_window
GEM_UserData _solver_data
void int int REAL REAL REAL *z blockDim dim * ni
void COM_new_attribute(const char *wa_str, const char loc, const int type, int ncomp, const char *unit)
Registering an attribute type.
istream & SkipLines(istream &, unsigned int=1)
std::vector< double > _nc
std::vector< unsigned int > _prisconn
bool TRAIL_FluRegisterVolSoln(GEM_Partition &gp, bool all=true)
void TRAIL_FluCopyCaseFiles(GEM_Partition &gp, const std::string &path)
std::string surface_window
bool TRAIL_FluWriteDIM(GEM_Partition &gp, double t=0.0, bool unsteady=true, const std::string &path="./")
int TRAIL_FluNumPatches(GEM_Partition &gp)