本文整理汇总了C++中STK_Interface::addNodeset方法的典型用法代码示例。如果您正苦于以下问题:C++ STK_Interface::addNodeset方法的具体用法?C++ STK_Interface::addNodeset怎么用?C++ STK_Interface::addNodeset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类STK_Interface
的用法示例。
在下文中一共展示了STK_Interface::addNodeset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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());
}
}
示例2: registerNodesets
void STK_ExodusReaderFactory::registerNodesets(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 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.getNodeRank() && ct==0) {
// only add subset parts that have no topology
if(part->name()!=STK_Interface::nodesString)
mesh.addNodeset(part->name());
}
}
}