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

#include <Partition.H>

Inheritance diagram for Partition:
Collaboration diagram for Partition:

Public Member Functions

bool ReadPartition (const string &pre, unsigned int rank)
 
bool ReadPartitionBoundaries (ifstream &Inf)
 
bool ReadPartitionPatches (ifstream &Inf)
 
bool ReadPartitionASCII (const string &pre, unsigned int rank)
 
bool ReadPartitionBoundariesASCII (ifstream &Inf)
 
bool ReadPartitionPatchesASCII (ifstream &Inf)
 
bool WritePartitionASCII (const string &pre)
 
bool WritePartitionBoundariesASCII (ofstream &Ouf)
 
bool WritePartitionPatchesASCII (ofstream &Ouf)
 
bool BuildPartitionBoundaries (const vector< int > &Pconn)
 
 Partition (const GEM_Partition &gp)
 
 Partition ()
 
- 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

unsigned int _nnodes
 
unsigned int _nelem
 
unsigned int _ntet
 
unsigned int _nhex
 
unsigned int _npyr
 
unsigned int _npris
 
unsigned int _npatch
 
vector< PartitionBoundary_boundaries
 
vector< PartitionPatch_patches
 
- 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 91 of file Partition.H.

Constructor & Destructor Documentation

Partition ( const GEM_Partition gp)
Partition ( )
inline

Definition at line 113 of file Partition.H.

114  {};

Member Function Documentation

bool BuildPartitionBoundaries ( const vector< int > &  Pconn)

Definition at line 523 of file Partition.C.

References PartitionBoundary::_belem_recv, PartitionBoundary::_belem_send, GEM_PartitionBoundary::_recvcells, GEM_PartitionBoundary::_recvnodes, GEM_PartitionBoundary::_rpart, GEM_PartitionBoundary::_sendcells, GEM_PartitionBoundary::_sendnodes, and GEM_PartitionBoundary::_sharenodes.

524 {
525  unsigned int index = 0;
526  unsigned int npb = Pconn[index++];
527  _boundaries.clear();
528  _boundaries.resize(npb);
529 
530  // Shared Nodes
531  unsigned int pb_index = 0;
532  while(pb_index < npb){
533  PartitionBoundary &pb = _boundaries[pb_index++];
534  unsigned int pane_id = Pconn[index++];
535  pb._rpart = pane_id/100;
536  // pb._mypart = _part;
537  // pb._rbid = pane_id%100;
538  unsigned int nshared = Pconn[index++];
539  pb._sharenodes.resize(nshared);
540  unsigned int node = 0;
541  while(node < nshared)
542  pb._sharenodes[node++] = Pconn[index++];
543  }
544  index++;
545 
546  // Send Nodes
547  pb_index = 0;
548  while(pb_index < npb){
549  PartitionBoundary &pb = _boundaries[pb_index++];
550  unsigned int pane_id = Pconn[index++];
551  assert(pb._rpart == pane_id/100);
552  unsigned int nsend = Pconn[index++];
553  pb._sendnodes.resize(nsend);
554  unsigned int node = 0;
555  while(node < nsend)
556  pb._sendnodes[node++] = Pconn[index++];
557  }
558  index++;
559 
560  // Recv Nodes
561  pb_index = 0;
562  while(pb_index < npb){
563  PartitionBoundary &pb = _boundaries[pb_index++];
564  unsigned int pane_id = Pconn[index++];
565  assert(pb._rpart == pane_id/100);
566  unsigned int nrecv = Pconn[index++];
567  pb._recvnodes.resize(nrecv);
568  unsigned int node = 0;
569  while(node < nrecv)
570  pb._recvnodes[node++] = Pconn[index++];
571  }
572  index++;
573 
574  // Send Elems - first, we have to populate a temprorary array
575  // then, we have to sort through the array and determine how
576  // many of each element type there are.
577  pb_index = 0;
578  while(pb_index < npb){
579  PartitionBoundary &pb = _boundaries[pb_index++];
580  unsigned int pane_id = Pconn[index++];
581  assert(pb._rpart == pane_id/100);
582  unsigned int nsend = Pconn[index++];
583  pb._sendcells.resize(nsend);
584  unsigned int node = 0;
585  while(node < nsend)
586  pb._sendcells[node++] = Pconn[index++];
587  // Now temp_id contains the mapped element id
588  // We need to know whether each element is a
589  // tet, pyr, pris, or hex and keep a count.
590  node = 0;
591  unsigned int ntet = 0;
592  unsigned int npyr = 0;
593  unsigned int npris = 0;
594  unsigned int nhex = 0;
595  while(node < nsend){
596  if(pb._sendcells[node] <= _ntet)
597  ntet++;
598  else if (pb._sendcells[node] <= (_ntet+_npyr))
599  npyr++;
600  else if (pb._sendcells[node] <= (_ntet+_npyr+_npris))
601  npris++;
602  else if (pb._sendcells[node] <= (_ntet+_npyr+_npris+_nhex))
603  nhex++;
604  else
605  assert(pb._sendcells[node] <= (_ntet+_npyr+_npris+_nhex));
606  node++;
607  }
608  pb._belem_send[0].resize(ntet);
609  pb._belem_send[1].resize(npyr);
610  pb._belem_send[2].resize(npris);
611  pb._belem_send[3].resize(nhex);
612  node = 0;
613  ntet = 0;
614  npyr = 0;
615  npris = 0;
616  nhex = 0;
617  while(node < nsend){
618  if(pb._sendcells[node] <= _ntet)
619  pb._belem_send[0][ntet++] = pb._sendcells[node];
620  else if (pb._sendcells[node] <= (_ntet+_npyr))
621  pb._belem_send[1][npyr++] = pb._sendcells[node] - _ntet;
622  else if (pb._sendcells[node] <= (_ntet+_npyr+_npris))
623  pb._belem_send[2][npris++] = pb._sendcells[node] - (_ntet+_npyr);
624  else
625  pb._belem_send[3][nhex++] = pb._sendcells[node] - (_ntet+_npyr+_npris);
626  node++;
627  }
628  }
629  index++;
630 
631  // Recv Elems - first, we have to populate a temprorary array
632  // then, we have to sort through the array and determine how
633  // many of each element type there are. Then we populate the
634  // array
635  pb_index = 0;
636  while(pb_index < npb){
637  PartitionBoundary &pb = _boundaries[pb_index++];
638  unsigned int pane_id = Pconn[index++];
639  assert(pb._rpart == pane_id/100);
640  unsigned int nrecv = Pconn[index++];
641  pb._recvcells.resize(nrecv);
642  unsigned int node = 0;
643  while(node < nrecv)
644  pb._recvcells[node++] = Pconn[index++];
645  // Now pb._recvcells contains the mapped element id
646  // We need to know whether each element is a
647  // tet, pyr, pris, or hex and keep a count.
648  node = 0;
649  unsigned int ntet = 0;
650  unsigned int npyr = 0;
651  unsigned int npris = 0;
652  unsigned int nhex = 0;
653  while(node < nrecv){
654  if(pb._recvcells[node] <= _ntet)
655  ntet++;
656  else if (pb._recvcells[node] <= (_ntet+_npyr))
657  npyr++;
658  else if (pb._recvcells[node] <= (_ntet+_npyr+_npris))
659  npris++;
660  else if (pb._recvcells[node] <= (_ntet+_npyr+_npris+_nhex))
661  nhex++;
662  else
663  assert(pb._recvcells[node] <= (_ntet+_npyr+_npris+_nhex));
664  node++;
665  }
666  pb._belem_recv[0].resize(ntet);
667  pb._belem_recv[1].resize(npyr);
668  pb._belem_recv[2].resize(npris);
669  pb._belem_recv[3].resize(nhex);
670  node = 0;
671  ntet = 0;
672  npyr = 0;
673  npris = 0;
674  nhex = 0;
675  while(node < nrecv){
676  if(pb._recvcells[node] <= _ntet)
677  pb._belem_recv[0][ntet++] = pb._recvcells[node];
678  else if (pb._recvcells[node] <= (_ntet+_npyr))
679  pb._belem_recv[1][npyr++] = pb._recvcells[node] - _ntet;
680  else if (pb._recvcells[node] <= (_ntet+_npyr+_npris))
681  pb._belem_recv[2][npris++] = pb._recvcells[node] - (_ntet+_npyr);
682  else
683  pb._belem_recv[3][nhex++] = pb._recvcells[node] - (_ntet+_npyr+_npris);
684  node++;
685  }
686  }
687  return(true);
688 }
unsigned int _npyr
Definition: Partition.H:97
std::vector< unsigned int > _recvnodes
Definition: GEM.H:230
std::vector< unsigned int > _sendcells
Definition: GEM.H:227
Definition: adj.h:150
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
vector< PartitionBoundary > _boundaries
Definition: Partition.H:100
unsigned int _npris
Definition: Partition.H:98
unsigned int _nhex
Definition: Partition.H:96
int pane_id
Definition: GEM.H:315
vector< unsigned int > _belem_recv[4]
Definition: Partition.H:44
vector< unsigned int > _belem_send[4]
Definition: Partition.H:43
unsigned int _ntet
Definition: Partition.H:95
unsigned int _rpart
Definition: GEM.H:226
bool ReadPartition ( const string &  pre,
unsigned int  rank 
)

Definition at line 402 of file Partition.C.

References rank.

403 {
404  ifstream Inf;
405  ostringstream Ostr;
406 
407  Ostr << pre << "." << rank;
408  Inf.open(Ostr.str().c_str());
409  if(!Inf) return(false);
410 
411  long buf[2];
412  this->_id = rank;
413  Inf.read(reinterpret_cast<char *>(&buf[0]),8);
414  this->_nnodes = buf[0];
415  cout << "buf[0] = " << buf[0] << endl;
416  this->_ngnodes = buf[1];
417  // skip over coordinates 3 of 4 bytes for each node
418  Inf.seekg(this->_nnodes * 3 * 4,ios::cur);
419  Inf.read(reinterpret_cast<char *>(buf),8);
420  this->_ntet = buf[0];
421  this->_ngtet = buf[1];
422  // skip over connectivity 4 of 4 bytes for each tet
423  Inf.seekg(this->_ntet * 4 * 4,ios::cur);
424  Inf.read(reinterpret_cast<char *>(buf),8);
425  this->_npyr = buf[0];
426  this->_ngpyr = buf[1];
427  // skip over connectivity 5 of 4 bytes for each pyr
428  Inf.seekg(this->_npyr * 5 * 4,ios::cur);
429  Inf.read(reinterpret_cast<char *>(buf),8);
430  this->_npris = buf[0];
431  this->_ngpris = buf[1];
432  // skip over connectivity 6 of 4 bytes for each pris
433  Inf.seekg(this->_npris * 6 * 4,ios::cur);
434  Inf.read(reinterpret_cast<char *>(buf),8);
435  this->_nhex = buf[0];
436  this->_nghex = buf[1];
437  // skip over connectivity 8 of 4 bytes for each hex
438  Inf.seekg(this->_nhex * 8 * 4,ios::cur);
439  this->_nelem = this->_nhex + this->_ntet + this->_npyr + this->_npris;
440  int nbound = 0;
441  Inf.read(reinterpret_cast<char *>(&nbound),4);
442  _boundaries.resize(nbound);
443  if(!ReadPartitionBoundaries(Inf))
444  return(false);
445  if(!ReadPartitionPatches(Inf))
446  return(false);
447  Inf.close();
448  return(true);
449 }
unsigned int _nnodes
Definition: Partition.H:93
bool ReadPartitionPatches(ifstream &Inf)
Definition: Partition.C:125
unsigned int _npyr
Definition: Partition.H:97
unsigned int _ngnodes
Definition: GEM.H:286
unsigned int _ngpris
Definition: GEM.H:290
vector< PartitionBoundary > _boundaries
Definition: Partition.H:100
unsigned int _npris
Definition: Partition.H:98
unsigned int _nhex
Definition: Partition.H:96
unsigned int _id
Definition: GEM.H:284
bool ReadPartitionBoundaries(ifstream &Inf)
Definition: Partition.C:387
unsigned int _nelem
Definition: Partition.H:94
unsigned int _ngtet
Definition: GEM.H:287
unsigned int _ntet
Definition: Partition.H:95
static int rank
Definition: advectest.C:66
unsigned int _ngpyr
Definition: GEM.H:289
unsigned int _nghex
Definition: GEM.H:288
bool ReadPartitionASCII ( const string &  pre,
unsigned int  rank 
)

Definition at line 452 of file Partition.C.

453 {
454  ifstream Inf;
455  ostringstream Ostr;
456 
457  Ostr << pre << "." << rank << ".asc";
458  Inf.open(Ostr.str().c_str());
459  if(!Inf){
460  cerr << "Cannot open " << Ostr.str() << "." << endl;
461  return(false);
462  }
463 
464  _id = rank + 1;
465  unsigned int nvfaces,nbfaces;
466  Inf >> nvfaces >> nbfaces >> _nnodes >> _ngnodes;
467  _nvface = nvfaces + nbfaces;
468  unsigned int node = 0;
469  _nc.resize(3*_nnodes);
470  while(node < _nnodes){
471  Inf >> _nc[3*node] >> _nc[3*node+1] >> _nc[3*node+2];
472  node++;
473  }
474  Inf >> _ntet >> _ngtet;
475  unsigned int tet = 0;
476  _tetconn.resize(4*_ntet);
477  while(tet < _ntet){
478  Inf >> _tetconn[4*tet] >> _tetconn[4*tet+1] >> _tetconn[4*tet+2]
479  >> _tetconn[4*tet+3];
480  tet++;
481  }
482  Inf >> _npyr >> _ngpyr;
483  unsigned int pyr = 0;
484  _pyrconn.resize(5*_npyr);
485  while(pyr < _npyr){
486  Inf >> _pyrconn[5*pyr] >> _pyrconn[5*pyr+1] >> _pyrconn[5*pyr+2]
487  >> _pyrconn[5*pyr+3] >> _pyrconn[5*pyr+4];
488  pyr++;
489  }
490 
491  Inf >> _npris >> _ngpris;
492  unsigned int pris = 0;
493  _prisconn.resize(6*_npris);
494  while(pris < _npris){
495  Inf >> _prisconn[6*pris] >> _prisconn[6*pris+1] >> _prisconn[6*pris+2]
496  >> _prisconn[6*pris+3] >> _prisconn[6*pris+4]
497  >> _prisconn[6*pris+5];
498  pris++;
499  }
500 
501  Inf >> _nhex >> _nghex;
502  unsigned int hex = 0;
503  _hexconn.resize(8*_nhex);
504  while(hex < _nhex){
505  Inf >> _hexconn[8*hex] >> _hexconn[8*hex+1] >> _hexconn[8*hex+2]
506  >> _hexconn[8*hex+3] >> _hexconn[8*hex+4]
507  >> _hexconn[8*hex+5] >> _hexconn[8*hex+6] >> _hexconn[8*hex+7];
508  hex++;
509  }
510  _nelem = _nhex + _ntet + _npyr + _npris;
511  unsigned int nbound = 0;
512  Inf >> nbound;
513  _boundaries.resize(nbound);
515  return(false);
516  if(!ReadPartitionPatchesASCII(Inf))
517  return(false);
518  Inf.close();
519  return(true);
520 }
unsigned int _nnodes
Definition: Partition.H:93
std::vector< unsigned int > _tetconn
Definition: GEM.H:295
unsigned int _npyr
Definition: Partition.H:97
Definition: adj.h:150
unsigned int _ngnodes
Definition: GEM.H:286
unsigned int _ngpris
Definition: GEM.H:290
unsigned int _nvface
Definition: GEM.H:291
vector< PartitionBoundary > _boundaries
Definition: Partition.H:100
unsigned int _npris
Definition: Partition.H:98
bool ReadPartitionPatchesASCII(ifstream &Inf)
Definition: Partition.C:143
unsigned int _nhex
Definition: Partition.H:96
unsigned int _id
Definition: GEM.H:284
bool ReadPartitionBoundariesASCII(ifstream &Inf)
Definition: Partition.C:360
std::vector< unsigned int > _pyrconn
Definition: GEM.H:297
std::vector< unsigned int > _hexconn
Definition: GEM.H:301
unsigned int _nelem
Definition: Partition.H:94
unsigned int _ngtet
Definition: GEM.H:287
unsigned int _ntet
Definition: Partition.H:95
static int rank
Definition: advectest.C:66
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
bool ReadPartitionBoundaries ( ifstream &  Inf)

Definition at line 387 of file Partition.C.

References PartitionBoundary::MyRank(), and PartitionBoundary::ReadPartitionBoundary().

388 {
389  int nbound = _boundaries.size();
390  int bound = 0;
391  while(bound < nbound){
392  PartitionBoundary *pb = &_boundaries[bound++];
393  if(!pb->ReadPartitionBoundary(Inf))
394  return(false);
395  pb->MyRank(_id);
396  }
397  return(true);
398 }
vector< PartitionBoundary > _boundaries
Definition: Partition.H:100
unsigned int MyRank(void) const
Definition: Partition.H:58
unsigned int _id
Definition: GEM.H:284
bool ReadPartitionBoundary(ifstream &Inf)
Definition: Partition.C:172

Here is the call graph for this function:

bool ReadPartitionBoundariesASCII ( ifstream &  Inf)

Definition at line 360 of file Partition.C.

References PartitionBoundary::ReadPartitionBoundaryASCII().

361 {
362  int nbound = _boundaries.size();
363  int bound = 0;
364  while(bound < nbound){
365  PartitionBoundary *pb = &_boundaries[bound++];
366  if(!pb->ReadPartitionBoundaryASCII(Inf))
367  return(false);
368  // pb->MyRank(_rank);
369  }
370  return(true);
371 }
bool ReadPartitionBoundaryASCII(ifstream &Inf)
Definition: Partition.C:248
vector< PartitionBoundary > _boundaries
Definition: Partition.H:100

Here is the call graph for this function:

bool ReadPartitionPatches ( ifstream &  Inf)

Definition at line 125 of file Partition.C.

References PartitionPatch::ReadPartitionPatch().

126 {
127  // map<unsigned int, unsigned int> patch_mapping;
128  // if(!build_patch_mapping(pre,patch_mapping))
129  // return false;
130  int nlocal_patches;
131  Inf.read(reinterpret_cast<char *>(&nlocal_patches),4);
132  _patches.resize(nlocal_patches);
133  int bound = 0;
134  while(bound < nlocal_patches){
135  PartitionPatch *pp = &_patches[bound++];
136  if(!pp->ReadPartitionPatch(Inf))
137  return(false);
138  }
139  return(true);
140 }
vector< PartitionPatch > _patches
Definition: Partition.H:101
bool ReadPartitionPatch(ifstream &Inf)
Definition: Partition.C:42

Here is the call graph for this function:

bool ReadPartitionPatchesASCII ( ifstream &  Inf)

Definition at line 143 of file Partition.C.

References PartitionPatch::ReadPartitionPatchASCII().

144 {
145  int nlocal_patches;
146  Inf >> nlocal_patches;
147  _patches.resize(nlocal_patches);
148  int bound = 0;
149  while(bound < nlocal_patches){
150  PartitionPatch *pp = &_patches[bound++];
151  if(!pp->ReadPartitionPatchASCII(Inf))
152  return(false);
153  }
154  return(true);
155 }
vector< PartitionPatch > _patches
Definition: Partition.H:101
bool ReadPartitionPatchASCII(ifstream &Inf)
Definition: Partition.C:57

Here is the call graph for this function:

bool WritePartitionASCII ( const string &  pre)

Definition at line 691 of file Partition.C.

692 {
693  ofstream Ouf;
694  ostringstream Ostr;
695 
696  Ostr << pre << "." << _id-1 << ".asc";
697  Ouf.open(Ostr.str().c_str());
698  if(!Ouf){
699  cerr << "Cannot open " << Ostr.str() << "." << endl;
700  return(false);
701  }
702 
703 
704  Ouf << setw(12) << _nvface
705  << setw(12) << 0
706  << setw(12) << _nnodes
707  << setw(12) << _ngnodes
708  << endl;
709  unsigned int node = 0;
710  while(node < _nnodes){
711  Ouf << setw(20) << _nc[3*node]
712  << setw(20) << _nc[3*node+1]
713  << setw(20) << _nc[3*node+2]
714  << endl;
715  node++;
716  }
717  Ouf << setw(12) << _ntet
718  << setw(12) << _ngtet
719  << endl;
720  unsigned int tet = 0;
721  while(tet < _ntet){
722  Ouf << setw(12) << _tetconn[4*tet]
723  << setw(12) << _tetconn[4*tet+1]
724  << setw(12) << _tetconn[4*tet+2]
725  << setw(12) << _tetconn[4*tet+3]
726  << endl;
727  tet++;
728  }
729  Ouf << setw(12) << _npyr
730  << setw(12) << _ngpyr
731  << endl;
732  unsigned int pyr = 0;
733  while(pyr < _npyr){
734  Ouf << setw(12) << _pyrconn[5*pyr]
735  << setw(12) << _pyrconn[5*pyr+1]
736  << setw(12) << _pyrconn[5*pyr+2]
737  << setw(12) << _pyrconn[5*pyr+3]
738  << setw(12) << _pyrconn[5*pyr+4]
739  << endl;
740  pyr++;
741  }
742 
743  Ouf << setw(12) << _npris
744  << setw(12) << _ngpris
745  << endl;
746  unsigned int pris = 0;
747  while(pris < _npris){
748  Ouf << setw(12) << _prisconn[6*pris]
749  << setw(12) << _prisconn[6*pris+1]
750  << setw(12) << _prisconn[6*pris+2]
751  << setw(12) << _prisconn[6*pris+3]
752  << setw(12) << _prisconn[6*pris+4]
753  << setw(12) << _prisconn[6*pris+5]
754  << endl;
755  pris++;
756  }
757 
758  Ouf << setw(12) << _nhex
759  << setw(12) << _nghex
760  << endl;
761  unsigned int hex = 0;
762  while(hex < _nhex){
763  Ouf << setw(12) << _hexconn[8*hex]
764  << setw(12) << _hexconn[8*hex+1]
765  << setw(12) << _hexconn[8*hex+2]
766  << setw(12) << _hexconn[8*hex+3]
767  << setw(12) << _hexconn[8*hex+4]
768  << setw(12) << _hexconn[8*hex+5]
769  << setw(12) << _hexconn[8*hex+6]
770  << setw(12) << _hexconn[8*hex+7]
771  << endl;
772  hex++;
773  }
774  Ouf << _boundaries.size() << endl;
776  return(false);
778  return(false);
779  Ouf.close();
780  return(true);
781 }
unsigned int _nnodes
Definition: Partition.H:93
std::vector< unsigned int > _tetconn
Definition: GEM.H:295
unsigned int _npyr
Definition: Partition.H:97
bool WritePartitionPatchesASCII(ofstream &Ouf)
Definition: Partition.C:159
Definition: adj.h:150
unsigned int _ngnodes
Definition: GEM.H:286
bool WritePartitionBoundariesASCII(ofstream &Ouf)
Definition: Partition.C:374
unsigned int _ngpris
Definition: GEM.H:290
unsigned int _nvface
Definition: GEM.H:291
vector< PartitionBoundary > _boundaries
Definition: Partition.H:100
unsigned int _npris
Definition: Partition.H:98
unsigned int _nhex
Definition: Partition.H:96
unsigned int _id
Definition: GEM.H:284
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
unsigned int _ntet
Definition: Partition.H:95
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
bool WritePartitionBoundariesASCII ( ofstream &  Ouf)

Definition at line 374 of file Partition.C.

References PartitionBoundary::WritePartitionBoundaryASCII().

375 {
376  int nbound = _boundaries.size();
377  int bound = 0;
378  while(bound < nbound){
379  PartitionBoundary *pb = &_boundaries[bound++];
380  if(!pb->WritePartitionBoundaryASCII(Ouf))
381  return(false);
382  }
383  return(true);
384 }
vector< PartitionBoundary > _boundaries
Definition: Partition.H:100
bool WritePartitionBoundaryASCII(ofstream &Ouf)
Definition: Partition.C:301

Here is the call graph for this function:

bool WritePartitionPatchesASCII ( ofstream &  Ouf)

Definition at line 159 of file Partition.C.

References PartitionPatch::WritePartitionPatchASCII().

160 {
161  Ouf << setw(12) << _patches.size() << endl;
162  unsigned int bound = 0;
163  while(bound < _patches.size()){
164  PartitionPatch *pp = &_patches[bound++];
165  if(!pp->WritePartitionPatchASCII(Ouf))
166  return(false);
167  }
168  return(true);
169 }
bool WritePartitionPatchASCII(ofstream &Ouf)
Definition: Partition.C:96
vector< PartitionPatch > _patches
Definition: Partition.H:101

Here is the call graph for this function:

Member Data Documentation

vector<PartitionBoundary> _boundaries

Definition at line 100 of file Partition.H.

unsigned int _nelem

Definition at line 94 of file Partition.H.

unsigned int _nhex

Definition at line 96 of file Partition.H.

unsigned int _nnodes

Definition at line 93 of file Partition.H.

unsigned int _npatch

Definition at line 99 of file Partition.H.

unsigned int _npris

Definition at line 98 of file Partition.H.

unsigned int _npyr

Definition at line 97 of file Partition.H.

unsigned int _ntet

Definition at line 95 of file Partition.H.

vector<PartitionPatch> _patches

Definition at line 101 of file Partition.H.


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