Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_STK_SculptMeshFactory.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 #include "elsa.h"
48 using Teuchos::RCP;
49 using Teuchos::rcp;
50 
51 
52 
53 namespace panzer_stk {
54 
56 {
58 }
59 
62 {
63 }
64 
66 Teuchos::RCP<STK_Interface> SculptMeshFactory::buildMesh(stk::ParallelMachine parallelMach) const
67 {
68  PANZER_FUNC_TIME_MONITOR("panzer::SculptMeshFactory::buildMesh()");
69 
70  RCP<STK_Interface> mesh = buildUncommitedMesh(parallelMach);
71 
72  // commit meta data
73  mesh->initialize(parallelMach);
74 
75  // build bulk data
76  completeMeshConstruction(*mesh,parallelMach);
77 
78  // wrtie exodus file
79  //mesh->writeToExodus("STKSculptMesh.exo");
80 
81  return mesh;
82 }
83 
85 {
86  PANZER_FUNC_TIME_MONITOR("panzer::SculptMeshFactory::buildUncomittedMesh()");
87 
88  RCP<STK_Interface> mesh = rcp(new STK_Interface(3));
89 
90  machRank_ = stk::parallel_machine_rank(parallelMach);
91  machSize_ = stk::parallel_machine_size(parallelMach);
92 
94 
95  //if( machRank_ == 0 )
96  {
97  // call Sculptor
98  char diatom_file[1000];
99  writeDiatomFile( stlFileDir_, stlFileName_, diatom_file );
100 
101  callSculptor( parallelMach, diatom_file );
102 
103  // build meta information: blocks and side set setups
104  buildMetaData(parallelMach,*mesh);
105 
106  mesh->addPeriodicBCs(periodicBCVec_);
107  mesh->setBoundingBoxSearchFlag(useBBoxSearch_);
108 
109  }
110 
111 // if( machRank_ == 0 )
112 // if(mesh->isWritable())
113 // mesh->writeToExodus("STKSculptMesh.exo");
114 
115 
116  return mesh;
117 }
118 
119 int SculptMeshFactory::writeDiatomFile( std::string stl_path, std::string stl_filename, char *diatom_file ) const
120 {
121 
122  strcpy( diatom_file, stl_path.c_str() );
123  strcat( diatom_file, "stl.diatom" );
124  FILE *fp = fopen( diatom_file, "w" );
125  if ( !fp )
126  {
127  printf( "ERROR: Unable to open %s for writing\n", diatom_file );
128  return 0;
129  }
130 
131  char stl_fullfile[1000];
132  strcpy( stl_fullfile, stl_path.c_str() );
133  strcat( stl_fullfile, stl_filename.c_str() );
134 
135  fprintf( fp, " diatom\n" );
136  fprintf( fp, " package \'box\'\n" );
137  fprintf( fp, " material 1\n" );
138  fprintf( fp, " insert stl\n" );
139  fprintf( fp, " FILE = \'%s\'\n", stl_fullfile );
140  fprintf( fp, " endinsert\n" );
141  fprintf( fp, " endpackage\n" );
142  fprintf( fp, " enddiatom\n" );
143  fclose( fp );
144 
145  return 1;
146 
147 }
148 int SculptMeshFactory::callSculptor(stk::ParallelMachine parallelMach, char *diatom_file_name ) const
149 {
150 
151  char * base_exodus_file_name = NULL;
152  char * base_vfrac_file_name = NULL;
153  int nelx, nely, nelz;
154 
155  nelx = xInterval_;
156  nely = yInterval_;
157  nelz = zInterval_;
158 
159  int mesh_void = 0;
160 
161  double gmin[3];
162  double gmax[3];
163 
164  gmin[0] = xMin_;
165  gmin[1] = yMin_;
166  gmin[2] = zMin_;
167  gmax[0] = xMax_;
168  gmax[1] = yMax_;
169  gmax[2] = zMax_;
170 
171  int stair = 0;
172  int smooth = 1;
173  int smooth_iterations = 7;
174 
175  int gen_sidesets = 4; //for stl based sidesets
176  int adaptive_grid = 0;
177  int adapt_level = 2;
178  int adapt_type = 0;
179 
180  printf("\n Sculpt BBox Min ( %lf, %lf, %lf )\n", xMin_, yMin_, zMin_ );
181  printf("\n Sculpt BBox Max ( %lf, %lf, %lf )\n", xMax_, yMax_, zMax_ );
182 
183  int cr_result = Create_Sculptor_Mesh(diatom_file_name,
184  base_exodus_file_name,
185  base_vfrac_file_name,
186  0, //vfac_input
187  machSize_, //comm.size(),
188  machRank_, //comm.rank(),
189  1,
190  nelx,
191  nely,
192  nelz,
193  gmin,
194  gmax,
195  stair,
196  smooth,
197  10,/*num_laplac_iters*/
198  0, // max opt iters
199  .4,/*opt_threshold*/
200  0, // max pcol iters
201  .4, // pcol threshold
202  mesh_void,
203  gen_sidesets,
204  adapt_type, /* adatptive type*/
205  adaptive_grid,/*adaptive_grid*/
206  adapt_level, /* adapt level */
207  0, // max deg iter
208  0.0,/*double htet_threshold*/
209  0,/*int pillow*/
210  0, // capture
211  0, //micro_expand
212  0, //align
213  0, //cell_size
214  NULL,/*char * quality_filename*/
215  NULL,/*char * comm_maps_file_name*/
216  0, // write geom
217  0/*int quiet 1 is quiet*/
218  );
219 
220 
221 
222  if (cr_result == 1){
223  if(machRank_ == 0)
224  printf("Error Generating Sculptor Mesh\n");
225  return 1;
226  }
227 
228  return 0;
229 }
230 
231 void SculptMeshFactory::completeMeshConstruction(STK_Interface & mesh,stk::ParallelMachine parallelMach) const
232 {
233  PANZER_FUNC_TIME_MONITOR("panzer::SculptMeshFactory::completeMeshConstruction()");
234 
235  if(not mesh.isInitialized())
236  mesh.initialize(parallelMach);
237 
238  buildElements(parallelMach,mesh);
239 
240  mesh.buildSubcells();
241  mesh.buildLocalElementIDs();
242  mesh.buildLocalEdgeIDs();
243  mesh.buildLocalFaceIDs();
244 
245  addSideSets(mesh);
246  addNodeSets(mesh);
247  addEdgeBlocks(mesh);
248  addFaceBlocks(mesh);
249 
250  this->rebalance(mesh);
251 }
252 
255 {
257 
258  setMyParamList(paramList);
259 
260  xInterval_ = paramList->get<int>("xInterval");
261  yInterval_ = paramList->get<int>("yInterval");
262  zInterval_ = paramList->get<int>("zInterval");
263 
264 
265  xMin_ = paramList->get<double>("xMin");
266  yMin_ = paramList->get<double>("yMin");
267  zMin_ = paramList->get<double>("zMin");
268 
269  xMax_ = paramList->get<double>("xMax");
270  yMax_ = paramList->get<double>("yMax");
271  zMax_ = paramList->get<double>("zMax");
272 
273  stlFileDir_ = paramList->get<std::string>("stlFileDir");
274  stlFileName_ = paramList->get<std::string>("stlFileName");
275 
276  // read in periodic boundary conditions
277  parsePeriodicBCList(Teuchos::rcpFromRef(paramList->sublist("Periodic BCs")),periodicBCVec_,useBBoxSearch_);
278 }
279 
282 {
283  static RCP<Teuchos::ParameterList> defaultParams;
284 
285  // fill with default values
286  if(defaultParams == Teuchos::null) {
287  defaultParams = rcp(new Teuchos::ParameterList);
288 
289  defaultParams->set<int>("xInterval",10);
290  defaultParams->set<int>("yInterval",10);
291  defaultParams->set<int>("zInterval",10);
292 
293  defaultParams->set<double>("xMin",0.0);
294  defaultParams->set<double>("yMin",0.0);
295  defaultParams->set<double>("zMin",0.0);
296 
297  defaultParams->set<double>("xMax",1.0);
298  defaultParams->set<double>("yMax",1.0);
299  defaultParams->set<double>("zMax",1.0);
300 
301  defaultParams->set<std::string>("stlFileDir", "NULL");
302  defaultParams->set<std::string>("stlFileName", "NULL");
303 
304  Teuchos::ParameterList & bcs = defaultParams->sublist("Periodic BCs");
305  bcs.set<int>("Count",0); // no default periodic boundary conditions
306  }
307 
308 
309  return defaultParams;
310 }
311 
313 {
314  // get valid parameters
316 
317  // set that parameter list
318  setParameterList(validParams);
319 
320 }
321 
322 void SculptMeshFactory::buildMetaData(stk::ParallelMachine parallelMach, STK_Interface & mesh) const
323 {
324  struct MeshStorageStruct *mss = get_sculpt_mesh();
325 
326  int nBlocks_ = mss->num_elem_blk;
327  int nSidesets_ = mss->num_side_sets;
328  int nNodesets_ = mss->num_node_sets;
329 
330 
331  typedef shards::Hexahedron<8> HexTopo;
332  const CellTopologyData * ctd = shards::getCellTopologyData<HexTopo>();
333  const CellTopologyData * side_ctd = shards::CellTopology(ctd).getBaseCellTopologyData(2,0);
334 
335  const CellTopologyData * edge_ctd = shards::CellTopology(ctd).getBaseCellTopologyData(1,0);
336  const CellTopologyData * face_ctd = shards::CellTopology(ctd).getBaseCellTopologyData(2,0);
337 
338 
339  // build meta data
340  //mesh.setDimension(3);
341  for( int b = 0; b < nBlocks_; b++){
342  std::stringstream ebPostfix;
343  ebPostfix << "-" << mss->block_id[b];
344  mesh.addElementBlock("eblock"+ebPostfix.str(),ctd);
345  }
346 
347 
348  // add sidesets
349  int side_set_id;
350  machRank_ = stk::parallel_machine_rank(parallelMach);
351  for(int ict = 0;ict < nSidesets_;ict ++){
352  std::stringstream sPostfix;
353  sPostfix << "-" << mss->side_set_id[ict];
354  mesh.addSideset("Sideset"+sPostfix.str(),side_ctd);
355  }
356 
357  // add nodesets
358  for(int nx=0;nx<nNodesets_;nx++) {
359  std::stringstream nPostfix;
360  nPostfix << "-" << nx;
361  mesh.addNodeset("Nodeset"+nPostfix.str());
362  }
363 
366 }
367 
368 void SculptMeshFactory::buildNodes( stk::ParallelMachine paralleMach, STK_Interface &mesh ) const
369 {
370  struct MeshStorageStruct *mss = get_sculpt_mesh();
371  int num_nodes = mss->num_nodes;
372 
373 
374  int dimensionality = 3;
375 
376  if (num_nodes){
377  int global_node_numbers;
378  for(int ict = 0; ict < num_nodes; ict ++){
379  global_node_numbers = mss->global_node_numbers[ict];
380  std::vector<double> coord(3, 0.0);
381  coord[0] = mss->coord[0*num_nodes+ict];
382  coord[1] = mss->coord[1*num_nodes+ict];
383  coord[2] = mss->coord[2*num_nodes+ict];
384  mesh.addNode(global_node_numbers, coord );
385 
386  //std::cout<<"Node "<<global_node_numbers<<": ( "<<coord[0]<<", "<<coord[1]<<", "<<coord[2]<<" )"<<std::endl;
387 
388  }
389  }
390 
391 
392 }
393 
394 void SculptMeshFactory::buildElements(stk::ParallelMachine parallelMach,STK_Interface & mesh) const
395 {
396  struct MeshStorageStruct *mss = get_sculpt_mesh();
397  int num_blocks = mss->num_elem_blk;
398 
399 
400  int *block_id = new int[num_blocks];
401  //char ** element_types = new std::string[num_blocks];
402  int *elements = new int[num_blocks];
403  int *nodes_per_element = new int[num_blocks];
404  int *element_attributes = new int[num_blocks];
405  int **elmt_node_linkage = new int*[num_blocks];
406 
407  for(int b = 0; b < num_blocks; b++){
408  block_id[b] = mss->block_id[b];
409  // element_types[b] = mss->element_types[b];
410  elements[b] = mss->elements[b];
411  nodes_per_element[b] = mss->nodes_per_element[b];
412  element_attributes[b] = mss->element_attributes[b];
413  }
414 
415 
416  int elm_start = 1;
417  mesh.beginModification();
418  // build each block
419  for(int ib=0;ib<num_blocks;ib++) {
420  buildBlock(parallelMach,mesh, ib, block_id, elm_start, elements, nodes_per_element, element_attributes, elmt_node_linkage );
421  elm_start += elements[ib];
422  }
423  mesh.endModification();
424 }
425 
426 void SculptMeshFactory::buildBlock(stk::ParallelMachine parallelMach,STK_Interface & mesh, int block_index, int *block_id, int elm_start, int *elements, int *nodes_per_element, int *elem_attributes, int **elmt_node_linkage ) const
427 {
428 
429  struct MeshStorageStruct *mss = get_sculpt_mesh();
430 
431  // add blocks
432  std::stringstream blockName;
433  blockName << "eblock-" << block_id[block_index];
434  stk::mesh::Part * block = mesh.getElementBlockPart(blockName.str());
435 
436 
437  buildNodes( parallelMach, mesh );
438 
439 
440  // read element block properties
441  //read element connectivity information into a temporary array
442  if(elements[block_index]) {
443  int maximum_nodes = elements[block_index] * nodes_per_element[block_index];
444  elmt_node_linkage[block_index] = new int[maximum_nodes];
445  for(int ict = 0;ict < elements[block_index]; ict ++){
446  std::vector<stk::mesh::EntityId> nodes(nodes_per_element[block_index]);
447  //std::cout<<"Element id = "<<elm_start+ ict<<std::endl;
448  //std::cout<<"Element global id = "<<mss->global_element_numbers[elm_start+ ict-1]<<std::endl;
449  for(int nct = 0; nct < nodes_per_element[block_index]; nct++){
450  elmt_node_linkage[block_index][(ict*nodes_per_element[block_index])+nct] = mss->elmt_node_linkage[block_index][(ict*nodes_per_element[block_index])+nct];
451  nodes[nct] = mss->global_node_numbers[elmt_node_linkage[block_index][(ict*nodes_per_element[block_index])+nct]-1];
452  //std::cout<<" Node linkage id = "<<elmt_node_linkage[block_index][(ict*nodes_per_element[block_index])+nct]<<std::endl;
453  //std::cout<<" Node global id = "<<nodes[nct]<<std::endl;
454  }
455 
456  stk::mesh::EntityId gid = mss->global_element_numbers[elm_start+ ict-1];
457  RCP<ElementDescriptor> ed = rcp(new ElementDescriptor(gid,nodes));
458  mesh.addElement(ed,block);
459  }
460  }
461  else {
462  elmt_node_linkage[block_index] = NULL;
463  }
464 }
465 
466 const stk::mesh::Relation * SculptMeshFactory::getRelationByID(unsigned ID,stk::mesh::PairIterRelation relations) const
467 {
468  for(std::size_t i=0;i<relations.size();i++)
469  if(relations[i].identifier()==ID)
470  return &relations[i];
471 
472  return 0;
473 }
474 
475 
476 
478 {
479  mesh.beginModification();
480 
481  struct MeshStorageStruct *mss = get_sculpt_mesh();
482  int num_side_sets = mss->num_side_sets;
483 
484  int *side_set_id = new int[num_side_sets];
485  int *num_elements_in_side_set = new int[num_side_sets];
486  int *num_nodes_in_side_set = new int[num_side_sets];
487  int *num_df_in_side_set = new int[num_side_sets];
488  int **side_set_elements = new int*[num_side_sets];
489  int **side_set_faces = new int*[num_side_sets];
490  //Element_Type **side_set_element_type = new Element_Type*[num_side_sets];
491  int **side_set_node_counter = new int*[num_side_sets];
492  int **side_set_nodes = new int*[num_side_sets];
493  double **side_set_df = new double*[num_side_sets];
494 
495  for(int ict = 0;ict < num_side_sets;ict ++){
496  side_set_id[ict] = mss->side_set_id[ict];
497  }
498 
499  for(int i = 0; i < num_side_sets; i++) {
500 
501  std::stringstream sidesetName;
502  sidesetName << "Sideset-" << mss->side_set_id[i];
503  stk::mesh::Part * sideset = mesh.getSideset(sidesetName.str());
504 
505 
506  num_elements_in_side_set[i] = mss->num_elements_in_side_set[i];
507  num_df_in_side_set[i] = mss->num_df_in_side_set[i];
508 
509  int ne = num_elements_in_side_set[i];
510  side_set_elements[i] = new int[ne];
511  side_set_faces[i] = new int[ne];
512  //side_set_element_type[i] = new Element_Type[ne];
513  side_set_node_counter[i] = new int[ne];
514  side_set_df[i] = new double[num_df_in_side_set[i]];
515 
516 
517  if(ne) {
518 
519  for(int nct = 0; nct < ne; nct ++){
520 
521  std::vector<stk::mesh::EntityId> nodes(4);
522 
523  int sculpt_elem_id = mss->global_element_numbers[ mss->side_set_elements[i][nct]-1 ];
524  int sculpt_face_id = -1 ;
525 
526  std::vector<stk::mesh::Entity> localElmts;
527  mesh.getMyElements(localElmts);
528 
529  std::vector<stk::mesh::Entity>::const_iterator itr;
530  for(itr=localElmts.begin();itr!=localElmts.end();++itr) {
531  stk::mesh::Entity element = (*itr);
532 
533  if( element->identifier() == sculpt_elem_id )
534  {
535  sculpt_face_id = mss->side_set_faces[i][nct];
536 
537  stk::mesh::EntityId gid = element->identifier();
538 
539  stk::mesh::PairIterRelation relations = element->relations(mesh.getSideRank());
540 
541  stk::mesh::Entity side = getRelationByID(sculpt_face_id-1,relations)->entity();
542 
543  if( side != NULL )
544  {
545  if(side->owner_rank()==machRank_)
546  mesh.addEntityToSideset(*side,sideset );
547  }
548  }
549  }
550 
551  if( sculpt_face_id == -1 )
552  printf(" ERROR: Could not find the element id for a sideset face \n");
553  }
554  }
555  }
556  mesh.endModification();
557 }
558 
560 {
561  mesh.beginModification();
562 
563  struct MeshStorageStruct *mss = get_sculpt_mesh();
564  int num_node_sets = mss->num_node_sets;
565 
566 
567  if (num_node_sets) {
568  int *node_set_id = new int[num_node_sets];
569  int *num_nodes_in_node_set = new int[num_node_sets];
570  int *num_df_in_node_set = new int[num_node_sets];
571  int **node_set_nodes = new int*[num_node_sets];
572  double **node_set_df = new double*[num_node_sets];
573 
574  for(int ict = 0; ict < num_node_sets; ict ++){
575  node_set_id[ict] = mss->node_set_id[ict];
576  num_nodes_in_node_set[ict] = mss->num_nodes_in_node_set[ict];
577  num_df_in_node_set[ict] = mss->num_df_in_node_set[ict];
578  }
579 
580  for(int i = 0; i < num_node_sets; i++) {
581  node_set_nodes[i] = new int[num_nodes_in_node_set[i]];
582  node_set_df[i] = NULL;
583  if(num_nodes_in_node_set[i]) {
584  for(int nct = 0; nct < num_nodes_in_node_set[i];nct ++){
585  node_set_nodes[i][nct] = mss->node_set_nodes[i][nct];
586  }
587  }
588  }
589 
590 
591  for(int i = 0; i < num_node_sets; i++) {
592 
593  std::stringstream nodesetName;
594  nodesetName << "Nodeset-" << mss->node_set_id[i];
595  stk::mesh::Part * nodeset = mesh.getNodeset(nodesetName.str());
596 
597  for( int j = 0; j < num_nodes_in_node_set[i]; j++ )
598  {
599  int node_id = node_set_nodes[i][j];
601  if(machRank_==0)
602  {
603  stk::mesh::Entity node = bulkData->get_entity(mesh.getNodeRank(),node_id);
604  mesh.addEntityToNodeset(*node, nodeset);
605  }
606  }
607  }
608 
609  }
610  mesh.endModification();
611 }
612 
613 void ScupltMeshFactory::addEdgeBlocks(STK_Interface & mesh) const
614 {
615  mesh.beginModification();
616 
617  stk::mesh::Part * edge_block = mesh.getEdgeBlock(panzer_stk::STK_Interface::edgeBlockString);
618 
621 
622  std::vector<stk::mesh::Entity> edges;
623  bulkData->get_entities(mesh.getEdgeRank(),metaData->locally_owned_part(),edges);
624  for(auto edge : edges) {
625  mesh.addEntityToEdgeBlock(edge, edge_block);
626  }
627 
628  mesh.endModification();
629 }
630 
631 void ScupltMeshFactory::addFaceBlocks(STK_Interface & mesh) const
632 {
633  mesh.beginModification();
634 
635  stk::mesh::Part * face_block = mesh.getFaceBlock(panzer_stk::STK_Interface::faceBlockString);
636 
637  Teuchos::RCP<stk::mesh::BulkData> bulkData = mesh.getBulkData();
638  Teuchos::RCP<stk::mesh::MetaData> metaData = mesh.getMetaData();
639 
640  std::vector<stk::mesh::Entity> faces;
641  bulkData->get_entities(mesh.getFaceRank(),metaData->locally_owned_part(),faces);
642  for(auto face : faces) {
643  mesh.addEntityToFaceBlock(face, face_block);
644  }
645 
646  mesh.endModification();
647 }
648 
651 {
652  std::size_t i=0,j=0;
653 
654  j = procRank/machSize_;
655  procRank = procRank % machSize_;
656  i = procRank;
657 
658  return Teuchos::tuple(i,j);
659 }
660 
661 } // end panzer_stk
void buildMetaData(stk::ParallelMachine parallelMach, STK_Interface &mesh) const
void addFaceBlocks(STK_Interface &mesh) const
void buildElements(stk::ParallelMachine parallelMach, STK_Interface &mesh) const
void addNodeset(const std::string &name)
int callSculptor(stk::ParallelMachine parallelMach, char *diatom_file) const
void addEntityToNodeset(stk::mesh::Entity entity, stk::mesh::Part *nodeset)
static void parsePeriodicBCList(const Teuchos::RCP< Teuchos::ParameterList > &pl, std::vector< Teuchos::RCP< const PeriodicBC_MatcherBase > > &periodicBC, bool &useBBoxSearch)
T & get(const std::string &name, T def_value)
stk::mesh::Part * getElementBlockPart(const std::string &name) const
get the block part
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
Teuchos::RCP< STK_Interface > buildMesh(stk::ParallelMachine parallelMach) const
Build the mesh object.
void addEntityToSideset(stk::mesh::Entity entity, stk::mesh::Part *sideset)
virtual void completeMeshConstruction(STK_Interface &mesh, stk::ParallelMachine parallelMach) const
stk::mesh::Part * getNodeset(const std::string &name) const
void addEdgeBlock(const std::string &elemBlockName, const std::string &edgeBlockName, const stk::topology &topology)
stk::mesh::Part * getSideset(const std::string &name) const
Teuchos::Tuple< std::size_t, 2 > procRankToProcTuple(std::size_t procRank) const
what is the 2D tuple describe this processor distribution
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 initialize(stk::ParallelMachine parallelMach, bool setupIO=true, const bool buildRefinementSupport=false)
void rebalance(STK_Interface &mesh) const
Teuchos::Tuple< std::size_t, 2 > procTuple_
Teuchos::RCP< stk::mesh::BulkData > getBulkData() const
void setMyParamList(const RCP< ParameterList > &paramList)
void validateParametersAndSetDefaults(ParameterList const &validParamList, int const depth=1000)
static const std::string edgeBlockString
void addNode(stk::mesh::EntityId gid, const std::vector< double > &coord)
void buildNodes(stk::ParallelMachine parallelMach, STK_Interface &mesh) const
void buildSubcells()
force the mesh to build subcells: edges and faces
const stk::mesh::Relation * getRelationByID(unsigned ID, stk::mesh::PairIterRelation edges) const
Teuchos::RCP< stk::mesh::MetaData > getMetaData() const
void addNodeSets(STK_Interface &mesh) const
bool isInitialized() const
Has initialize been called on this mesh object?
virtual Teuchos::RCP< STK_Interface > buildUncommitedMesh(stk::ParallelMachine parallelMach) const
void buildBlock(stk::ParallelMachine parallelMach, STK_Interface &mesh, int block_index, int *block_id, int elem_start, int *elements, int *nodes_per_elem, int *elem_attributes, int **elm_node_linkage) const
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
From ParameterListAcceptor.
void addSideset(const std::string &name, const CellTopologyData *ctData)
static const std::string faceBlockString
void addEntityToEdgeBlock(stk::mesh::Entity entity, stk::mesh::Part *edgeblock)
stk::mesh::Part * getEdgeBlock(const std::string &name) const
get the block part
std::vector< Teuchos::RCP< const PeriodicBC_MatcherBase > > periodicBCVec_
void setParameterList(const Teuchos::RCP< Teuchos::ParameterList > &paramList)
From ParameterListAcceptor.
stk::mesh::EntityRank getEdgeRank() const
int writeDiatomFile(std::string stl_path, std::string stl_filename, char *diatom_file) const
void addFaceBlock(const std::string &elemBlockName, const std::string &faceBlockName, const stk::topology &topology)
ParameterList & sublist(const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
void getMyElements(std::vector< stk::mesh::Entity > &elements) const
stk::mesh::EntityRank getNodeRank() const
void addEdgeBlocks(STK_Interface &mesh) const
void addElementBlock(const std::string &name, const CellTopologyData *ctData)
void addSideSets(STK_Interface &mesh) const