void SquareQuadMeshFactory::buildMetaData(stk::ParallelMachine parallelMach, STK_Interface & mesh) const { typedef shards::Quadrilateral<4> QuadTopo; const CellTopologyData * ctd = shards::getCellTopologyData<QuadTopo>(); const CellTopologyData * side_ctd = shards::CellTopology(ctd).getBaseCellTopologyData(1,0); // build meta data //mesh.setDimension(2); for(int bx=0;bx<xBlocks_;bx++) { for(int by=0;by<yBlocks_;by++) { // add this element block { std::stringstream ebPostfix; ebPostfix << "-" << bx << "_" << by; // add element blocks mesh.addElementBlock("eblock"+ebPostfix.str(),ctd); } } } // add sidesets #ifndef ENABLE_UNIFORM mesh.addSideset("left",side_ctd); mesh.addSideset("right",side_ctd); mesh.addSideset("top",side_ctd); mesh.addSideset("bottom",side_ctd); #endif // add nodesets mesh.addNodeset("lower_left"); mesh.addNodeset("origin"); }
void CustomMeshFactory::buildMetaData(STK_Interface &mesh) const { typedef shards::Hexahedron<8> HexTopo; const CellTopologyData *ctd = shards::getCellTopologyData<HexTopo>(); const CellTopologyData *side_ctd = shards::CellTopology(ctd).getBaseCellTopologyData(2,0); for (int blk=0;blk<NumBlocks_;++blk) { std::stringstream block_id; block_id << "eblock-" << blk; // add element blocks mesh.addElementBlock(block_id.str(),ctd); mesh.addSolutionField("CHARGE_DENSITY",block_id.str()); mesh.addSolutionField("ELECTRIC_POTENTIAL",block_id.str()); } mesh.addSideset("left", side_ctd); mesh.addSideset("right", side_ctd); mesh.addSideset("top", side_ctd); mesh.addSideset("bottom",side_ctd); mesh.addSideset("front", side_ctd); mesh.addSideset("back", side_ctd); mesh.addSideset("wall", side_ctd); }
void STK_ExodusReaderFactory::registerSidesets(STK_Interface & mesh,stk::io::MeshData & meshData) const { using Teuchos::RCP; RCP<stk::mesh::fem::FEMMetaData> metaData = mesh.getMetaData(); const stk::mesh::PartVector & parts = metaData->get_parts(); stk::mesh::PartVector::const_iterator partItr; for(partItr=parts.begin();partItr!=parts.end();++partItr) { const stk::mesh::Part * part = *partItr; const stk::mesh::PartVector & subsets = part->subsets(); // const CellTopologyData * ct = stk::mesh::fem::get_cell_topology(*part).getCellTopologyData(); const CellTopologyData * ct = metaData->get_cell_topology(*part).getCellTopologyData(); // if a side part ==> this is a sideset: now storage is recursive // on part contains all sub parts with consistent topology if(part->primary_entity_rank()==mesh.getSideRank() && ct==0 && subsets.size()>0) { TEUCHOS_TEST_FOR_EXCEPTION(subsets.size()!=1,std::runtime_error, "STK_ExodusReaderFactory::registerSidesets error - part \"" << part->name() << "\" has more than one subset"); // grab cell topology and name of subset part const stk::mesh::Part * ss_part = subsets[0]; // const CellTopologyData * ss_ct = stk::mesh::fem::get_cell_topology(*ss_part).getCellTopologyData(); const CellTopologyData * ss_ct = metaData->get_cell_topology(*ss_part).getCellTopologyData(); // only add subset parts that have no topology if(ss_ct!=0) mesh.addSideset(part->name(),ss_ct); } } }
void CubeTetMeshFactory::buildMetaData(stk_classic::ParallelMachine parallelMach, STK_Interface & mesh) const { typedef shards::Tetrahedron<4> TetTopo; const CellTopologyData * ctd = shards::getCellTopologyData<TetTopo>(); const CellTopologyData * side_ctd = shards::CellTopology(ctd).getBaseCellTopologyData(2,0); // build meta data //mesh.setDimension(2); for(int bx=0;bx<xBlocks_;bx++) { for(int by=0;by<yBlocks_;by++) { for(int bz=0;bz<zBlocks_;bz++) { std::stringstream ebPostfix; ebPostfix << "-" << bx << "_" << by << "_" << bz; // add element blocks mesh.addElementBlock("eblock"+ebPostfix.str(),ctd); } } } // add sidesets mesh.addSideset("left",side_ctd); mesh.addSideset("right",side_ctd); mesh.addSideset("top",side_ctd); mesh.addSideset("bottom",side_ctd); mesh.addSideset("front",side_ctd); mesh.addSideset("back",side_ctd); }
void LineMeshFactory::buildMetaData(stk::ParallelMachine parallelMach, STK_Interface & mesh) const { typedef shards::Line<2> LineTopo; const CellTopologyData * ctd = shards::getCellTopologyData<LineTopo>(); const CellTopologyData * side_ctd = shards::CellTopology(ctd).getBaseCellTopologyData(0,0); // build meta data //mesh.setDimension(2); for(int bx=0;bx<xBlocks_;bx++) { // add this element block { std::stringstream ebPostfix; ebPostfix << "-" << bx; // add element blocks mesh.addElementBlock("eblock"+ebPostfix.str(),ctd); } } // add sidesets mesh.addSideset("left",side_ctd); mesh.addSideset("right",side_ctd); }
void MultiBlockMeshFactory::buildMetaData(stk::ParallelMachine parallelMach, STK_Interface & mesh) const { typedef shards::Quadrilateral<4> QuadTopo; const CellTopologyData * ctd = shards::getCellTopologyData<QuadTopo>(); const CellTopologyData * side_ctd = shards::CellTopology(ctd).getBaseCellTopologyData(1,0); // build meta data //mesh.setDimension(2); for(int bx=0;bx<2;bx++) { // add this element block std::stringstream ebPostfix; ebPostfix << "-" << "0_" << bx; // add element blocks mesh.addElementBlock("eblock"+ebPostfix.str(),ctd); } // add sidesets mesh.addSideset("left",side_ctd); mesh.addSideset("right",side_ctd); mesh.addSideset("top",side_ctd); mesh.addSideset("bottom",side_ctd); }
void SculptMeshFactory::buildMetaData(stk_classic::ParallelMachine parallelMach, STK_Interface & mesh) const { struct MeshStorageStruct *mss = get_sculpt_mesh(); int nBlocks_ = mss->num_elem_blk; int nSidesets_ = mss->num_side_sets; int nNodesets_ = mss->num_node_sets; typedef shards::Hexahedron<8> HexTopo; const CellTopologyData * ctd = shards::getCellTopologyData<HexTopo>(); const CellTopologyData * side_ctd = shards::CellTopology(ctd).getBaseCellTopologyData(2,0); // build meta data //mesh.setDimension(3); for( int b = 0; b < nBlocks_; b++){ std::stringstream ebPostfix; ebPostfix << "-" << mss->block_id[b]; mesh.addElementBlock("eblock"+ebPostfix.str(),ctd); } // add sidesets int side_set_id; machRank_ = stk_classic::parallel_machine_rank(parallelMach); for(int ict = 0;ict < nSidesets_;ict ++){ std::stringstream sPostfix; sPostfix << "-" << mss->side_set_id[ict]; mesh.addSideset("Sideset"+sPostfix.str(),side_ctd); } // add nodesets for(int nx=0;nx<nNodesets_;nx++) { std::stringstream nPostfix; nPostfix << "-" << nx; mesh.addNodeset("Nodeset"+nPostfix.str()); } }