Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TRAIL_GeoPart.H File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool TRAIL_GeoPartReadPatchASCII (GEM_DomainBoundary &db, std::ifstream &Inf)
 
bool TRAIL_GeoPartReadPatchesASCII (GEM_Partition &gp, std::ifstream &Inf)
 
bool TRAIL_GeoPartReadPartitionBoundaryASCII (GEM_Partition &gp, unsigned int pb_index, std::ifstream &Inf)
 
bool TRAIL_GeoPartReadPartitionBoundariesASCII (GEM_Partition &gp, std::ifstream &Inf)
 
bool TRAIL_GeoPartReadASCII (GEM_Partition &gp, std::ifstream &Inf)
 

Function Documentation

bool TRAIL_GeoPartReadASCII ( GEM_Partition gp,
std::ifstream &  Inf 
)

Definition at line 242 of file GeoPartFunctions.C.

References GEM_Partition::_hexconn, GEM_Partition::_nc, GEM_Partition::_nghex, GEM_Partition::_ngnodes, GEM_Partition::_ngpris, GEM_Partition::_ngpyr, GEM_Partition::_ngtet, GEM_Partition::_nvface, GEM_Partition::_pb, GEM_Partition::_prisconn, GEM_Partition::_pyrconn, GEM_Partition::_tetconn, TRAIL_GeoPartReadPartitionBoundariesASCII(), and TRAIL_GeoPartReadPatchesASCII().

Referenced by main().

243 {
244 
245  unsigned int nvfaces,nbfaces,nnodes;
246  Inf >> nvfaces >> nbfaces >> nnodes >> gp._ngnodes;
247  gp._nvface = nvfaces + nbfaces;
248  unsigned int node = 0;
249  gp._nc.resize(3*nnodes);
250  while(node < nnodes){
251  Inf >> gp._nc[3*node] >> gp._nc[3*node+1]
252  >> gp._nc[3*node+2];
253  node++;
254  }
255  unsigned int ntet = 0;
256  Inf >> ntet >> gp._ngtet;
257  unsigned int tet = 0;
258  gp._tetconn.resize(4*ntet);
259  while(tet < ntet){
260  Inf >> gp._tetconn[4*tet] >> gp._tetconn[4*tet+1]
261  >> gp._tetconn[4*tet+2] >> gp._tetconn[4*tet+3];
262  tet++;
263  }
264  unsigned int npyr = 0;
265  Inf >> npyr >> gp._ngpyr;
266  unsigned int pyr = 0;
267  gp._pyrconn.resize(5*npyr);
268  while(pyr < npyr){
269  Inf >> gp._pyrconn[5*pyr] >> gp._pyrconn[5*pyr+1]
270  >> gp._pyrconn[5*pyr+2] >> gp._pyrconn[5*pyr+3]
271  >> gp._pyrconn[5*pyr+4];
272  pyr++;
273  }
274 
275  unsigned int npris = 0;
276  Inf >> npris >> gp._ngpris;
277  unsigned int pris = 0;
278  gp._prisconn.resize(6*npris);
279  while(pris < npris){
280  Inf >> gp._prisconn[6*pris] >> gp._prisconn[6*pris+1]
281  >> gp._prisconn[6*pris+2] >> gp._prisconn[6*pris+3]
282  >> gp._prisconn[6*pris+4] >> gp._prisconn[6*pris+5];
283  pris++;
284  }
285 
286  unsigned int nhex = 0;
287  Inf >> nhex >> gp._nghex;
288  unsigned int hex = 0;
289  gp._hexconn.resize(8*nhex);
290  while(hex < nhex){
291  Inf >> gp._hexconn[8*hex] >> gp._hexconn[8*hex+1]
292  >> gp._hexconn[8*hex+2] >> gp._hexconn[8*hex+3]
293  >> gp._hexconn[8*hex+4] >> gp._hexconn[8*hex+5]
294  >> gp._hexconn[8*hex+6] >> gp._hexconn[8*hex+7];
295  hex++;
296  }
297 
298  // _nelem = _nhex + _ntet + _npyr + _npris;
299  unsigned int nbound = 0;
300  Inf >> nbound;
301  gp._pb.resize(nbound);
302  // Note: the gp._cell_ordering[] array should already be
303  // set up properly before these routines are called. To
304  // stay general, we require that this is done outside of
305  // this function
307  return(false);
308  if(!TRAIL_GeoPartReadPatchesASCII(gp,Inf))
309  return(false);
310  Inf.close();
311  return(true);
312 }
std::vector< unsigned int > _tetconn
Definition: GEM.H:295
Definition: adj.h:150
bool TRAIL_GeoPartReadPatchesASCII(GEM_Partition &gp, std::ifstream &Inf)
unsigned int _ngnodes
Definition: GEM.H:286
unsigned int _ngpris
Definition: GEM.H:290
unsigned int _nvface
Definition: GEM.H:291
bool TRAIL_GeoPartReadPartitionBoundariesASCII(GEM_Partition &gp, std::ifstream &Inf)
std::vector< unsigned int > _pyrconn
Definition: GEM.H:297
std::vector< unsigned int > _hexconn
Definition: GEM.H:301
std::vector< GEM_PartitionBoundary > _pb
Definition: GEM.H:304
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

Here is the call graph for this function:

Here is the caller graph for this function:

bool TRAIL_GeoPartReadPartitionBoundariesASCII ( GEM_Partition gp,
std::ifstream &  Inf 
)

Definition at line 231 of file GeoPartFunctions.C.

References GEM_Partition::_pb, and TRAIL_GeoPartReadPartitionBoundaryASCII().

Referenced by TRAIL_GeoPartReadASCII().

232 {
233  int nbound = gp._pb.size();
234  int bound = 0;
235  while(bound < nbound)
236  if(!TRAIL_GeoPartReadPartitionBoundaryASCII(gp,bound++,Inf))
237  return(false);
238  return(true);
239 }
bool TRAIL_GeoPartReadPartitionBoundaryASCII(GEM_Partition &gp, unsigned int pb_index, std::ifstream &Inf)
std::vector< GEM_PartitionBoundary > _pb
Definition: GEM.H:304

Here is the call graph for this function:

Here is the caller graph for this function:

bool TRAIL_GeoPartReadPartitionBoundaryASCII ( GEM_Partition gp,
unsigned int  pb_index,
std::ifstream &  Inf 
)

Definition at line 105 of file GeoPartFunctions.C.

References GEM_UserData::_int_data, GEM_Partition::_pb, GEM_PartitionBoundary::_recvcells, GEM_PartitionBoundary::_recvnodes, GEM_PartitionBoundary::_rpart, GEM_PartitionBoundary::_sendcells, GEM_PartitionBoundary::_sendnodes, GEM_PartitionBoundary::_sharenodes, GEM_Partition::_solver_data, and GEM_Partition::Elem2Cell().

Referenced by TRAIL_GeoPartReadPartitionBoundariesASCII().

108 {
109 
110  GEM_PartitionBoundary &pb = gp._pb[pb_index];
111  // Just read the nodes and elements from the list
112  int nnodes = 0;
113  int ngnodes = 0;
114  int nshared = 0;
115  int nsend = 0;
116  int nreal_nodes = 0;
117  int rbid = 0;
118  int dummy = 0;
119  Inf >> pb._rpart >> gp._solver_data._int_data[0][pb_index]
120  >> nnodes >> nshared >> ngnodes;
121  nreal_nodes = nnodes - ngnodes;
122  nsend = nreal_nodes - nshared;
123  pb._rpart += 1; // This converts to the required 1-based id's
124  pb._sendnodes.resize(nsend);
125  pb._sharenodes.resize(nshared);
126  pb._recvnodes.resize(ngnodes);
127 
128  int node = 0;
129  while(node < nsend)
130  Inf >> pb._sendnodes[node++] >> dummy;
131  node = 0;
132  while(node < nshared)
133  Inf >> pb._sharenodes[node++] >> dummy;
134  node = 0;
135  while(node < ngnodes)
136  Inf >> pb._recvnodes[node++] >> dummy;
137 
138 
139  unsigned int ncells_total = 0;
140  unsigned int nreal_cells = 0;
141  unsigned int nghost_cells = 0;
142 
143  unsigned int ntets = 0;
144  unsigned int ngtets = 0;
145  unsigned int nreal_tets = 0;
146  Inf >> ntets >> ngtets;
147  std::vector<unsigned int> btets;
148  btets.resize(ntets + ngtets);
149  unsigned int elem = 0;
150  while(elem < ntets)
151  Inf >> btets[elem++] >> dummy;
152  ncells_total += ntets;
153  nghost_cells += ngtets;
154  nreal_tets = ntets - ngtets;
155 
156  unsigned int npyrs = 0;
157  unsigned int ngpyrs = 0;
158  unsigned int nreal_pyrs = 0;
159  std::vector< unsigned int > bpyrs;
160  Inf >> npyrs >> ngpyrs;
161  bpyrs.resize(npyrs);
162  elem = 0;
163  while(elem < npyrs)
164  Inf >> bpyrs[elem++] >> dummy;
165  ncells_total += npyrs;
166  nghost_cells += ngpyrs;
167  nreal_pyrs = npyrs - ngpyrs;
168 
169  unsigned int npris = 0;
170  unsigned int ngpris = 0;
171  unsigned int nreal_pris = 0;
172  std::vector< unsigned int > bpris;
173  Inf >> npris >> ngpris;
174  bpris.resize(npris);
175  elem = 0;
176  while(elem < npris)
177  Inf >> bpris[elem++] >> dummy;
178  ncells_total += npris;
179  nghost_cells += ngpris;
180  nreal_pris = npris - ngpris;
181 
182  unsigned int nhexs = 0;
183  unsigned int nghexs = 0;
184  unsigned int nreal_hexs = 0;
185  std::vector< unsigned int > bhexs;
186  Inf >> nhexs >> nghexs;
187  bhexs.resize(nhexs);
188  elem = 0;
189  while(elem < nhexs)
190  Inf >> bhexs[elem++] >> dummy;
191  ncells_total += nhexs;
192  nghost_cells += nghexs;
193  nreal_hexs = nhexs - nghexs;
194 
195  nreal_cells = ncells_total - nghost_cells;
196  pb._recvcells.resize(nghost_cells);
197  pb._sendcells.resize(nreal_cells);
198 
199  elem = 0;
200  unsigned int send_cell = 0;
201  unsigned int recv_cell = 0;
202  while(elem < ntets)
203  if(elem < nreal_tets)
204  pb._sendcells[send_cell++] = gp.Elem2Cell(std::make_pair(1,btets[elem++]));
205  else
206  pb._recvcells[recv_cell++] = gp.Elem2Cell(std::make_pair(1,btets[elem++]));
207  elem = 0;
208  while(elem < npyrs)
209  if(elem < nreal_pyrs)
210  pb._sendcells[send_cell++] = gp.Elem2Cell(std::make_pair(2,bpyrs[elem++]));
211  else
212  pb._recvcells[recv_cell++] = gp.Elem2Cell(std::make_pair(2,bpyrs[elem++]));
213  elem = 0;
214  while(elem < npris)
215  if(elem < nreal_pris)
216  pb._sendcells[send_cell++] = gp.Elem2Cell(std::make_pair(3,bpris[elem++]));
217  else
218  pb._recvcells[recv_cell++] = gp.Elem2Cell(std::make_pair(3,bpris[elem++]));
219  elem = 0;
220  while(elem < nhexs)
221  if(elem < nreal_hexs)
222  pb._sendcells[send_cell++] = gp.Elem2Cell(std::make_pair(4,bhexs[elem++]));
223  else
224  pb._recvcells[recv_cell++] = gp.Elem2Cell(std::make_pair(4,bhexs[elem++]));
225 
226  assert(send_cell == nreal_cells && recv_cell == nghost_cells);
227  return(true);
228 }
std::vector< unsigned int > _recvnodes
Definition: GEM.H:230
std::vector< std::vector< int > > _int_data
Definition: GEM.H:100
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
unsigned int Elem2Cell(std::pair< unsigned int, unsigned int >)
Definition: GEM.C:956
std::vector< GEM_PartitionBoundary > _pb
Definition: GEM.H:304
GEM_UserData _solver_data
Definition: GEM.H:307
unsigned int _rpart
Definition: GEM.H:226

Here is the call graph for this function:

Here is the caller graph for this function:

bool TRAIL_GeoPartReadPatchASCII ( GEM_DomainBoundary db,
std::ifstream &  Inf 
)

Definition at line 49 of file GeoPartFunctions.C.

References GEM_DomainBoundary::_id, GEM_DomainBoundary::_ngquad, GEM_DomainBoundary::_ngtri, GEM_DomainBoundary::_quadconn, and GEM_DomainBoundary::_triconn.

Referenced by TRAIL_GeoPartReadPatchesASCII().

50 {
51  unsigned int nfaces = 0;
52  unsigned int ngfaces = 0;
53  db._ngtri = 0;
54  db._ngquad = 0;
55  Inf >> db._id >> nfaces >> ngfaces;
56  unsigned int nfaces_accum = 0;
57  nfaces_accum += nfaces;
58  db._ngtri = ngfaces;
59  if(db._id < 0)
60  db._id *= -1;
61  db._triconn.resize(3*nfaces);
62  unsigned int face = 0;
63  while(face < nfaces){
64  unsigned int node1,node2,node3;
65  Inf >> node1 >> node2 >> node3;
66  db._triconn[face*3] = node1;
67  db._triconn[face*3+1] = node2;
68  db._triconn[face*3+2] = node3;
69  face++;
70  }
71  Inf >> nfaces >> ngfaces;
72  nfaces_accum += nfaces;
73  db._ngquad = ngfaces;
74  db._quadconn.resize(4*nfaces);
75  face = 0;
76  while(face < nfaces){
77  unsigned int node1,node2,node3,node4;
78  Inf >> node1 >> node2 >> node3 >> node4;
79  db._quadconn[face*4] = (node1);
80  db._quadconn[face*4+1] = (node2);
81  db._quadconn[face*4+2] = (node3);
82  db._quadconn[face*4+3] = (node4);
83  face++;
84  }
85  return(true);
86 }
Definition: face.h:90
std::vector< unsigned int > _quadconn
Definition: GEM.H:132
unsigned int _id
Definition: GEM.H:127
std::vector< unsigned int > _triconn
Definition: GEM.H:131
unsigned int _ngquad
Definition: GEM.H:129
unsigned int _ngtri
Definition: GEM.H:128

Here is the caller graph for this function:

bool TRAIL_GeoPartReadPatchesASCII ( GEM_Partition gp,
std::ifstream &  Inf 
)

Definition at line 89 of file GeoPartFunctions.C.

References GEM_Partition::_db, and TRAIL_GeoPartReadPatchASCII().

Referenced by TRAIL_GeoPartReadASCII().

90 {
91  // map<unsigned int, unsigned int> patch_mapping;
92  // if(!build_patch_mapping(pre,patch_mapping))
93  // return false;
94  int nlocal_patches;
95  Inf >> nlocal_patches;
96  gp._db.resize(nlocal_patches);
97  int bound = 0;
98  while(bound < nlocal_patches)
99  if(!TRAIL_GeoPartReadPatchASCII(gp._db[bound++],Inf))
100  return(false);
101  return(true);
102 }
bool TRAIL_GeoPartReadPatchASCII(GEM_DomainBoundary &db, std::ifstream &Inf)
std::vector< GEM_DomainBoundary > _db
Definition: GEM.H:305

Here is the call graph for this function:

Here is the caller graph for this function: