Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_STK_CubeTetMeshFactory.cpp
Go to the documentation of this file.
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Panzer: A partial differential equation assembly
5 // engine for strongly coupled complex multiphysics systems
6 // Copyright (2011) Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact Roger P. Pawlowski (rppawlo@sandia.gov) and
39 // Eric C. Cyr (eccyr@sandia.gov)
40 // ***********************************************************************
41 // @HEADER
42 
44 #include <Teuchos_TimeMonitor.hpp>
45 #include <PanzerAdaptersSTK_config.hpp>
46 
47 using Teuchos::RCP;
48 using Teuchos::rcp;
49 
50 namespace panzer_stk {
51 
53 {
55 }
56 
59 {
60 }
61 
63 Teuchos::RCP<STK_Interface> CubeTetMeshFactory::buildMesh(stk::ParallelMachine parallelMach) const
64 {
65  PANZER_FUNC_TIME_MONITOR("panzer::CubeTetMeshFactory::buildMesh()");
66 
67  // build all meta data
68  RCP<STK_Interface> mesh = buildUncommitedMesh(parallelMach);
69 
70  // commit meta data
71  mesh->initialize(parallelMach);
72 
73  // build bulk data
74  completeMeshConstruction(*mesh,parallelMach);
75 
76  return mesh;
77 }
78 
80 {
81  PANZER_FUNC_TIME_MONITOR("panzer::CubeTetMeshFactory::buildUncomittedMesh()");
82 
83  RCP<STK_Interface> mesh = rcp(new STK_Interface(3));
84 
85  machRank_ = stk::parallel_machine_rank(parallelMach);
86  machSize_ = stk::parallel_machine_size(parallelMach);
87 
88  if (xProcs_ == -1 && yProcs_ == -1 && zProcs_ == -1) {
89  // copied from galeri
90  xProcs_ = yProcs_ = zProcs_ = Teuchos::as<int>(pow(Teuchos::as<double>(machSize_), 0.333334));
91 
92  if (xProcs_ * yProcs_ * zProcs_ != Teuchos::as<int>(machSize_)) {
93  // Simple method to find a set of processor assignments
94  xProcs_ = yProcs_ = zProcs_ = 1;
95 
96  // This means that this works correctly up to about maxFactor^3
97  // processors.
98  const int maxFactor = 50;
99 
100  int ProcTemp = machSize_;
101  int factors[maxFactor];
102  for (int jj = 0; jj < maxFactor; jj++) factors[jj] = 0;
103  for (int jj = 2; jj < maxFactor; jj++) {
104  bool flag = true;
105  while (flag) {
106  int temp = ProcTemp/jj;
107  if (temp*jj == ProcTemp) {
108  factors[jj]++;
109  ProcTemp = temp;
110 
111  } else {
112  flag = false;
113  }
114  }
115  }
116  xProcs_ = ProcTemp;
117  for (int jj = maxFactor-1; jj > 0; jj--) {
118  while (factors[jj] != 0) {
119  if ((xProcs_ <= yProcs_) && (xProcs_ <= zProcs_)) xProcs_ = xProcs_*jj;
120  else if ((yProcs_ <= xProcs_) && (yProcs_ <= zProcs_)) yProcs_ = yProcs_*jj;
121  else zProcs_ = zProcs_*jj;
122  factors[jj]--;
123  }
124  }
125  }
126 
127  } else if(xProcs_==-1) {
128  // default x only decomposition
129  xProcs_ = machSize_;
130  yProcs_ = 1;
131  zProcs_ = 1;
132  }
134  "Cannot build CubeTetMeshFactory, the product of \"X Procs\", \"Y Procs\", and \"Z Procs\""
135  " must equal the number of processors.");
137 
138  // build meta information: blocks and side set setups
139  buildMetaData(parallelMach,*mesh);
140 
141  mesh->addPeriodicBCs(periodicBCVec_);
142 
143  return mesh;
144 }
145 
146 void CubeTetMeshFactory::completeMeshConstruction(STK_Interface & mesh,stk::ParallelMachine parallelMach) const
147 {
148  PANZER_FUNC_TIME_MONITOR("panzer::CubeTetMeshFactory::completeMeshConstruction()");
149 
150  if(not mesh.isInitialized())
151  mesh.initialize(parallelMach);
152 
153  // add node and element information
154  buildElements(parallelMach,mesh);
155 
156  // finish up the edges and faces
157  mesh.buildSubcells();
158  mesh.buildLocalElementIDs();
159 
160  // now that edges are built, sidets can be added
161  addSideSets(mesh);
162  addNodeSets(mesh);
163 
164  // calls Stk_MeshFactory::rebalance
165  this->rebalance(mesh);
166 }
167 
170 {
172 
173  setMyParamList(paramList);
174 
175  x0_ = paramList->get<double>("X0");
176  y0_ = paramList->get<double>("Y0");
177  z0_ = paramList->get<double>("Z0");
178 
179  xf_ = paramList->get<double>("Xf");
180  yf_ = paramList->get<double>("Yf");
181  zf_ = paramList->get<double>("Zf");
182 
183  xBlocks_ = paramList->get<int>("X Blocks");
184  yBlocks_ = paramList->get<int>("Y Blocks");
185  zBlocks_ = paramList->get<int>("Z Blocks");
186 
187  xProcs_ = paramList->get<int>("X Procs");
188  yProcs_ = paramList->get<int>("Y Procs");
189  zProcs_ = paramList->get<int>("Z Procs");
190 
191  nXElems_ = paramList->get<int>("X Elements");
192  nYElems_ = paramList->get<int>("Y Elements");
193  nZElems_ = paramList->get<int>("Z Elements");
194 
195  // read in periodic boundary conditions
196  parsePeriodicBCList(Teuchos::rcpFromRef(paramList->sublist("Periodic BCs")),periodicBCVec_);
197 }
198 
201 {
202  static RCP<Teuchos::ParameterList> defaultParams;
203 
204  // fill with default values
205  if(defaultParams == Teuchos::null) {
206  defaultParams = rcp(new Teuchos::ParameterList);
207 
208  defaultParams->set<double>("X0",0.0);
209  defaultParams->set<double>("Y0",0.0);
210  defaultParams->set<double>("Z0",0.0);
211 
212  defaultParams->set<double>("Xf",1.0);
213  defaultParams->set<double>("Yf",1.0);
214  defaultParams->set<double>("Zf",1.0);
215 
216  defaultParams->set<int>("X Blocks",1);
217  defaultParams->set<int>("Y Blocks",1);
218  defaultParams->set<int>("Z Blocks",1);
219 
220  defaultParams->set<int>("X Procs",-1);
221  defaultParams->set<int>("Y Procs",1);
222  defaultParams->set<int>("Z Procs",1);
223 
224  defaultParams->set<int>("X Elements",5);
225  defaultParams->set<int>("Y Elements",5);
226  defaultParams->set<int>("Z Elements",5);
227 
228  Teuchos::ParameterList & bcs = defaultParams->sublist("Periodic BCs");
229  bcs.set<int>("Count",0); // no default periodic boundary conditions
230  }
231 
232  return defaultParams;
233 }
234 
236 {
237  // get valid parameters
239 
240  // set that parameter list
241  setParameterList(validParams);
242 }
243 
244 void CubeTetMeshFactory::buildMetaData(stk::ParallelMachine /* parallelMach */, STK_Interface & mesh) const
245 {
246  typedef shards::Tetrahedron<4> TetTopo;
247  const CellTopologyData * ctd = shards::getCellTopologyData<TetTopo>();
248  const CellTopologyData * side_ctd = shards::CellTopology(ctd).getBaseCellTopologyData(2,0);
249 
250  // build meta data
251  //mesh.setDimension(2);
252  for(int bx=0;bx<xBlocks_;bx++) {
253  for(int by=0;by<yBlocks_;by++) {
254  for(int bz=0;bz<zBlocks_;bz++) {
255 
256  std::stringstream ebPostfix;
257  ebPostfix << "-" << bx << "_" << by << "_" << bz;
258 
259  // add element blocks
260  mesh.addElementBlock("eblock"+ebPostfix.str(),ctd);
261  }
262  }
263  }
264 
265  // add sidesets
266  mesh.addSideset("left",side_ctd);
267  mesh.addSideset("right",side_ctd);
268  mesh.addSideset("top",side_ctd);
269  mesh.addSideset("bottom",side_ctd);
270  mesh.addSideset("front",side_ctd);
271  mesh.addSideset("back",side_ctd);
272 
273  mesh.addNodeset("origin");
274 }
275 
276 void CubeTetMeshFactory::buildElements(stk::ParallelMachine parallelMach,STK_Interface & mesh) const
277 {
278  mesh.beginModification();
279  // build each block
280  for(int xBlock=0;xBlock<xBlocks_;xBlock++) {
281  for(int yBlock=0;yBlock<yBlocks_;yBlock++) {
282  for(int zBlock=0;zBlock<zBlocks_;zBlock++) {
283  buildBlock(parallelMach,xBlock,yBlock,zBlock,mesh);
284  }
285  }
286  }
287  mesh.endModification();
288 }
289 
290 void CubeTetMeshFactory::buildBlock(stk::ParallelMachine /* parallelMach */,int xBlock,int yBlock,int zBlock,STK_Interface & mesh) const
291 {
292  // grab this processors rank and machine size
293  std::pair<int,int> sizeAndStartX = determineXElemSizeAndStart(xBlock,xProcs_,machRank_);
294  std::pair<int,int> sizeAndStartY = determineYElemSizeAndStart(yBlock,yProcs_,machRank_);
295  std::pair<int,int> sizeAndStartZ = determineZElemSizeAndStart(zBlock,zProcs_,machRank_);
296 
297  int myXElems_start = sizeAndStartX.first;
298  int myXElems_end = myXElems_start+sizeAndStartX.second;
299  int myYElems_start = sizeAndStartY.first;
300  int myYElems_end = myYElems_start+sizeAndStartY.second;
301  int myZElems_start = sizeAndStartZ.first;
302  int myZElems_end = myZElems_start+sizeAndStartZ.second;
303 
304  int totalXElems = nXElems_*xBlocks_;
305  int totalYElems = nYElems_*yBlocks_;
306  int totalZElems = nZElems_*zBlocks_;
307 
308  double deltaX = (xf_-x0_)/double(totalXElems);
309  double deltaY = (yf_-y0_)/double(totalYElems);
310  double deltaZ = (zf_-z0_)/double(totalZElems);
311 
312  std::vector<double> coord(3,0.0);
313 
314  // build the nodes
315  for(int nx=myXElems_start;nx<myXElems_end+1;++nx) {
316  coord[0] = double(nx)*deltaX+x0_;
317  for(int ny=myYElems_start;ny<myYElems_end+1;++ny) {
318  coord[1] = double(ny)*deltaY+y0_;
319  for(int nz=myZElems_start;nz<myZElems_end+1;++nz) {
320  coord[2] = double(nz)*deltaZ+z0_;
321 
322  mesh.addNode(nz*(totalYElems+1)*(totalXElems+1)+ny*(totalXElems+1)+nx+1,coord);
323  }
324  }
325  }
326 
327  std::stringstream blockName;
328  blockName << "eblock-" << xBlock << "_" << yBlock << "_" << zBlock;
329  stk::mesh::Part * block = mesh.getElementBlockPart(blockName.str());
330 
331  // build the elements
332  for(int nx=myXElems_start;nx<myXElems_end;++nx) {
333  for(int ny=myYElems_start;ny<myYElems_end;++ny) {
334  for(int nz=myZElems_start;nz<myZElems_end;++nz) {
335 
336  std::vector<stk::mesh::EntityId> nodes(8);
337  nodes[0] = nx+1+ny*(totalXElems+1) +nz*(totalYElems+1)*(totalXElems+1);
338  nodes[1] = nodes[0]+1;
339  nodes[2] = nodes[1]+(totalXElems+1);
340  nodes[3] = nodes[2]-1;
341  nodes[4] = nodes[0]+(totalYElems+1)*(totalXElems+1);
342  nodes[5] = nodes[1]+(totalYElems+1)*(totalXElems+1);
343  nodes[6] = nodes[2]+(totalYElems+1)*(totalXElems+1);
344  nodes[7] = nodes[3]+(totalYElems+1)*(totalXElems+1);
345 
346  buildTetsOnHex(Teuchos::tuple(totalXElems,totalYElems,totalZElems),
347  Teuchos::tuple(nx,ny,nz),
348  block,nodes,mesh);
349  }
350  }
351  }
352 }
353 
355  const Teuchos::Tuple<int,3> & element,
356  stk::mesh::Part * block,
357  const std::vector<stk::mesh::EntityId> & h_nodes,
358  STK_Interface & mesh) const
359 {
360  Teuchos::FancyOStream out(Teuchos::rcpFromRef(std::cout));
361  out.setShowProcRank(true);
362  out.setOutputToRootOnly(-1);
363 
364  int totalXElems = meshDesc[0]; int totalYElems = meshDesc[1]; int totalZElems = meshDesc[2];
365  int nx = element[0]; int ny = element[1]; int nz = element[2];
366 
367  stk::mesh::EntityId hex_id = totalXElems*totalYElems*nz+totalXElems*ny+nx+1;
368  stk::mesh::EntityId gid_0 = 12*(hex_id-1)+1;
369  std::vector<stk::mesh::EntityId> nodes(4);
370 
371  // add centroid node
372  stk::mesh::EntityId centroid = 0;
373  {
374  stk::mesh::EntityId largestNode = (totalXElems+1)*(totalYElems+1)*(totalZElems+1);
375  centroid = hex_id+largestNode;
376 
377  // compute average of coordinates
378  std::vector<double> coord(3,0.0);
379  for(std::size_t i=0;i<h_nodes.size();i++) {
380  const double * node_coord = mesh.getNodeCoordinates(h_nodes[i]);
381  coord[0] += node_coord[0];
382  coord[1] += node_coord[1];
383  coord[2] += node_coord[2];
384  }
385  coord[0] /= 8.0;
386  coord[1] /= 8.0;
387  coord[2] /= 8.0;
388 
389  mesh.addNode(centroid,coord);
390  }
391 
392  //
393  int idSet[][3] = { { 0, 1, 2}, // back
394  { 0, 2, 3},
395  { 0, 5, 1}, // bottom
396  { 0, 4, 5},
397  { 0, 7, 4}, // left
398  { 0, 3, 7},
399  { 6, 1, 5}, // right
400  { 6, 2, 1},
401  { 6, 3, 2}, // top
402  { 6, 7, 3},
403  { 6, 4, 7}, // front
404  { 6, 5, 4} };
405 
406  for(int i=0;i<12;i++) {
407  nodes[0] = h_nodes[idSet[i][0]];
408  nodes[1] = h_nodes[idSet[i][1]];
409  nodes[2] = h_nodes[idSet[i][2]];
410  nodes[3] = centroid;
411 
412  // add element to mesh
413  mesh.addElement(rcp(new ElementDescriptor(gid_0+i,nodes)),block);
414  }
415 }
416 
417 std::pair<int,int> CubeTetMeshFactory::determineXElemSizeAndStart(int xBlock,unsigned int size,unsigned int /* rank */) const
418 {
419  std::size_t xProcLoc = procTuple_[0];
420  unsigned int minElements = nXElems_/size;
421  unsigned int extra = nXElems_ - minElements*size;
422 
423  TEUCHOS_ASSERT(minElements>0);
424 
425  // first "extra" elements get an extra column of elements
426  // this determines the starting X index and number of elements
427  int nume=0, start=0;
428  if(xProcLoc<extra) {
429  nume = minElements+1;
430  start = xProcLoc*(minElements+1);
431  }
432  else {
433  nume = minElements;
434  start = extra*(minElements+1)+(xProcLoc-extra)*minElements;
435  }
436 
437  return std::make_pair(start+nXElems_*xBlock,nume);
438 }
439 
440 std::pair<int,int> CubeTetMeshFactory::determineYElemSizeAndStart(int yBlock,unsigned int size,unsigned int /* rank */) const
441 {
442  // int start = yBlock*nYElems_;
443  // return std::make_pair(start,nYElems_);
444 
445  std::size_t yProcLoc = procTuple_[1];
446  unsigned int minElements = nYElems_/size;
447  unsigned int extra = nYElems_ - minElements*size;
448 
449  TEUCHOS_ASSERT(minElements>0);
450 
451  // first "extra" elements get an extra column of elements
452  // this determines the starting X index and number of elements
453  int nume=0, start=0;
454  if(yProcLoc<extra) {
455  nume = minElements+1;
456  start = yProcLoc*(minElements+1);
457  }
458  else {
459  nume = minElements;
460  start = extra*(minElements+1)+(yProcLoc-extra)*minElements;
461  }
462 
463  return std::make_pair(start+nYElems_*yBlock,nume);
464 }
465 
466 std::pair<int,int> CubeTetMeshFactory::determineZElemSizeAndStart(int zBlock,unsigned int size,unsigned int /* rank */) const
467 {
468  // int start = zBlock*nZElems_;
469  // return std::make_pair(start,nZElems_);
470  std::size_t zProcLoc = procTuple_[2];
471  unsigned int minElements = nZElems_/size;
472  unsigned int extra = nZElems_ - minElements*size;
473 
474  TEUCHOS_ASSERT(minElements>0);
475 
476  // first "extra" elements get an extra column of elements
477  // this determines the starting X index and number of elements
478  int nume=0, start=0;
479  if(zProcLoc<extra) {
480  nume = minElements+1;
481  start = zProcLoc*(minElements+1);
482  }
483  else {
484  nume = minElements;
485  start = extra*(minElements+1)+(zProcLoc-extra)*minElements;
486  }
487 
488  return std::make_pair(start+nZElems_*zBlock,nume);
489 }
490 
492 {
493  mesh.beginModification();
494  const stk::mesh::EntityRank side_rank = mesh.getSideRank();
495 
496  std::size_t totalXElems = nXElems_*xBlocks_;
497  std::size_t totalYElems = nYElems_*yBlocks_;
498  std::size_t totalZElems = nZElems_*zBlocks_;
499 
500  // get all part vectors
501  stk::mesh::Part * left = mesh.getSideset("left");
502  stk::mesh::Part * right = mesh.getSideset("right");
503  stk::mesh::Part * top = mesh.getSideset("top");
504  stk::mesh::Part * bottom = mesh.getSideset("bottom");
505  stk::mesh::Part * front = mesh.getSideset("front");
506  stk::mesh::Part * back = mesh.getSideset("back");
507 
508  std::vector<stk::mesh::Entity> localElmts;
509  mesh.getMyElements(localElmts);
510 
511  // gid = totalXElems*totalYElems*nz+totalXElems*ny+nx+1
512 
513  // loop over elements adding sides to sidesets
514  std::vector<stk::mesh::Entity>::const_iterator itr;
515  for(itr=localElmts.begin();itr!=localElmts.end();++itr) {
516  stk::mesh::Entity element = (*itr);
517  stk::mesh::EntityId gid = mesh.elementGlobalId(element);
518 
519  // get hex global id
520  stk::mesh::EntityId h_gid = (gid-1)/12+1;
521  stk::mesh::EntityId t_offset = gid - (12*(h_gid-1)+1);
522 
523  std::size_t nx,ny,nz;
524  nz = (h_gid-1) / (totalXElems*totalYElems);
525  h_gid = (h_gid-1)-nz*(totalXElems*totalYElems);
526  ny = h_gid / totalXElems;
527  nx = h_gid-ny*totalXElems;
528 
529  if(nz==0 && (t_offset==0 || t_offset==1)) {
530  stk::mesh::Entity side = mesh.findConnectivityById(element, side_rank, 3);
531 
532  // on the back
533  if(mesh.entityOwnerRank(side)==machRank_)
534  mesh.addEntityToSideset(side,back);
535  }
536  if(nz+1==totalZElems && (t_offset==10 || t_offset==11)) {
537  stk::mesh::Entity side = mesh.findConnectivityById(element, side_rank, 3);
538 
539  // on the front
540  if(mesh.entityOwnerRank(side)==machRank_)
541  mesh.addEntityToSideset(side,front);
542  }
543 
544  if(ny==0 && (t_offset==2 || t_offset==3)) {
545  stk::mesh::Entity side = mesh.findConnectivityById(element, side_rank, 3);
546 
547  // on the bottom
548  if(mesh.entityOwnerRank(side)==machRank_)
549  mesh.addEntityToSideset(side,bottom);
550  }
551  if(ny+1==totalYElems && (t_offset==8 || t_offset==9)) {
552  stk::mesh::Entity side = mesh.findConnectivityById(element, side_rank, 3);
553 
554  // on the top
555  if(mesh.entityOwnerRank(side)==machRank_)
556  mesh.addEntityToSideset(side,top);
557  }
558 
559  if(nx==0 && (t_offset==4 || t_offset==5)) {
560  stk::mesh::Entity side = mesh.findConnectivityById(element, side_rank, 3);
561 
562  // on the left
563  if(mesh.entityOwnerRank(side)==machRank_)
564  mesh.addEntityToSideset(side,left);
565  }
566  if(nx+1==totalXElems && (t_offset==6 || t_offset==7)) {
567  stk::mesh::Entity side = mesh.findConnectivityById(element, side_rank, 3);
568 
569  // on the right
570  if(mesh.entityOwnerRank(side)==machRank_)
571  mesh.addEntityToSideset(side,right);
572  }
573  }
574 
575  mesh.endModification();
576 }
577 
579 {
580  mesh.beginModification();
581 
582  // get all part vectors
583  stk::mesh::Part * origin = mesh.getNodeset("origin");
584 
586  if(machRank_==0)
587  {
588  // add zero node to origin node set
589  stk::mesh::Entity node = bulkData->get_entity(mesh.getNodeRank(),1);
590  mesh.addEntityToNodeset(node,origin);
591  }
592 
593  mesh.endModification();
594 }
595 
598 {
599  std::size_t i=0,j=0,k=0;
600 
601  k = procRank/(xProcs_*yProcs_); procRank = procRank % (xProcs_*yProcs_);
602  j = procRank/xProcs_; procRank = procRank % xProcs_;
603  i = procRank;
604 
605  return Teuchos::tuple(i,j,k);
606 }
607 
608 } // end panzer_stk
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
From ParameterListAcceptor.
std::pair< int, int > determineYElemSizeAndStart(int yBlock, unsigned int size, unsigned int rank) const
void addNodeset(const std::string &name)
unsigned entityOwnerRank(stk::mesh::Entity entity) const
void addEntityToNodeset(stk::mesh::Entity entity, stk::mesh::Part *nodeset)
basic_FancyOStream & setShowProcRank(const bool showProcRank)
T & get(const std::string &name, T def_value)
Teuchos::RCP< STK_Interface > buildMesh(stk::ParallelMachine parallelMach) const
Build the mesh object.
stk::mesh::Part * getElementBlockPart(const std::string &name) const
get the block count
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void addEntityToSideset(stk::mesh::Entity entity, stk::mesh::Part *sideset)
std::pair< int, int > determineZElemSizeAndStart(int zBlock, unsigned int size, unsigned int rank) const
stk::mesh::Part * getNodeset(const std::string &name) const
void initialize(stk::ParallelMachine parallelMach, bool setupIO=true)
const double * getNodeCoordinates(stk::mesh::EntityId nodeId) const
stk::mesh::Part * getSideset(const std::string &name) const
virtual Teuchos::RCP< STK_Interface > buildUncommitedMesh(stk::ParallelMachine parallelMach) const
void buildElements(stk::ParallelMachine parallelMach, STK_Interface &mesh) const
void addSideSets(STK_Interface &mesh) const
void addElement(const Teuchos::RCP< ElementDescriptor > &ed, stk::mesh::Part *block)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
stk::mesh::EntityRank getSideRank() const
void rebalance(STK_Interface &mesh) const
void buildBlock(stk::ParallelMachine machRank, int xBlock, int yBlock, int zBlock, STK_Interface &mesh) const
Teuchos::RCP< stk::mesh::BulkData > getBulkData() const
stk::mesh::EntityId elementGlobalId(std::size_t lid) const
void setMyParamList(const RCP< ParameterList > &paramList)
void validateParametersAndSetDefaults(ParameterList const &validParamList, int const depth=1000)
basic_FancyOStream & setOutputToRootOnly(const int rootRank)
void setParameterList(const Teuchos::RCP< Teuchos::ParameterList > &paramList)
From ParameterListAcceptor.
std::pair< int, int > determineXElemSizeAndStart(int xBlock, unsigned int size, unsigned int rank) const
void addNode(stk::mesh::EntityId gid, const std::vector< double > &coord)
void buildSubcells()
force the mesh to build subcells: edges and faces
bool isInitialized() const
Has initialize been called on this mesh object?
Teuchos::Tuple< std::size_t, 3 > procRankToProcTuple(std::size_t procRank) const
what is the 3D tuple describe this processor distribution
stk::mesh::Entity findConnectivityById(stk::mesh::Entity src, stk::mesh::EntityRank tgt_rank, unsigned rel_id) const
void addSideset(const std::string &name, const CellTopologyData *ctData)
void buildMetaData(stk::ParallelMachine parallelMach, STK_Interface &mesh) const
void buildTetsOnHex(const Teuchos::Tuple< int, 3 > &meshDesc, const Teuchos::Tuple< int, 3 > &element, stk::mesh::Part *block, const std::vector< stk::mesh::EntityId > &h_nodes, STK_Interface &mesh) const
std::vector< Teuchos::RCP< const PeriodicBC_MatcherBase > > periodicBCVec_
ParameterList & sublist(const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
void getMyElements(std::vector< stk::mesh::Entity > &elements) const
#define TEUCHOS_ASSERT(assertion_test)
stk::mesh::EntityRank getNodeRank() const
virtual void completeMeshConstruction(STK_Interface &mesh, stk::ParallelMachine parallelMach) const
Teuchos::Tuple< std::size_t, 3 > procTuple_
void addElementBlock(const std::string &name, const CellTopologyData *ctData)
void addNodeSets(STK_Interface &mesh) const
static void parsePeriodicBCList(const Teuchos::RCP< Teuchos::ParameterList > &pl, std::vector< Teuchos::RCP< const PeriodicBC_MatcherBase > > &periodicBC)