Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FluRegion Class Reference

#include <FluRegion.H>

Inheritance diagram for FluRegion:
Collaboration diagram for FluRegion:

Public Member Functions

void report ()
 
unsigned int nelem ()
 
bool BuildCellMapping ()
 
bool Cell2Elem (unsigned int, unsigned int &, unsigned int &)
 
bool BuildPatchMapping (map< unsigned int, unsigned int > &, const string &p="")
 
bool WriteFluNative (const string &p="")
 
bool WriteFluCMP (const string &p="")
 
bool ReadFluCOM (const string &p="")
 
bool WriteFluCOM (const string &p="")
 
bool ReadFluDIM (const string &p="", double=0.0, bool=true)
 
bool WriteFluDIM (const string &p="", double=0.0, bool=true)
 
bool ReadFluGridASCII (const std::string &p="", double=0.0, bool=true)
 
bool WriteFluGridASCII (const string &pre="", double=0.0, bool=true)
 
bool ReadFluSolnASCII (const std::string &p="", unsigned int=0, double=0.0, bool=true)
 
bool WriteFluSolnASCII (const std::string &p="", unsigned int=0, double=0.0, bool=true)
 
bool WriteGSPASCII (const std::string &p="", unsigned int=0, double=0.0, bool=true)
 
bool ReadGSPASCII (const std::string &p="", unsigned int=0, double=0.0, bool=true)
 
bool ReadRegionASCII (const string &p="", unsigned int=0, unsigned int=0, double=0.0, bool=true)
 
bool InitSurfaceSoln (const string &p="")
 
bool InitVolumeSoln (const string &p="")
 
bool CreateRegionMapFile (const string &p="", unsigned int=0, unsigned int=0)
 
void PopRemBordIndMPI ()
 
bool PopRemBordIndFILE (const string &p="", double=0.0, bool=true)
 
bool ComRemeshInitData (const string &wname, double *cell_data, int nval_cells, double *node_data, int nval_nodes)
 
bool ReadControlFile ()
 
 FluRegion ()
 
 FluRegion (const GEM_Partition &gp)
 
template<typename DB >
bool PopulateFluPatches (const string &pre, vector< DB > &db)
 
template<typename PB >
bool PopulateFluBorders (vector< PB > &pb)
 
bool validate_comm_list (int ncsend, int ncrecv, int *csend, int *crecv)
 
void AddFluBorder (int rpid, int rpin, int nnshare, int nnsend, int nnrecv, int ncsend, int ncrecv, int *nshared, int *nsend, int *nrecv, int *csend, int *crecv)
 
void AddFluPatch (int patch_id, int ntri, int ngtri, int *tris, int nquad, int ngquad, int *quads)
 
bool RegisterFluSurfaceMesh ()
 
bool RegisterSurfaceSoln (bool)
 
bool RegisterVolumeSoln (bool)
 
- Public Member Functions inherited from GEM_Partition
bool validate_comm_list (int ncsend, int ncrecv, int *csend, int *crecv)
 
bool ValidateMesh ()
 
void AddParitionBoundary (int rpid, int nnshare, int nnsend, int nnrecv, int ncsend, int ncrecv, int *nshared, int *nsend, int *nrecv, int *csend, int *crecv)
 
void AddDomainBoundary (int db_id, int ntri, int ngtri, int *tris, int nquad, int ngquad, int *quads)
 
bool SetSolverDataBlock (const std::string &wname, double *cell_data, int nval_cells, double *node_data, int nval_nodes)
 
bool AddSolverDataBlock (const std::string &wname, double *cell_data, int nval_cells, double *node_data, int nval_nodes)
 
bool debug (bool s=true)
 
void ResolveCellMapping (GEM_Partition &sp)
 
void SetNodalCoordinates (double *data, int nn, int ng)
 
void SetVolumeElements (int *data, int ncells, int ng, int npe)
 
bool PopulatePartitionBoundaries (std::vector< GEM_PartitionBoundary > &pb)
 
void MapDomainBoundaries (std::map< unsigned int, unsigned int > &bcmap)
 
void report ()
 
void report_partition_boundaries ()
 
void report_domain_boundaries ()
 
unsigned int nelem ()
 
unsigned int Elem2Cell (std::pair< unsigned int, unsigned int >)
 
std::pair< unsigned int,
unsigned int > 
Cell2Elem (unsigned int)
 
void Register_com_volconn (const std::string &wname, int paneid, unsigned int nel, unsigned int ngel, std::vector< unsigned int > &conn, unsigned int esize, bool ghost_part=false)
 
bool WindowInitDone ()
 
bool DestroyWindows ()
 
bool WriteRocstar (const std::string &, double t=0.0)
 
bool ReadRocstar (const std::string &, double t=0.0)
 
bool InitRoccomWindows (const std::string &wname)
 
void Create_com_pconn (std::vector< unsigned int > rpids, std::vector< std::vector< std::vector< unsigned int > > > &index_vectors, unsigned int &nreal, unsigned int &ng, std::vector< int > &pc)
 
bool CreatePconn (const std::string &wname)
 
bool PopulateVolumeWindow (const std::string &wname)
 
bool PopulateSurfaceWindow (const std::string &wname)
 
void Create_com_volsoln (const std::string &fname, std::vector< double > &fvec, unsigned int ncomp, const std::string &unit)
 
 GEM_Partition (const GEM_Partition &gp)
 
 GEM_Partition ()
 
 GEM_Partition (unsigned int id, MPI_Comm comm=MPI_COMM_NULL)
 
GEM_Partitionoperator= (const GEM_Partition &gp)
 

Public Attributes

string _casename
 
string _casepath
 
unsigned int _nnodes
 
unsigned int _ntet
 
unsigned int _nhex
 
unsigned int _npyr
 
unsigned int _npris
 
unsigned int _npatches_total
 
vector< FluPatch_patches
 
vector< FluBorder_borders
 
FluVolumeSoln _soln
 
vector< pair< unsigned int,
unsigned int > > 
_cellmap
 
- Public Attributes inherited from GEM_Partition
unsigned int _id
 
unsigned int _npart
 
unsigned int _ngnodes
 
unsigned int _ngtet
 
unsigned int _nghex
 
unsigned int _ngpyr
 
unsigned int _ngpris
 
unsigned int _nvface
 
std::vector< double > _nc
 
std::vector< unsigned int > _tetconn
 
std::vector< unsigned int > _pyrconn
 
std::vector< unsigned int > _prisconn
 
std::vector< unsigned int > _hexconn
 
unsigned int _cell_ordering [4]
 
std::vector
< GEM_PartitionBoundary
_pb
 
std::vector< GEM_DomainBoundary_db
 
GEM_UserData _data
 
GEM_UserData _solver_data
 
std::ostream * _out
 
bool _debug
 
MPI_Comm _comm
 
int pane_id
 
std::vector< int > pconn
 
unsigned int pconn_nghost
 
std::string volume_window
 
std::string surface_window
 

Detailed Description

Definition at line 119 of file FluRegion.H.

Constructor & Destructor Documentation

FluRegion ( )
inline

Definition at line 170 of file FluRegion.H.

References _borders, _casename, GEM_Partition::_cell_ordering, _nhex, _nnodes, _npatches_total, _npris, _npyr, _ntet, and _patches.

171  : GEM_Partition()
172  {
173  _casename = "";
174  _nnodes = 0;
175  _ntet = 0;
176  _npyr = 0;
177  _npris = 0;
178  _nhex = 0;
179  _npatches_total = 0;
180  _patches.resize(0);
181  _borders.resize(0);
182  _cell_ordering[0] = 1;
183  _cell_ordering[1] = 4;
184  _cell_ordering[2] = 3;
185  _cell_ordering[3] = 2;
186  };
unsigned int _npyr
Definition: FluRegion.H:129
vector< FluBorder > _borders
Definition: FluRegion.H:133
unsigned int _nnodes
Definition: FluRegion.H:126
unsigned int _cell_ordering[4]
Definition: GEM.H:303
unsigned int _npatches_total
Definition: FluRegion.H:131
unsigned int _nhex
Definition: FluRegion.H:128
GEM_Partition()
Definition: GEM.H:444
unsigned int _npris
Definition: FluRegion.H:130
vector< FluPatch > _patches
Definition: FluRegion.H:132
unsigned int _ntet
Definition: FluRegion.H:127
string _casename
Definition: FluRegion.H:121
FluRegion ( const GEM_Partition gp)
inline

Definition at line 187 of file FluRegion.H.

References _casename, GEM_Partition::_cell_ordering, GEM_Partition::_hexconn, GEM_Partition::_nc, _nhex, _nnodes, _npris, _npyr, _ntet, GEM_Partition::_prisconn, GEM_Partition::_pyrconn, and GEM_Partition::_tetconn.

188  : GEM_Partition(gp)
189  {
190  _casename = "";
191  _nnodes = gp._nc.size()/3;
192  _ntet = gp._tetconn.size()/4;
193  _npyr = gp._pyrconn.size()/5;
194  _npris = gp._prisconn.size()/6;
195  _nhex = gp._hexconn.size()/8;
196  _cell_ordering[0] = 1;
197  _cell_ordering[1] = 4;
198  _cell_ordering[2] = 3;
199  _cell_ordering[3] = 2;
200  };
unsigned int _npyr
Definition: FluRegion.H:129
std::vector< unsigned int > _tetconn
Definition: GEM.H:295
unsigned int _nnodes
Definition: FluRegion.H:126
unsigned int _cell_ordering[4]
Definition: GEM.H:303
unsigned int _nhex
Definition: FluRegion.H:128
GEM_Partition()
Definition: GEM.H:444
std::vector< unsigned int > _pyrconn
Definition: GEM.H:297
unsigned int _npris
Definition: FluRegion.H:130
std::vector< unsigned int > _hexconn
Definition: GEM.H:301
unsigned int _ntet
Definition: FluRegion.H:127
std::vector< double > _nc
Definition: GEM.H:293
std::vector< unsigned int > _prisconn
Definition: GEM.H:299
string _casename
Definition: FluRegion.H:121

Member Function Documentation

void AddFluBorder ( int  rpid,
int  rpin,
int  nnshare,
int  nnsend,
int  nnrecv,
int  ncsend,
int  ncrecv,
int *  nshared,
int *  nsend,
int *  nrecv,
int *  csend,
int *  crecv 
)
inline

Definition at line 286 of file FluRegion.H.

References _borders, GEM_Partition::_debug, GEM_Partition::_id, GEM_PartitionBoundary::_out, GEM_Partition::_out, FluBorder::_rbid, GEM_PartitionBoundary::populate(), and validate_comm_list().

289  {
290  assert(rpid > 0 && rpin >= 0);
291  if(_debug && _out)
292  *_out << "FluRegion(" << _id << ")::AddFluBorder: Adding Border with"
293  << " region " << rpid << "." << endl;
294  FluBorder new_border;
295  new_border._rbid = rpin;
296  new_border._out = _out;
297  if(!validate_comm_list(ncsend,ncrecv,csend,crecv)){
298  if(_out)
299  *_out << "FluRegion(" << _id << ")::AddFluBorder: Validation of "
300  << "communication arrays failed, aborting." << endl;
301  exit(-1);
302  }
303  new_border.populate(rpid,nnshare,nnsend,nnrecv,ncsend,ncrecv,
304  nshared,nsend,nrecv,csend,crecv);
305  _borders.push_back(new_border);
306  };
unsigned int _rbid
Definition: FluRegion.H:115
vector< FluBorder > _borders
Definition: FluRegion.H:133
unsigned int _id
Definition: GEM.H:284
std::ostream * _out
Definition: GEM.H:308
std::ostream * _out
Definition: GEM.H:233
bool validate_comm_list(int ncsend, int ncrecv, int *csend, int *crecv)
Definition: FluRegion.H:236
void populate(int rpid, int nnshared, int nnsend, int nnrecv, int ncsend, int ncrecv, int *sharedn, int *sendn, int *recvn, int *sendc, int *recvc)
Definition: GEM.C:193
bool _debug
Definition: GEM.H:310

Here is the call graph for this function:

void AddFluPatch ( int  patch_id,
int  ntri,
int  ngtri,
int *  tris,
int  nquad,
int  ngquad,
int *  quads 
)
inline

Definition at line 307 of file FluRegion.H.

References GEM_Partition::_debug, GEM_DomainBoundary::_id, GEM_Partition::_id, GEM_DomainBoundary::_ngquad, GEM_DomainBoundary::_ngtri, FluPatch::_nquad, FluPatch::_ntri, GEM_DomainBoundary::_out, GEM_Partition::_out, _patches, GEM_DomainBoundary::_quadconn, and GEM_DomainBoundary::_triconn.

309  {
310  assert(ntri >= ngtri && nquad >= ngquad);
311  if(_debug && _out)
312  *_out << "FluRegion(" << _id << ")::AddFluPatch: Adding Patch with"
313  << " id " << patch_id << "." << endl;
314  FluPatch new_patch;
315  new_patch._ntri = ntri;
316  new_patch._nquad = nquad;
317  new_patch._id = patch_id;
318  new_patch._ngtri = ngtri;
319  new_patch._ngquad = ngquad;
320  int indy = 0;
321  new_patch._triconn.resize(3*ntri);
322  new_patch._quadconn.resize(4*nquad);
323  new_patch._out = _out;
324  while(indy < 3*ntri){
325  assert(tris[indy] != 0);
326  new_patch._triconn[indy] = tris[indy];
327  assert(new_patch._triconn[indy] != 0);
328  indy++;
329  }
330  indy = 0;
331  while(indy < 4*nquad){
332  assert(quads[indy] != 0);
333  new_patch._quadconn[indy] = quads[indy];
334  indy++;
335  }
336  _patches.push_back(new_patch);
337  };
unsigned int _ntri
Definition: FluRegion.H:102
std::vector< unsigned int > _quadconn
Definition: GEM.H:132
unsigned int _nquad
Definition: FluRegion.H:103
unsigned int _id
Definition: GEM.H:127
std::vector< unsigned int > _triconn
Definition: GEM.H:131
unsigned int _id
Definition: GEM.H:284
std::ostream * _out
Definition: GEM.H:308
unsigned int _ngquad
Definition: GEM.H:129
vector< FluPatch > _patches
Definition: FluRegion.H:132
bool _debug
Definition: GEM.H:310
std::ostream * _out
Definition: GEM.H:140
unsigned int _ngtri
Definition: GEM.H:128
bool BuildCellMapping ( )
bool BuildPatchMapping ( map< unsigned int, unsigned int > &  ,
const string &  p = "" 
)

Definition at line 1534 of file FluRegion.C.

Referenced by PopulateFluPatches().

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 }
string _casepath
Definition: FluRegion.H:122
unsigned int _npatches_total
Definition: FluRegion.H:131
std::ostream * _out
Definition: GEM.H:308
bool _debug
Definition: GEM.H:310
string _casename
Definition: FluRegion.H:121

Here is the caller graph for this function:

bool Cell2Elem ( unsigned  int,
unsigned int &  ,
unsigned int &   
)
bool ComRemeshInitData ( const string &  wname,
double *  cell_data,
int  nval_cells,
double *  node_data,
int  nval_nodes 
)

Definition at line 1653 of file FluRegion.C.

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 }
unsigned int _npyr
Definition: FluRegion.H:129
vector< double > _pf
Definition: FluRegion.H:34
vector< double > _rhoEf
Definition: FluRegion.H:33
vector< double > _Tf
Definition: FluRegion.H:35
std::vector< unsigned int > _tetconn
Definition: GEM.H:295
unsigned int _nnodes
Definition: FluRegion.H:126
unsigned int nelem()
Definition: FluRegion.C:42
vector< double > _rhof
Definition: FluRegion.H:31
unsigned int _nhex
Definition: FluRegion.H:128
bool _unsteady
Definition: FluRegion.H:30
std::vector< unsigned int > _pyrconn
Definition: GEM.H:297
unsigned int _npris
Definition: FluRegion.H:130
std::vector< unsigned int > _hexconn
Definition: GEM.H:301
void Resize(unsigned int ncells=0, unsigned int nfaces=0, unsigned int nnodes=0)
Definition: FluRegion.H:45
vector< double > _rhovf
Definition: FluRegion.H:32
vector< double > _af
Definition: FluRegion.H:36
unsigned int _ntet
Definition: FluRegion.H:127
FluVolumeSoln _soln
Definition: FluRegion.H:134
vector< double > _disp
Definition: FluRegion.H:37
std::vector< double > _nc
Definition: GEM.H:293
std::vector< unsigned int > _prisconn
Definition: GEM.H:299
bool CreateRegionMapFile ( const string &  p = "",
unsigned  int = 0,
unsigned  int = 0 
)

Definition at line 328 of file FluRegion.C.

Referenced by main().

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 }
string _casepath
Definition: FluRegion.H:122
string _casename
Definition: FluRegion.H:121

Here is the caller graph for this function:

bool InitSurfaceSoln ( const string &  p = "")

Definition at line 862 of file FluRegion.C.

References FluPatch::InitSurfaceSoln().

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 }
bool InitSurfaceSoln(const string &prefix="", bool=false)
Definition: FluRegion.C:882
string _casepath
Definition: FluRegion.H:122
vector< FluPatch > _patches
Definition: FluRegion.H:132
string _casename
Definition: FluRegion.H:121

Here is the call graph for this function:

bool InitVolumeSoln ( const string &  p = "")

Definition at line 776 of file FluRegion.C.

References sqrt().

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 }
unsigned int _npyr
Definition: FluRegion.H:129
vector< double > _pf
Definition: FluRegion.H:34
vector< double > _rhoEf
Definition: FluRegion.H:33
vector< double > _Tf
Definition: FluRegion.H:35
std::vector< unsigned int > _tetconn
Definition: GEM.H:295
double sqrt(double d)
Definition: double.h:73
string _casepath
Definition: FluRegion.H:122
unsigned int _nvface
Definition: GEM.H:291
unsigned int nelem()
Definition: FluRegion.C:42
vector< double > _rhof
Definition: FluRegion.H:31
unsigned int _nhex
Definition: FluRegion.H:128
bool _unsteady
Definition: FluRegion.H:30
std::vector< unsigned int > _pyrconn
Definition: GEM.H:297
unsigned int _npris
Definition: FluRegion.H:130
std::vector< unsigned int > _hexconn
Definition: GEM.H:301
vector< double > _rhovf
Definition: FluRegion.H:32
vector< double > _af
Definition: FluRegion.H:36
unsigned int _ntet
Definition: FluRegion.H:127
FluVolumeSoln _soln
Definition: FluRegion.H:134
double _current_time
Definition: FluRegion.H:28
vector< double > _gsp
Definition: FluRegion.H:38
std::vector< unsigned int > _prisconn
Definition: GEM.H:299
string _casename
Definition: FluRegion.H:121

Here is the call graph for this function:

unsigned int nelem ( )

Definition at line 42 of file FluRegion.C.

42  {
43  return(_ntet + _npyr + _npris + _nhex);
44 }
unsigned int _npyr
Definition: FluRegion.H:129
unsigned int _nhex
Definition: FluRegion.H:128
unsigned int _npris
Definition: FluRegion.H:130
unsigned int _ntet
Definition: FluRegion.H:127
bool PopRemBordIndFILE ( const string &  p = "",
double  = 0.0,
bool  = true 
)

Definition at line 581 of file FluRegion.C.

References SkipLines().

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 }
vector< FluBorder > _borders
Definition: FluRegion.H:133
string _casepath
Definition: FluRegion.H:122
unsigned int _id
Definition: GEM.H:284
std::ostream * _out
Definition: GEM.H:308
bool _debug
Definition: GEM.H:310
istream & SkipLines(istream &, unsigned int=1)
string _casename
Definition: FluRegion.H:121

Here is the call graph for this function:

void PopRemBordIndMPI ( )

Definition at line 1615 of file FluRegion.C.

References MPI_COMM_WORLD.

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 }
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
vector< FluBorder > _borders
Definition: FluRegion.H:133
unsigned int _id
Definition: GEM.H:284
bool PopulateFluBorders ( vector< PB > &  pb)
inline

Definition at line 217 of file FluRegion.H.

References _borders.

218  {
219  unsigned int nborders = pb.size();
220  _borders.resize(nborders);
221  unsigned int border = 0;
222  while(border < nborders){
223  _borders[border]._rpart = pb[border]._rpart;
224  _borders[border]._sendcells = pb[border]._sendcells;
225  _borders[border]._recvcells = pb[border]._recvcells;
226  _borders[border]._sharenodes = pb[border]._sharenodes;
227  _borders[border]._sendnodes = pb[border]._sendnodes;
228  _borders[border]._recvnodes = pb[border]._recvnodes;
229  _borders[border]._rbid = pb[border]._rbid;
230  _borders[border]._out = pb[border]._out;
231  border++;
232  }
233  return(true);
234  };
vector< FluBorder > _borders
Definition: FluRegion.H:133
bool PopulateFluPatches ( const string &  pre,
vector< DB > &  db 
)
inline

Definition at line 202 of file FluRegion.H.

References _patches, BuildPatchMapping(), and GEM_Partition::MapDomainBoundaries().

203  {
204  map<unsigned int,unsigned int> patch_mapping;
205  BuildPatchMapping(patch_mapping,pre);
206  MapDomainBoundaries(db,patch_mapping,_patches);
207  vector<FluPatch>::iterator fpi = _patches.begin();
208  while(fpi != _patches.end()){
209  fpi->_ntri = fpi->_triconn.size()/3;
210  fpi->_nquad = fpi->_quadconn.size()/4;
211  fpi++;
212  }
213  return(true);
214  };
void MapDomainBoundaries(std::map< unsigned int, unsigned int > &bcmap)
Definition: GEM.C:1385
bool BuildPatchMapping(map< unsigned int, unsigned int > &, const string &p="")
Definition: FluRegion.C:1534
vector< FluPatch > _patches
Definition: FluRegion.H:132

Here is the call graph for this function:

bool ReadControlFile ( )

Definition at line 101 of file FluRegion.C.

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 }
string _casepath
Definition: FluRegion.H:122
string _casename
Definition: FluRegion.H:121
bool ReadFluCOM ( const string &  p = "")

Definition at line 249 of file FluRegion.C.

References SkipLines().

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 }
vector< FluBorder > _borders
Definition: FluRegion.H:133
Definition: adj.h:150
string _casepath
Definition: FluRegion.H:122
unsigned int _id
Definition: GEM.H:284
std::ostream * _out
Definition: GEM.H:308
bool _debug
Definition: GEM.H:310
istream & SkipLines(istream &, unsigned int=1)
string _casename
Definition: FluRegion.H:121

Here is the call graph for this function:

bool ReadFluDIM ( const string &  p = "",
double  = 0.0,
bool  = true 
)

Definition at line 463 of file FluRegion.C.

References SkipLines().

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 }
unsigned int _npyr
Definition: FluRegion.H:129
std::vector< unsigned int > _tetconn
Definition: GEM.H:295
vector< FluBorder > _borders
Definition: FluRegion.H:133
unsigned int _nnodes
Definition: FluRegion.H:126
unsigned int _ngnodes
Definition: GEM.H:286
string _casepath
Definition: FluRegion.H:122
unsigned int _npatches_total
Definition: FluRegion.H:131
unsigned int _ngpris
Definition: GEM.H:290
unsigned int nelem()
Definition: FluRegion.C:42
unsigned int _id
Definition: GEM.H:284
std::ostream * _out
Definition: GEM.H:308
unsigned int _nhex
Definition: FluRegion.H:128
bool _unsteady
Definition: FluRegion.H:30
std::vector< unsigned int > _pyrconn
Definition: GEM.H:297
unsigned int _npris
Definition: FluRegion.H:130
std::vector< unsigned int > _hexconn
Definition: GEM.H:301
vector< FluPatch > _patches
Definition: FluRegion.H:132
unsigned int _ntet
Definition: FluRegion.H:127
FluVolumeSoln _soln
Definition: FluRegion.H:134
bool _debug
Definition: GEM.H:310
unsigned int _ngtet
Definition: GEM.H:287
double _current_time
Definition: FluRegion.H:28
istream & SkipLines(istream &, unsigned int=1)
std::vector< double > _nc
Definition: GEM.H:293
std::vector< unsigned int > _prisconn
Definition: GEM.H:299
unsigned int _ngpyr
Definition: GEM.H:289
unsigned int _nghex
Definition: GEM.H:288
string _casename
Definition: FluRegion.H:121

Here is the call graph for this function:

bool ReadFluGridASCII ( const std::string &  p = "",
double  t = 0.0,
bool  unsteady = true 
)

Definition at line 975 of file FluRegion.C.

References FluPatch::_nquad, FluPatch::_ntri, GEM_DomainBoundary::_quadconn, GEM_DomainBoundary::_triconn, i, and SkipLines().

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 }
unsigned int _npyr
Definition: FluRegion.H:129
std::vector< unsigned int > _tetconn
Definition: GEM.H:295
unsigned int _ntri
Definition: FluRegion.H:102
unsigned int _nnodes
Definition: FluRegion.H:126
std::vector< unsigned int > _quadconn
Definition: GEM.H:132
Definition: adj.h:150
string _casepath
Definition: FluRegion.H:122
unsigned int _nquad
Definition: FluRegion.H:103
Definition: patch.h:74
std::vector< unsigned int > _triconn
Definition: GEM.H:131
unsigned int _id
Definition: GEM.H:284
std::ostream * _out
Definition: GEM.H:308
unsigned int _nhex
Definition: FluRegion.H:128
std::vector< unsigned int > _pyrconn
Definition: GEM.H:297
blockLoc i
Definition: read.cpp:79
unsigned int _npris
Definition: FluRegion.H:130
std::vector< unsigned int > _hexconn
Definition: GEM.H:301
vector< FluPatch > _patches
Definition: FluRegion.H:132
unsigned int _ntet
Definition: FluRegion.H:127
bool _debug
Definition: GEM.H:310
istream & SkipLines(istream &, unsigned int=1)
std::vector< double > _nc
Definition: GEM.H:293
std::vector< unsigned int > _prisconn
Definition: GEM.H:299
string _casename
Definition: FluRegion.H:121

Here is the call graph for this function:

bool ReadFluSolnASCII ( const std::string &  p = "",
unsigned int  n = 0,
double  t = 0.0,
bool  unsteady = true 
)

Definition at line 1229 of file FluRegion.C.

References i, n, and SkipLines().

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 }
vector< double > _rhoEf
Definition: FluRegion.H:33
double _resid
Definition: FluRegion.H:29
string _casepath
Definition: FluRegion.H:122
unsigned int nelem()
Definition: FluRegion.C:42
vector< double > _rhof
Definition: FluRegion.H:31
unsigned int _id
Definition: GEM.H:284
std::ostream * _out
Definition: GEM.H:308
blockLoc i
Definition: read.cpp:79
const NT & n
vector< double > _rhovf
Definition: FluRegion.H:32
FluVolumeSoln _soln
Definition: FluRegion.H:134
bool _debug
Definition: GEM.H:310
double _current_time
Definition: FluRegion.H:28
istream & SkipLines(istream &, unsigned int=1)
bool ReadGSPASCII(const std::string &p="", unsigned int=0, double=0.0, bool=true)
Definition: FluRegion.C:1480
string _casename
Definition: FluRegion.H:121

Here is the call graph for this function:

bool ReadGSPASCII ( const std::string &  p = "",
unsigned int  n = 0,
double  t = 0.0,
bool  unsteady = true 
)

Definition at line 1480 of file FluRegion.C.

References FluSurfSoln::_gsp, GEM_DomainBoundary::_ngquad, GEM_DomainBoundary::_ngtri, FluPatch::_nquad, FluPatch::_ntri, FluPatch::_soln, FluPatch::InitSurfaceSoln(), n, and SkipLines().

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 }
bool InitSurfaceSoln(const string &prefix="", bool=false)
Definition: FluRegion.C:882
Definition: face.h:90
unsigned int _ntri
Definition: FluRegion.H:102
string _casepath
Definition: FluRegion.H:122
unsigned int _nquad
Definition: FluRegion.H:103
unsigned int _nvface
Definition: GEM.H:291
unsigned int _id
Definition: GEM.H:284
std::ostream * _out
Definition: GEM.H:308
unsigned int _ngquad
Definition: GEM.H:129
const NT & n
FluSurfSoln _soln
Definition: FluRegion.H:104
vector< FluPatch > _patches
Definition: FluRegion.H:132
vector< double > _gsp
Definition: FluRegion.H:74
FluVolumeSoln _soln
Definition: FluRegion.H:134
bool _debug
Definition: GEM.H:310
vector< double > _gsp
Definition: FluRegion.H:38
istream & SkipLines(istream &, unsigned int=1)
string _casename
Definition: FluRegion.H:121
unsigned int _ngtri
Definition: GEM.H:128

Here is the call graph for this function:

bool ReadRegionASCII ( const string &  p = "",
unsigned  int = 0,
unsigned  int = 0,
double  = 0.0,
bool  = true 
)

Definition at line 1577 of file FluRegion.C.

Referenced by main().

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 }
bool ReadFluSolnASCII(const std::string &p="", unsigned int=0, double=0.0, bool=true)
Definition: FluRegion.C:1229
bool ReadFluGridASCII(const std::string &p="", double=0.0, bool=true)
Definition: FluRegion.C:975
bool ReadFluCOM(const string &p="")
Definition: FluRegion.C:249
string _casepath
Definition: FluRegion.H:122
unsigned int _id
Definition: GEM.H:284
std::ostream * _out
Definition: GEM.H:308
const NT & n
bool ReadFluDIM(const string &p="", double=0.0, bool=true)
Definition: FluRegion.C:463
bool _debug
Definition: GEM.H:310
string _casename
Definition: FluRegion.H:121

Here is the caller graph for this function:

bool RegisterFluSurfaceMesh ( )

Definition at line 1783 of file FluRegion.C.

References GEM_DomainBoundary::_ngquad, GEM_DomainBoundary::_ngtri, GEM_DomainBoundary::_quadconn, GEM_DomainBoundary::_triconn, COM_INT, COM_new_attribute(), COM_set_array(), COM_set_size(), and GEM_DomainBoundary::pane_id.

Referenced by main().

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 }
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
std::vector< unsigned int > _quadconn
Definition: GEM.H:132
std::vector< unsigned int > _triconn
Definition: GEM.H:131
unsigned int _ngquad
Definition: GEM.H:129
vector< FluPatch > _patches
Definition: FluRegion.H:132
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
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
std::string surface_window
Definition: GEM.H:319
unsigned int _ngtri
Definition: GEM.H:128

Here is the call graph for this function:

Here is the caller graph for this function:

bool RegisterSurfaceSoln ( bool  all)

Definition at line 1742 of file FluRegion.C.

References COM_DOUBLE, COM_INT, COM_new_attribute(), and FluPatch::RegisterSoln().

Referenced by main().

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 }
bool RegisterSoln(const string &, bool)
Definition: FluRegion.C:1705
unsigned int _id
Definition: GEM.H:284
std::ostream * _out
Definition: GEM.H:308
vector< FluPatch > _patches
Definition: FluRegion.H:132
bool _debug
Definition: GEM.H:310
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
std::string surface_window
Definition: GEM.H:319

Here is the call graph for this function:

Here is the caller graph for this function:

bool RegisterVolumeSoln ( bool  all)

Definition at line 1689 of file FluRegion.C.

References COM_DOUBLE, COM_new_attribute(), COM_set_array(), and COM_set_size().

Referenced by main().

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");
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 }
vector< double > _pf
Definition: FluRegion.H:34
vector< double > _rhoEf
Definition: FluRegion.H:33
void Create_com_volsoln(const std::string &fname, std::vector< double > &fvec, unsigned int ncomp, const std::string &unit)
Definition: GEM.C:413
vector< double > _Tf
Definition: FluRegion.H:35
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
unsigned int _nvface
Definition: GEM.H:291
vector< double > _rhof
Definition: FluRegion.H:31
int pane_id
Definition: GEM.H:315
vector< double > _rhovf
Definition: FluRegion.H:32
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
std::string volume_window
Definition: GEM.H:318
vector< double > _af
Definition: FluRegion.H:36
FluVolumeSoln _soln
Definition: FluRegion.H:134
vector< double > _gsp
Definition: FluRegion.H:38
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

Here is the call graph for this function:

Here is the caller graph for this function:

void report ( )

Definition at line 47 of file FluRegion.C.

References GEM_DomainBoundary::_id, GEM_DomainBoundary::_ngquad, GEM_DomainBoundary::_ngtri, FluPatch::_nquad, FluPatch::_ntri, FluBorder::_rbid, GEM_PartitionBoundary::_recvcells, GEM_PartitionBoundary::_recvnodes, GEM_PartitionBoundary::_rpart, GEM_PartitionBoundary::_sendcells, GEM_PartitionBoundary::_sendnodes, and GEM_PartitionBoundary::_sharenodes.

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 }
unsigned int _npyr
Definition: FluRegion.H:129
unsigned int _rbid
Definition: FluRegion.H:115
std::vector< unsigned int > _recvnodes
Definition: GEM.H:230
std::vector< unsigned int > _sendcells
Definition: GEM.H:227
vector< FluBorder > _borders
Definition: FluRegion.H:133
unsigned int _ntri
Definition: FluRegion.H:102
unsigned int _nnodes
Definition: FluRegion.H:126
unsigned int _ngnodes
Definition: GEM.H:286
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
unsigned int _ngpris
Definition: GEM.H:290
unsigned int nelem()
Definition: FluRegion.C:42
Definition: patch.h:74
unsigned int _id
Definition: GEM.H:127
unsigned int _id
Definition: GEM.H:284
std::ostream * _out
Definition: GEM.H:308
unsigned int _ngquad
Definition: GEM.H:129
unsigned int _nhex
Definition: FluRegion.H:128
unsigned int _npris
Definition: FluRegion.H:130
vector< FluPatch > _patches
Definition: FluRegion.H:132
unsigned int _ntet
Definition: FluRegion.H:127
unsigned int _ngtet
Definition: GEM.H:287
unsigned int _rpart
Definition: GEM.H:226
unsigned int _ngpyr
Definition: GEM.H:289
unsigned int _nghex
Definition: GEM.H:288
unsigned int _ngtri
Definition: GEM.H:128
bool validate_comm_list ( int  ncsend,
int  ncrecv,
int *  csend,
int *  crecv 
)
inline

Definition at line 236 of file FluRegion.H.

References GEM_Partition::_hexconn, GEM_Partition::_nghex, GEM_Partition::_ngpris, GEM_Partition::_ngpyr, GEM_Partition::_ngtet, GEM_Partition::_out, GEM_Partition::_prisconn, GEM_Partition::_pyrconn, and GEM_Partition::_tetconn.

Referenced by AddFluBorder().

237  {
238  int index = 0;
239  int nreal_cell = _tetconn.size()/4 + _prisconn.size()/6 +
240  _pyrconn.size()/5 + _hexconn.size()/8 - (_ngtet + _ngpris +
241  _ngpyr + _nghex);
242  bool rval = true;
243  while(index < ncsend){
244  int ind = index++;
245  if(!(csend[ind] <= nreal_cell)){
246  if(_out)
247  *_out << "SEND CELL " << index << " is a ghost cell!!" << endl;
248  rval = false;
249  }
250  if(!(csend[ind] > 0)){
251  if(_out)
252  *_out << "SEND CELL " << index << " is zero or negative!" << endl;
253  rval = false;
254  }
255  }
256  index = 0;
257  list<int> recvcell_list;
258  while(index < ncrecv) {
259  int ind = index++;
260  if(!(crecv[ind] > nreal_cell)){
261  if(_out)
262  *_out << "RECV CELL " << index << " is a real cell!!" << endl;
263  rval = false;
264  }
265  if(!(crecv[ind] > 0)){
266  if(_out)
267  *_out << "RECV CELL " << index << " is zero or negative!" << endl;
268  rval = false;
269  }
270  bool duped = false;
271  list<int>::iterator rci = recvcell_list.begin();
272  while(rci != recvcell_list.end() && !duped){
273  if(crecv[ind] == *rci++){
274  if(_out)
275  *_out << "RECV CELL " << index
276  << " is duplicated in the receive list!"
277  << endl;
278  duped = true;
279  }
280  }
281  if(!duped)
282  recvcell_list.push_back(crecv[ind]);
283  }
284  return(rval);
285  };
std::vector< unsigned int > _tetconn
Definition: GEM.H:295
unsigned int _ngpris
Definition: GEM.H:290
std::ostream * _out
Definition: GEM.H:308
std::vector< unsigned int > _pyrconn
Definition: GEM.H:297
std::vector< unsigned int > _hexconn
Definition: GEM.H:301
unsigned int _ngtet
Definition: GEM.H:287
std::vector< unsigned int > _prisconn
Definition: GEM.H:299
unsigned int _ngpyr
Definition: GEM.H:289
unsigned int _nghex
Definition: GEM.H:288

Here is the caller graph for this function:

bool WriteFluCMP ( const string &  p = "")

Definition at line 697 of file FluRegion.C.

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 }
unsigned int _npyr
Definition: FluRegion.H:129
std::vector< unsigned int > _tetconn
Definition: GEM.H:295
string _casepath
Definition: FluRegion.H:122
unsigned int Elem2Cell(std::pair< unsigned int, unsigned int >)
Definition: GEM.C:956
unsigned int _id
Definition: GEM.H:284
unsigned int _nhex
Definition: FluRegion.H:128
std::vector< unsigned int > _pyrconn
Definition: GEM.H:297
unsigned int _npris
Definition: FluRegion.H:130
std::vector< unsigned int > _hexconn
Definition: GEM.H:301
vector< pair< unsigned int, unsigned int > > _cellmap
Definition: FluRegion.H:135
unsigned int _ntet
Definition: FluRegion.H:127
std::vector< unsigned int > _prisconn
Definition: GEM.H:299
string _casename
Definition: FluRegion.H:121
bool WriteFluCOM ( const string &  p = "")

Definition at line 130 of file FluRegion.C.

References ni.

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 }
vector< FluBorder > _borders
Definition: FluRegion.H:133
string _casepath
Definition: FluRegion.H:122
unsigned int _id
Definition: GEM.H:284
void int int REAL REAL REAL *z blockDim dim * ni
Definition: read.cpp:77
string _casename
Definition: FluRegion.H:121
bool WriteFluDIM ( const string &  p = "",
double  = 0.0,
bool  = true 
)

Definition at line 378 of file FluRegion.C.

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 }
unsigned int _npyr
Definition: FluRegion.H:129
std::vector< unsigned int > _tetconn
Definition: GEM.H:295
vector< FluBorder > _borders
Definition: FluRegion.H:133
unsigned int _nnodes
Definition: FluRegion.H:126
unsigned int _ngnodes
Definition: GEM.H:286
string _casepath
Definition: FluRegion.H:122
unsigned int _npatches_total
Definition: FluRegion.H:131
unsigned int _ngpris
Definition: GEM.H:290
unsigned int nelem()
Definition: FluRegion.C:42
unsigned int _id
Definition: GEM.H:284
unsigned int _nhex
Definition: FluRegion.H:128
std::vector< unsigned int > _pyrconn
Definition: GEM.H:297
unsigned int _npris
Definition: FluRegion.H:130
std::vector< unsigned int > _hexconn
Definition: GEM.H:301
vector< FluPatch > _patches
Definition: FluRegion.H:132
unsigned int _ntet
Definition: FluRegion.H:127
unsigned int _ngtet
Definition: GEM.H:287
std::vector< double > _nc
Definition: GEM.H:293
std::vector< unsigned int > _prisconn
Definition: GEM.H:299
unsigned int _ngpyr
Definition: GEM.H:289
unsigned int _nghex
Definition: GEM.H:288
string _casename
Definition: FluRegion.H:121
bool WriteFluGridASCII ( const string &  pre = "",
double  = 0.0,
bool  = true 
)

Definition at line 1085 of file FluRegion.C.

References FluPatch::_nquad, FluPatch::_ntri, GEM_DomainBoundary::_quadconn, GEM_DomainBoundary::_triconn, and i.

Referenced by main().

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 }
unsigned int _npyr
Definition: FluRegion.H:129
std::vector< unsigned int > _tetconn
Definition: GEM.H:295
unsigned int _ntri
Definition: FluRegion.H:102
unsigned int _nnodes
Definition: FluRegion.H:126
std::vector< unsigned int > _quadconn
Definition: GEM.H:132
Definition: adj.h:150
string _casepath
Definition: FluRegion.H:122
unsigned int _nquad
Definition: FluRegion.H:103
Definition: patch.h:74
std::vector< unsigned int > _triconn
Definition: GEM.H:131
unsigned int _id
Definition: GEM.H:284
unsigned int _nhex
Definition: FluRegion.H:128
std::vector< unsigned int > _pyrconn
Definition: GEM.H:297
blockLoc i
Definition: read.cpp:79
unsigned int _npris
Definition: FluRegion.H:130
std::vector< unsigned int > _hexconn
Definition: GEM.H:301
vector< FluPatch > _patches
Definition: FluRegion.H:132
unsigned int _ntet
Definition: FluRegion.H:127
FluVolumeSoln _soln
Definition: FluRegion.H:134
double _current_time
Definition: FluRegion.H:28
std::vector< double > _nc
Definition: GEM.H:293
std::vector< unsigned int > _prisconn
Definition: GEM.H:299
string _casename
Definition: FluRegion.H:121

Here is the caller graph for this function:

bool WriteFluNative ( const string &  p = "")

Definition at line 114 of file FluRegion.C.

Referenced by main().

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 }
bool WriteFluCOM(const string &p="")
Definition: FluRegion.C:130
bool WriteFluCMP(const string &p="")
Definition: FluRegion.C:697
string _casepath
Definition: FluRegion.H:122
bool WriteFluDIM(const string &p="", double=0.0, bool=true)
Definition: FluRegion.C:378
string _casename
Definition: FluRegion.H:121

Here is the caller graph for this function:

bool WriteFluSolnASCII ( const std::string &  p = "",
unsigned int  n = 0,
double  t = 0.0,
bool  unsteady = true 
)

Definition at line 1298 of file FluRegion.C.

References i, and n.

Referenced by main().

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 }
vector< double > _rhoEf
Definition: FluRegion.H:33
double _resid
Definition: FluRegion.H:29
string _casepath
Definition: FluRegion.H:122
unsigned int nelem()
Definition: FluRegion.C:42
vector< double > _rhof
Definition: FluRegion.H:31
unsigned int _id
Definition: GEM.H:284
std::ostream * _out
Definition: GEM.H:308
bool WriteGSPASCII(const std::string &p="", unsigned int=0, double=0.0, bool=true)
Definition: FluRegion.C:1389
blockLoc i
Definition: read.cpp:79
const NT & n
vector< double > _rhovf
Definition: FluRegion.H:32
FluVolumeSoln _soln
Definition: FluRegion.H:134
bool _debug
Definition: GEM.H:310
double _current_time
Definition: FluRegion.H:28
string _casename
Definition: FluRegion.H:121

Here is the caller graph for this function:

bool WriteGSPASCII ( const std::string &  p = "",
unsigned int  n = 0,
double  t = 0.0,
bool  unsteady = true 
)

Definition at line 1389 of file FluRegion.C.

References FluSurfSoln::_gsp, GEM_DomainBoundary::_ngquad, GEM_DomainBoundary::_ngtri, FluPatch::_nquad, FluPatch::_ntri, FluPatch::_soln, face, and n.

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 }
Definition: face.h:90
unsigned int _ntri
Definition: FluRegion.H:102
string _casepath
Definition: FluRegion.H:122
unsigned int _nquad
Definition: FluRegion.H:103
unsigned int _nvface
Definition: GEM.H:291
unsigned int _id
Definition: GEM.H:284
std::ostream * _out
Definition: GEM.H:308
unsigned int _ngquad
Definition: GEM.H:129
const NT & n
FluSurfSoln _soln
Definition: FluRegion.H:104
vector< FluPatch > _patches
Definition: FluRegion.H:132
vector< double > _gsp
Definition: FluRegion.H:74
static T_VertexSet * face
Definition: vinci_lass.c:79
FluVolumeSoln _soln
Definition: FluRegion.H:134
bool _debug
Definition: GEM.H:310
vector< double > _gsp
Definition: FluRegion.H:38
string _casename
Definition: FluRegion.H:121
unsigned int _ngtri
Definition: GEM.H:128

Member Data Documentation

vector<FluBorder> _borders

Definition at line 133 of file FluRegion.H.

Referenced by AddFluBorder(), FluRegion(), main(), and PopulateFluBorders().

string _casename

Definition at line 121 of file FluRegion.H.

Referenced by FluRegion().

string _casepath

Definition at line 122 of file FluRegion.H.

vector<pair<unsigned int,unsigned int> > _cellmap

Definition at line 135 of file FluRegion.H.

unsigned int _nhex

Definition at line 128 of file FluRegion.H.

Referenced by FluRegion().

unsigned int _nnodes

Definition at line 126 of file FluRegion.H.

Referenced by FluRegion().

unsigned int _npatches_total

Definition at line 131 of file FluRegion.H.

Referenced by FluRegion().

unsigned int _npris

Definition at line 130 of file FluRegion.H.

Referenced by FluRegion().

unsigned int _npyr

Definition at line 129 of file FluRegion.H.

Referenced by FluRegion().

unsigned int _ntet

Definition at line 127 of file FluRegion.H.

Referenced by FluRegion().

vector<FluPatch> _patches

Definition at line 132 of file FluRegion.H.

Referenced by AddFluPatch(), FluRegion(), main(), and PopulateFluPatches().

Definition at line 134 of file FluRegion.H.


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