本文整理汇总了C++中STK_Interface::addElementBlock方法的典型用法代码示例。如果您正苦于以下问题:C++ STK_Interface::addElementBlock方法的具体用法?C++ STK_Interface::addElementBlock怎么用?C++ STK_Interface::addElementBlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类STK_Interface
的用法示例。
在下文中一共展示了STK_Interface::addElementBlock方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildMetaData
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);
}
示例2:
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);
}
示例3: registerElementBlocks
void STK_ExodusReaderFactory::registerElementBlocks(STK_Interface & mesh,stk::io::MeshData & meshData) const
{
using Teuchos::RCP;
RCP<stk::mesh::fem::FEMMetaData> femMetaData = mesh.getMetaData();
// here we use the Ioss interface because they don't add
// "bonus" element blocks and its easier to determine
// "real" element blocks versus STK-only blocks
const Ioss::ElementBlockContainer & elem_blocks = meshData.m_input_region->get_element_blocks();
for(Ioss::ElementBlockContainer::const_iterator itr=elem_blocks.begin();itr!=elem_blocks.end();++itr) {
Ioss::GroupingEntity * entity = *itr;
const std::string & name = entity->name();
const stk::mesh::Part * part = femMetaData->get_part(name);
const CellTopologyData * ct = femMetaData->get_cell_topology(*part).getCellTopologyData();
TEUCHOS_ASSERT(ct!=0);
mesh.addElementBlock(part->name(),ct);
}
}
示例4: buildMetaData
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());
}
}
示例5: buildMetaData
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);
}
示例6: buildMetaData
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);
}