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

#include <Partition.H>

Inheritance diagram for PartitionBoundary:
Collaboration diagram for PartitionBoundary:

Public Member Functions

 PartitionBoundary ()
 
 PartitionBoundary (const GEM_PartitionBoundary &pb)
 
bool ReadPartitionBoundary (ifstream &Inf)
 
bool ReadPartitionBoundaryASCII (ifstream &Inf)
 
bool WritePartitionBoundaryASCII (ofstream &Ouf)
 
unsigned int MyRank (void) const
 
void MyRank (unsigned int n)
 
void populate_local_arrays (const PartitionBoundary &)
 
void populate_local_arrays (const PartitionBoundary &rpb, GEM_Partition &gp)
 
- Public Member Functions inherited from GEM_PartitionBoundary
void report ()
 
void populate (int rpid, int nnshared, int nnsend, int nnrecv, int ncsend, int ncrecv, int *sharedn, int *sendn, int *recvn, int *sendc, int *recvc)
 
 GEM_PartitionBoundary (const GEM_PartitionBoundary &pb)
 
 GEM_PartitionBoundary ()
 
GEM_PartitionBoundaryoperator= (const GEM_PartitionBoundary &pb)
 

Public Attributes

unsigned int _mypart
 
unsigned int _rbid
 
vector< pair< unsigned int,
unsigned int > > 
_bnodes
 
unsigned int _ngnodes
 
vector< pair< unsigned int,
unsigned int > > 
_btets
 
unsigned int _ngtets
 
vector< pair< unsigned int,
unsigned int > > 
_bhex
 
unsigned int _nghex
 
vector< pair< unsigned int,
unsigned int > > 
_bpyr
 
unsigned int _ngpyr
 
vector< pair< unsigned int,
unsigned int > > 
_bpris
 
unsigned int _ngpris
 
vector< unsigned int > _belem_send [4]
 
vector< unsigned int > _belem_recv [4]
 
- Public Attributes inherited from GEM_PartitionBoundary
unsigned int _rpart
 
std::vector< unsigned int > _sendcells
 
std::vector< unsigned int > _recvcells
 
std::vector< unsigned int > _sendnodes
 
std::vector< unsigned int > _recvnodes
 
std::vector< unsigned int > _sharenodes
 
GEM_UserData _data
 
std::ostream * _out
 
bool _debug
 

Detailed Description

Definition at line 29 of file Partition.H.

Constructor & Destructor Documentation

PartitionBoundary ( )
inline

Definition at line 45 of file Partition.H.

47  {};
PartitionBoundary ( const GEM_PartitionBoundary pb)
inline

Definition at line 48 of file Partition.H.

References _mypart, _ngnodes, _rbid, and GEM_PartitionBoundary::_recvnodes.

50  {
51  _mypart = 0;
52  _rbid = 0;
53  _ngnodes = pb._recvnodes.size();
54  };
std::vector< unsigned int > _recvnodes
Definition: GEM.H:230
unsigned int _ngnodes
Definition: Partition.H:34
unsigned int _rbid
Definition: Partition.H:32
unsigned int _mypart
Definition: Partition.H:31

Member Function Documentation

unsigned int MyRank ( void  ) const
inline

Definition at line 58 of file Partition.H.

References _mypart.

Referenced by Partition::ReadPartitionBoundaries().

58 { return _mypart; };
unsigned int _mypart
Definition: Partition.H:31

Here is the caller graph for this function:

void MyRank ( unsigned int  n)
inline

Definition at line 59 of file Partition.H.

References _mypart, and n.

59 {_mypart = n;};
const NT & n
unsigned int _mypart
Definition: Partition.H:31
void populate_local_arrays ( const PartitionBoundary rpb)

Definition at line 1004 of file Partition.C.

References _bnodes, and _ngnodes.

1005 {
1006  // Total number of nodes on this boundary (shared+send+recv)
1007  unsigned int nnodes = _bnodes.size();
1008  // Number of local reals is local total minus local ghosts
1009  unsigned int nreal = _bnodes.size() - _ngnodes;
1010  // Number of remote recv'd nodes
1011  unsigned int nremote_gnodes = rpb._ngnodes;
1012  // Number of local shared is local real - remote ghosts
1013  unsigned int nshared = nreal - nremote_gnodes;
1014  // Num remote real is remote total minus remote ghosts
1015  unsigned int nremote_rnodes = rpb._bnodes.size() - nremote_gnodes;
1016  // Num local send nodes must equal num remote ghosts
1017  unsigned int nsend = nreal - nshared;
1018  assert(nsend == nremote_gnodes);
1019  _recvnodes.resize(_ngnodes);
1020  _sharenodes.resize(nshared);
1021  _sendnodes.resize(nsend);
1022  //
1023  // We always let the sender determine the node ordering,
1024  // so the recv arrays need to be re-ordered so that they
1025  // match the remote border's node ordering. Also, we
1026  // let the lesser of the two partition_id's determine the
1027  // shared node order.
1028  //
1029  // The format for the data in _bnodes[] at this point is:
1030  //
1031  // vector<pair<LocalNodeIndex,RemoteBoundaryNodeIndex> >
1032  //
1033  // And we want to populate the send, recv, and shared
1034  // node arrays in the correct order. For those that need
1035  // the remote ordering, we swap the pairs above and sort
1036  // the array based on the RemoteBoundaryNodeIndex (which
1037  // indexes into the remote partition's boundary node
1038  // array). Then we take a second pass to populate the
1039  // local indices in that ordering.
1040  //
1041  // These hold the inverted local<-->remote node indices
1042  vector<pair<unsigned int,unsigned int> > recv_iindex;
1043  vector<pair<unsigned int,unsigned int> > shared_iindex;
1044  recv_iindex.resize(_ngnodes);
1045  shared_iindex.resize(nshared);
1046  unsigned int node = 0;
1047  unsigned int shnode = 0;
1048  unsigned int snode = 0;
1049  unsigned int rnode = 0;
1050  while(node < nnodes){
1051  // All ghost nodes are processed here
1052  if(node >= nreal)
1053  recv_iindex[rnode++] = make_pair(_bnodes[node].second,
1054  _bnodes[node].first);
1055  // recv_iindex[rnode++] = _bnodes[node];
1056  else {
1057  if(_bnodes[node].second > nremote_rnodes)
1058  _sendnodes[snode++] = _bnodes[node].first;
1059  else {
1060  if(_mypart < _rpart)
1061  _sharenodes[shnode++] = _bnodes[node].first;
1062  else
1063  shared_iindex[shnode++] = make_pair(_bnodes[node].second,
1064  _bnodes[node].first);
1065  }
1066  }
1067  node++;
1068  }
1069  sort(recv_iindex.begin(),recv_iindex.end());
1070  node = 0;
1071  while(node < rnode){
1072  _recvnodes[node] = recv_iindex[node].second;
1073  node++;
1074  }
1075  // Check partition_id (encoded as _myrank and _rrank) and order shared
1076  // nodes if needed.
1077  if(_mypart > _rpart){
1078  node = 0;
1079  sort(shared_iindex.begin(),shared_iindex.end());
1080  while(node < shnode){
1081  _sharenodes[node] = shared_iindex[node].second;
1082  node++;
1083  }
1084  }
1085 
1086  // Nodes are done. Now we need send and recv element arrays. These will be
1087  // done independently for each element type.
1088  unsigned int ntets = _btets.size();
1089  unsigned int nhex = _bhex.size();
1090  unsigned int npyr = _bpyr.size();
1091  unsigned int npris = _bpris.size();
1092  unsigned int nreal_tets = ntets - _ngtets;
1093  unsigned int nreal_hex = nhex - _nghex;
1094  unsigned int nreal_pyr = npyr - _ngpyr;
1095  unsigned int nreal_pris = npris - _ngpris;
1096  _belem_send[0].resize(nreal_tets);
1097  _belem_send[1].resize(nreal_pyr);
1098  _belem_send[2].resize(nreal_pris);
1099  _belem_send[3].resize(nreal_hex);
1100  _belem_recv[0].resize(_ngtets);
1101  _belem_recv[1].resize(_ngpyr);
1102  _belem_recv[2].resize(_ngpris);
1103  _belem_recv[3].resize(_nghex);
1104  _sendcells.resize(nreal_tets+nreal_pyr+nreal_pris+nreal_hex);
1105  _recvcells.resize(_ngtets+_ngpyr+_ngpris+_nghex);
1106  unsigned int elem = 0;
1107  unsigned int selem = 0;
1108  unsigned int relem = 0;
1109  unsigned int scell = 0;
1110  unsigned int rcell = 0;
1111  recv_iindex.resize(_ngtets);
1112  while(elem < ntets){
1113  if(elem < nreal_tets){
1114  _belem_send[0][selem++] = _btets[elem].first;
1115  _sendcells[scell++] = _btets[elem].first;
1116  }
1117  else
1118  recv_iindex[relem++] = make_pair(_btets[elem].second,
1119  _btets[elem].first);
1120  elem++;
1121  }
1122  elem = 0;
1123  sort(recv_iindex.begin(),recv_iindex.end());
1124  while(elem < relem){
1125  _belem_recv[0][elem] = recv_iindex[elem].second;
1126  _recvcells[rcell++] = recv_iindex[elem].second;
1127  elem++;
1128  }
1129  assert((relem == _ngtets) && (selem == nreal_tets));
1130  elem = 0;
1131  selem = 0;
1132  relem = 0;
1133  recv_iindex.resize(_ngpyr);
1134  while(elem < npyr){
1135  if(elem < nreal_pyr){
1136  _belem_send[1][selem++] = _bpyr[elem].first;
1137  _sendcells[scell++] = _bpyr[elem].first + ntets;
1138  }
1139  else
1140  recv_iindex[relem++] = make_pair(_bpyr[elem].second,
1141  _bpyr[elem].first);
1142  elem++;
1143  }
1144  elem = 0;
1145  sort(recv_iindex.begin(),recv_iindex.end());
1146  while(elem < relem){
1147  _belem_recv[1][elem] = recv_iindex[elem].second;
1148  _recvcells[rcell++] = recv_iindex[elem].second + ntets;
1149  elem++;
1150  }
1151  assert((relem == _ngpyr) && (selem == nreal_pyr));
1152  elem = 0;
1153  selem = 0;
1154  relem = 0;
1155  recv_iindex.resize(_ngpris);
1156  while(elem < npris){
1157  if(elem < nreal_pris){
1158  _belem_send[2][selem++] = _bpris[elem].first;
1159  _sendcells[scell++] = _bpris[elem].first + ntets + npyr;
1160  }
1161  else
1162  recv_iindex[relem++] = make_pair(_bpris[elem].second,
1163  _bpris[elem].first);
1164  elem++;
1165  }
1166  elem = 0;
1167  sort(recv_iindex.begin(),recv_iindex.end());
1168  while(elem < relem){
1169  _belem_recv[2][elem] = recv_iindex[elem].second;
1170  _recvcells[rcell++] = recv_iindex[elem].second + ntets + npyr;
1171  elem++;
1172  }
1173  assert((relem == _ngpris) && (selem == nreal_pris));
1174  elem = 0;
1175  selem = 0;
1176  relem = 0;
1177  recv_iindex.resize(_nghex);
1178  while(elem < nhex){
1179  if(elem < nreal_hex){
1180  _belem_send[3][selem++] = _bhex[elem].first;
1181  _sendcells[scell++] = _bhex[elem].first+ntets+npyr+npris;
1182  }
1183  else
1184  recv_iindex[relem++] = make_pair(_bhex[elem].second,
1185  _bhex[elem].first);
1186  elem++;
1187  }
1188  elem = 0;
1189  sort(recv_iindex.begin(),recv_iindex.end());
1190  while(elem < relem){
1191  _belem_recv[3][elem] = recv_iindex[elem].second;
1192  _recvcells[rcell++] = recv_iindex[elem].second+ntets+npyr+npris;
1193  elem++;
1194  }
1195  assert((relem == _nghex) && (selem == nreal_hex));
1196 }
unsigned int _ngpyr
Definition: Partition.H:40
std::vector< unsigned int > _recvnodes
Definition: GEM.H:230
std::vector< unsigned int > _sendcells
Definition: GEM.H:227
vector< pair< unsigned int, unsigned int > > _bnodes
Definition: Partition.H:33
unsigned int _ngtets
Definition: Partition.H:36
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< pair< unsigned int, unsigned int > > _btets
Definition: Partition.H:35
unsigned int _ngpris
Definition: Partition.H:42
vector< pair< unsigned int, unsigned int > > _bhex
Definition: Partition.H:37
vector< pair< unsigned int, unsigned int > > _bpyr
Definition: Partition.H:39
vector< pair< unsigned int, unsigned int > > _bpris
Definition: Partition.H:41
vector< unsigned int > _belem_recv[4]
Definition: Partition.H:44
unsigned int _ngnodes
Definition: Partition.H:34
vector< unsigned int > _belem_send[4]
Definition: Partition.H:43
unsigned int _nghex
Definition: Partition.H:38
unsigned int _mypart
Definition: Partition.H:31
unsigned int _rpart
Definition: GEM.H:226
void populate_local_arrays ( const PartitionBoundary rpb,
GEM_Partition gp 
)

Definition at line 794 of file Partition.C.

References _bnodes, GEM_Partition::_debug, _ngnodes, and GEM_Partition::Elem2Cell().

796 {
797  bool debug = gp._debug;
798  if(debug)
799  cerr << "PartitionBoundary::populate_local_arrays entry" << endl;
800  // Total number of nodes on this boundary (shared+send+recv)
801  unsigned int nnodes = _bnodes.size();
802  // Number of local reals is local total minus local ghosts
803  unsigned int nreal = _bnodes.size() - _ngnodes;
804  // Number of remote recv'd nodes
805  unsigned int nremote_gnodes = rpb._ngnodes;
806  // Number of local shared is local real - remote ghosts
807  unsigned int nshared = nreal - nremote_gnodes;
808  // Num remote real is remote total minus remote ghosts
809  unsigned int nremote_rnodes = rpb._bnodes.size() - nremote_gnodes;
810  // Num local send nodes must equal num remote ghosts
811  unsigned int nsend = nreal - nshared;
812  assert(nsend == nremote_gnodes);
813  _recvnodes.resize(_ngnodes);
814  _sharenodes.resize(nshared);
815  _sendnodes.resize(nsend);
816  //
817  // We always let the sender determine the node ordering,
818  // so the recv arrays need to be re-ordered so that they
819  // match the remote border's node ordering. Also, we
820  // let the lesser of the two partition_id's determine the
821  // shared node order.
822  //
823  // The format for the data in _bnodes[] at this point is:
824  //
825  // vector<pair<LocalNodeIndex,RemoteBoundaryNodeIndex> >
826  //
827  // And we want to populate the send, recv, and shared
828  // node arrays in the correct order. For those that need
829  // the remote ordering, we swap the pairs above and sort
830  // the array based on the RemoteBoundaryNodeIndex (which
831  // indexes into the remote partition's boundary node
832  // array). Then we take a second pass to populate the
833  // local indices in that ordering.
834  //
835  // These hold the inverted local<-->remote node indices
836  vector<pair<unsigned int,unsigned int> > recv_iindex;
837  vector<pair<unsigned int,unsigned int> > shared_iindex;
838  recv_iindex.resize(_ngnodes);
839  shared_iindex.resize(nshared);
840  unsigned int node = 0;
841  unsigned int shnode = 0;
842  unsigned int snode = 0;
843  unsigned int rnode = 0;
844  while(node < nnodes){
845  // All ghost nodes are processed here
846  if(node >= nreal)
847  recv_iindex[rnode++] = make_pair(_bnodes[node].second,
848  _bnodes[node].first);
849  // recv_iindex[rnode++] = _bnodes[node];
850  else {
851  if(_bnodes[node].second > nremote_rnodes)
852  _sendnodes[snode++] = _bnodes[node].first;
853  else {
854  if(_mypart < _rpart)
855  _sharenodes[shnode++] = _bnodes[node].first;
856  else
857  shared_iindex[shnode++] = make_pair(_bnodes[node].second,
858  _bnodes[node].first);
859  }
860  }
861  node++;
862  }
863  sort(recv_iindex.begin(),recv_iindex.end());
864  node = 0;
865  while(node < rnode){
866  _recvnodes[node] = recv_iindex[node].second;
867  node++;
868  }
869  // Check partition_id (encoded as _myrank and _rrank) and order shared
870  // nodes if needed.
871  if(_mypart > _rpart){
872  node = 0;
873  sort(shared_iindex.begin(),shared_iindex.end());
874  while(node < shnode){
875  _sharenodes[node] = shared_iindex[node].second;
876  node++;
877  }
878  }
879  if(debug)
880  cerr << "PartitionBoundary::populate_local_arrays: Beginning elements."
881  << endl;
882  // Nodes are done. Now we need send and recv element arrays. These will be
883  // done independently for each element type.
884  unsigned int ntets = _btets.size();
885  unsigned int nhex = _bhex.size();
886  unsigned int npyr = _bpyr.size();
887  unsigned int npris = _bpris.size();
888  unsigned int nreal_tets = ntets - _ngtets;
889  unsigned int nreal_hex = nhex - _nghex;
890  unsigned int nreal_pyr = npyr - _ngpyr;
891  unsigned int nreal_pris = npris - _ngpris;
892  _belem_send[0].resize(nreal_tets);
893  _belem_send[1].resize(nreal_pyr);
894  _belem_send[2].resize(nreal_pris);
895  _belem_send[3].resize(nreal_hex);
896  _belem_recv[0].resize(_ngtets);
897  _belem_recv[1].resize(_ngpyr);
898  _belem_recv[2].resize(_ngpris);
899  _belem_recv[3].resize(_nghex);
900  _sendcells.resize(nreal_tets+nreal_pyr+nreal_pris+nreal_hex);
901  _recvcells.resize(_ngtets+_ngpyr+_ngpris+_nghex);
902  unsigned int elem = 0;
903  unsigned int selem = 0;
904  unsigned int relem = 0;
905  unsigned int scell = 0;
906  unsigned int rcell = 0;
907  recv_iindex.resize(_ngtets);
908  while(elem < ntets){
909  if(elem < nreal_tets){
910  _belem_send[0][selem++] = _btets[elem].first;
911  _sendcells[scell++] = gp.Elem2Cell(make_pair((unsigned int)1,
912  _btets[elem].first));
913  }
914  else
915  recv_iindex[relem++] = make_pair(_btets[elem].second,
916  _btets[elem].first);
917  elem++;
918  }
919  elem = 0;
920  sort(recv_iindex.begin(),recv_iindex.end());
921  while(elem < relem){
922  _belem_recv[0][elem] = recv_iindex[elem].second;
923  _recvcells[rcell++] = gp.Elem2Cell(make_pair((unsigned int)1,
924  recv_iindex[elem].second));
925  elem++;
926  }
927  assert((relem == _ngtets) && (selem == nreal_tets));
928  elem = 0;
929  selem = 0;
930  relem = 0;
931  recv_iindex.resize(_ngpyr);
932  while(elem < npyr){
933  if(elem < nreal_pyr){
934  _belem_send[1][selem++] = _bpyr[elem].first;
935  _sendcells[scell++] = gp.Elem2Cell(make_pair((unsigned int)2,
936  _bpyr[elem].first));
937  }
938  else
939  recv_iindex[relem++] = make_pair(_bpyr[elem].second,
940  _bpyr[elem].first);
941  elem++;
942  }
943  elem = 0;
944  sort(recv_iindex.begin(),recv_iindex.end());
945  while(elem < relem){
946  _belem_recv[1][elem] = recv_iindex[elem].second;
947  _recvcells[rcell++] = gp.Elem2Cell(make_pair((unsigned int)2,
948  recv_iindex[elem].second));
949  elem++;
950  }
951  assert((relem == _ngpyr) && (selem == nreal_pyr));
952  elem = 0;
953  selem = 0;
954  relem = 0;
955  recv_iindex.resize(_ngpris);
956  while(elem < npris){
957  if(elem < nreal_pris){
958  _belem_send[2][selem++] = _bpris[elem].first;
959  _sendcells[scell++] = gp.Elem2Cell(make_pair((unsigned int)3,
960  _bpris[elem].first));
961  }
962  else
963  recv_iindex[relem++] = make_pair(_bpris[elem].second,
964  _bpris[elem].first);
965  elem++;
966  }
967  elem = 0;
968  sort(recv_iindex.begin(),recv_iindex.end());
969  while(elem < relem){
970  _belem_recv[2][elem] = recv_iindex[elem].second;
971  _recvcells[rcell++] = gp.Elem2Cell(make_pair((unsigned int)3,
972  recv_iindex[elem].second));
973  elem++;
974  }
975  assert((relem == _ngpris) && (selem == nreal_pris));
976  elem = 0;
977  selem = 0;
978  relem = 0;
979  recv_iindex.resize(_nghex);
980  while(elem < nhex){
981  if(elem < nreal_hex){
982  _belem_send[3][selem++] = _bhex[elem].first;
983  _sendcells[scell++] = gp.Elem2Cell(make_pair((unsigned int)4,
984  _bhex[elem].first));
985  }
986  else
987  recv_iindex[relem++] = make_pair(_bhex[elem].second,
988  _bhex[elem].first);
989  elem++;
990  }
991  elem = 0;
992  sort(recv_iindex.begin(),recv_iindex.end());
993  while(elem < relem){
994  _belem_recv[3][elem] = recv_iindex[elem].second;
995  _recvcells[rcell++] = gp.Elem2Cell(make_pair((unsigned int)4,
996  recv_iindex[elem].second));
997  elem++;
998  }
999  assert((relem == _nghex) && (selem == nreal_hex));
1000 }
unsigned int _ngpyr
Definition: Partition.H:40
std::vector< unsigned int > _recvnodes
Definition: GEM.H:230
std::vector< unsigned int > _sendcells
Definition: GEM.H:227
vector< pair< unsigned int, unsigned int > > _bnodes
Definition: Partition.H:33
unsigned int _ngtets
Definition: Partition.H:36
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< pair< unsigned int, unsigned int > > _btets
Definition: Partition.H:35
unsigned int _ngpris
Definition: Partition.H:42
unsigned int Elem2Cell(std::pair< unsigned int, unsigned int >)
Definition: GEM.C:956
vector< pair< unsigned int, unsigned int > > _bhex
Definition: Partition.H:37
vector< pair< unsigned int, unsigned int > > _bpyr
Definition: Partition.H:39
vector< pair< unsigned int, unsigned int > > _bpris
Definition: Partition.H:41
vector< unsigned int > _belem_recv[4]
Definition: Partition.H:44
unsigned int _ngnodes
Definition: Partition.H:34
vector< unsigned int > _belem_send[4]
Definition: Partition.H:43
unsigned int _nghex
Definition: Partition.H:38
bool _debug
Definition: GEM.H:310
unsigned int _mypart
Definition: Partition.H:31
unsigned int _rpart
Definition: GEM.H:226

Here is the call graph for this function:

bool ReadPartitionBoundary ( ifstream &  Inf)

Definition at line 172 of file Partition.C.

Referenced by Partition::ReadPartitionBoundaries().

173 {
174  int buf[4];
175  Inf.read(reinterpret_cast<char *>(buf),16);
176  _rpart = buf[0];
177  _rbid = buf[1];
178  int nnodes = buf[2];
179  _ngnodes = buf[3];
180 
181  _bnodes.resize(nnodes);
182  int *nbuf = new int [2 * nnodes];
183  Inf.read(reinterpret_cast<char *>(nbuf),8*nnodes);
184 
185  int node = 0;
186  while(node < nnodes){
187  _bnodes[node] = make_pair(nbuf[2*node],nbuf[2*node+1]);
188  node++;
189  }
190  delete [] nbuf;
191 
192  Inf.read(reinterpret_cast<char *>(buf),8);
193  int nelem = buf[0];
194  _ngtets = buf[1];
195  _btets.resize(nelem);
196  nbuf = new int [2*nelem];
197  Inf.read(reinterpret_cast<char *>(nbuf),nelem*8);
198  int elem = 0;
199  while(elem < nelem){
200  _btets[elem] = make_pair(nbuf[2*elem],nbuf[2*elem+1]);
201  elem++;
202  }
203  delete [] nbuf;
204 
205  Inf.read(reinterpret_cast<char *>(buf),8);
206  nelem = buf[0];
207  _ngpyr = buf[1];
208  _bpyr.resize(nelem);
209  nbuf = new int [2*nelem];
210  Inf.read(reinterpret_cast<char *>(nbuf),nelem*8);
211  elem = 0;
212  while(elem < nelem){
213  _bpyr[elem] = make_pair(nbuf[2*elem],nbuf[2*elem+1]);
214  elem++;
215  }
216  delete [] nbuf;
217 
218  Inf.read(reinterpret_cast<char *>(buf),8);
219  nelem = buf[0];
220  _ngpris = buf[1];
221  _bpris.resize(nelem);
222  nbuf = new int [2*nelem];
223  Inf.read(reinterpret_cast<char *>(nbuf),nelem*8);
224  elem = 0;
225  while(elem < nelem){
226  _bpris[elem] = make_pair(nbuf[2*elem],nbuf[2*elem+1]);
227  elem++;
228  }
229  delete [] nbuf;
230 
231  Inf.read(reinterpret_cast<char *>(buf),8);
232  nelem = buf[0];
233  _nghex = buf[1];
234  _bhex.resize(nelem);
235  nbuf = new int [2*nelem];
236  Inf.read(reinterpret_cast<char *>(nbuf),nelem*8);
237  elem = 0;
238  while(elem < nelem){
239  _bhex[elem] = make_pair(nbuf[2*elem],nbuf[2*elem+1]);
240  elem++;
241  }
242  delete [] nbuf;
243 
244  return(true);
245 }
unsigned int _ngpyr
Definition: Partition.H:40
vector< pair< unsigned int, unsigned int > > _bnodes
Definition: Partition.H:33
unsigned int _ngtets
Definition: Partition.H:36
Definition: adj.h:150
vector< pair< unsigned int, unsigned int > > _btets
Definition: Partition.H:35
unsigned int _ngpris
Definition: Partition.H:42
vector< pair< unsigned int, unsigned int > > _bhex
Definition: Partition.H:37
vector< pair< unsigned int, unsigned int > > _bpyr
Definition: Partition.H:39
vector< pair< unsigned int, unsigned int > > _bpris
Definition: Partition.H:41
unsigned int _ngnodes
Definition: Partition.H:34
unsigned int _nghex
Definition: Partition.H:38
unsigned int _rbid
Definition: Partition.H:32
unsigned int _rpart
Definition: GEM.H:226

Here is the caller graph for this function:

bool ReadPartitionBoundaryASCII ( ifstream &  Inf)

Definition at line 248 of file Partition.C.

Referenced by Partition::ReadPartitionBoundariesASCII().

249 {
250  int nnodes = 0;
251  Inf >> _rpart >> _rbid >> nnodes >> _ngnodes;
252  _rpart += 1; // This converts to the required 1-based id's
253  _bnodes.resize(nnodes);
254  int node = 0;
255  int l,r;
256  while(node < nnodes){
257  Inf >> l >> r;
258  _bnodes[node++] = make_pair(l,r);
259  }
260 
261  int nelem = 0;
262  Inf >> nelem >> _ngtets;
263  _btets.resize(nelem);
264  int elem = 0;
265  while(elem < nelem){
266  Inf >> l >> r;
267  _btets[elem++] = make_pair(l,r);
268  }
269 
270  nelem = 0;
271  Inf >> nelem >> _ngpyr;
272  _bpyr.resize(nelem);
273  elem = 0;
274  while(elem < nelem){
275  Inf >> l >> r;
276  _bpyr[elem++] = make_pair(l,r);
277  }
278 
279  nelem = 0;
280  Inf >> nelem >> _ngpris;
281  _bpris.resize(nelem);
282  elem = 0;
283  while(elem < nelem){
284  Inf >> l >> r;
285  _bpris[elem++] = make_pair(l,r);
286  }
287 
288  nelem = 0;
289  Inf >> nelem >> _nghex;
290  _bhex.resize(nelem);
291  elem = 0;
292  while(elem < nelem){
293  Inf >> l >> r;
294  _bhex[elem++] = make_pair(l,r);
295  }
296 
297  return(true);
298 }
unsigned int _ngpyr
Definition: Partition.H:40
vector< pair< unsigned int, unsigned int > > _bnodes
Definition: Partition.H:33
unsigned int _ngtets
Definition: Partition.H:36
Definition: adj.h:150
vector< pair< unsigned int, unsigned int > > _btets
Definition: Partition.H:35
unsigned int _ngpris
Definition: Partition.H:42
vector< pair< unsigned int, unsigned int > > _bhex
Definition: Partition.H:37
vector< pair< unsigned int, unsigned int > > _bpyr
Definition: Partition.H:39
vector< pair< unsigned int, unsigned int > > _bpris
Definition: Partition.H:41
unsigned int _ngnodes
Definition: Partition.H:34
unsigned int _nghex
Definition: Partition.H:38
unsigned int _rbid
Definition: Partition.H:32
unsigned int _rpart
Definition: GEM.H:226

Here is the caller graph for this function:

bool WritePartitionBoundaryASCII ( ofstream &  Ouf)

Definition at line 301 of file Partition.C.

Referenced by Partition::WritePartitionBoundariesASCII().

302 {
303  unsigned int nelem = _bnodes.size();
304  Ouf << setw(12) << _rpart-1 << endl
305  << setw(12) << _rbid << endl
306  << setw(12) << nelem << endl
307  << setw(12) << _ngnodes << endl;
308  unsigned int node = 0;
309  while(node < nelem){
310  Ouf << setw(12) << _bnodes[node].first
311  << setw(12) << _bnodes[node].second
312  << endl;
313  node++;
314  }
315  nelem = _btets.size();
316  Ouf << setw(12) << nelem << endl
317  << setw(12) << _ngtets << endl;
318  unsigned int elem = 0;
319  while(elem < nelem){
320  Ouf << setw(12) << _btets[elem].first
321  << setw(12) << _btets[elem].second
322  << endl;
323  elem++;
324  }
325 
326  nelem = _bpyr.size();
327  Ouf << setw(12) << nelem << endl
328  << setw(12) << _ngpyr << endl;
329  elem = 0;
330  while(elem < nelem){
331  Ouf << setw(12) << _bpyr[elem].first
332  << setw(12) << _bpyr[elem].second
333  << endl;
334  elem++;
335  }
336  nelem = _bpris.size();
337  Ouf << setw(12) << nelem << endl
338  << setw(12) << _ngpris << endl;
339  elem = 0;
340  while(elem < nelem){
341  Ouf << setw(12) << _bpris[elem].first
342  << setw(12) << _bpris[elem].second
343  << endl;
344  elem++;
345  }
346  nelem = _bhex.size();
347  Ouf << setw(12) << nelem << endl
348  << setw(12) << _nghex << endl;
349  elem = 0;
350  while(elem < nelem){
351  Ouf << setw(12) << _bhex[elem].first
352  << setw(12) << _bhex[elem].second
353  << endl;
354  elem++;
355  }
356  return(true);
357 }
unsigned int _ngpyr
Definition: Partition.H:40
vector< pair< unsigned int, unsigned int > > _bnodes
Definition: Partition.H:33
unsigned int _ngtets
Definition: Partition.H:36
Definition: adj.h:150
vector< pair< unsigned int, unsigned int > > _btets
Definition: Partition.H:35
unsigned int _ngpris
Definition: Partition.H:42
vector< pair< unsigned int, unsigned int > > _bhex
Definition: Partition.H:37
vector< pair< unsigned int, unsigned int > > _bpyr
Definition: Partition.H:39
vector< pair< unsigned int, unsigned int > > _bpris
Definition: Partition.H:41
unsigned int _ngnodes
Definition: Partition.H:34
unsigned int _nghex
Definition: Partition.H:38
unsigned int _rbid
Definition: Partition.H:32
unsigned int _rpart
Definition: GEM.H:226

Here is the caller graph for this function:

Member Data Documentation

vector<unsigned int> _belem_recv[4]

Definition at line 44 of file Partition.H.

Referenced by Partition::BuildPartitionBoundaries().

vector<unsigned int> _belem_send[4]

Definition at line 43 of file Partition.H.

Referenced by Partition::BuildPartitionBoundaries().

vector< pair<unsigned int, unsigned int> > _bhex

Definition at line 37 of file Partition.H.

vector< pair<unsigned int,unsigned int> > _bnodes

Definition at line 33 of file Partition.H.

Referenced by populate_local_arrays().

vector< pair<unsigned int, unsigned int> > _bpris

Definition at line 41 of file Partition.H.

vector< pair<unsigned int, unsigned int> > _bpyr

Definition at line 39 of file Partition.H.

vector< pair<unsigned int,unsigned int> > _btets

Definition at line 35 of file Partition.H.

unsigned int _mypart

Definition at line 31 of file Partition.H.

Referenced by MyRank(), and PartitionBoundary().

unsigned int _nghex

Definition at line 38 of file Partition.H.

unsigned int _ngnodes

Definition at line 34 of file Partition.H.

Referenced by PartitionBoundary(), and populate_local_arrays().

unsigned int _ngpris

Definition at line 42 of file Partition.H.

unsigned int _ngpyr

Definition at line 40 of file Partition.H.

unsigned int _ngtets

Definition at line 36 of file Partition.H.

unsigned int _rbid

Definition at line 32 of file Partition.H.

Referenced by PartitionBoundary().


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