本文整理汇总了C++中stk::mesh::BulkData::generate_new_ids方法的典型用法代码示例。如果您正苦于以下问题:C++ BulkData::generate_new_ids方法的具体用法?C++ BulkData::generate_new_ids怎么用?C++ BulkData::generate_new_ids使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stk::mesh::BulkData
的用法示例。
在下文中一共展示了BulkData::generate_new_ids方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: intSizeAPI
PromotedElementIO::PromotedElementIO(
const ElementDescription& elem,
const stk::mesh::MetaData& metaData,
stk::mesh::BulkData& bulkData,
const stk::mesh::PartVector& baseParts,
const std::string& fileName,
const VectorFieldType& coordField
) : elem_(elem),
metaData_(metaData),
bulkData_(bulkData),
fileName_(fileName),
coordinates_(coordField),
nDim_(metaData.spatial_dimension())
{
Ioss::Init::Initializer init_db;
Ioss::PropertyManager properties;
Ioss::Property intSizeAPI("INTEGER_SIZE_API", 8);
properties.add(intSizeAPI);
Ioss::Property intSizeDB("INTEGER_SIZE_DB", 8);
properties.add(intSizeDB);
databaseIO = Ioss::IOFactory::create(
"exodus",
fileName_,
Ioss::WRITE_RESULTS,
bulkData_.parallel(),
properties
);
ThrowRequire(databaseIO != nullptr && databaseIO->ok(true));
output_ = make_unique<Ioss::Region>(databaseIO, "HighOrderOutput"); //sink for databaseIO
ThrowRequire(output_ != nullptr);
const stk::mesh::BucketVector& elem_buckets = bulkData_.get_buckets(
stk::topology::ELEM_RANK, stk::mesh::selectUnion(baseParts));
size_t numSubElems = num_sub_elements(nDim_, elem_buckets, elem_.polyOrder);
std::vector<stk::mesh::EntityId> subElemIds;
bulkData.generate_new_ids(stk::topology::ELEM_RANK, numSubElems, subElemIds);
ThrowRequire(subElemIds.size() == numSubElems);
superElemParts_ = super_elem_part_vector(baseParts);
ThrowRequireMsg(part_vector_is_valid_and_nonempty(superElemParts_),
"Not all element parts have a super-element mirror");
output_->begin_mode(Ioss::STATE_DEFINE_MODEL);
write_node_block_definitions(superElemParts_);
write_elem_block_definitions(superElemParts_);
write_sideset_definitions(baseParts);
output_->end_mode(Ioss::STATE_DEFINE_MODEL);
output_->begin_mode(Ioss::STATE_MODEL);
write_coordinate_list(superElemParts_);
write_element_connectivity(superElemParts_, subElemIds);
write_sideset_connectivity(baseParts);
output_->end_mode(Ioss::STATE_MODEL);
}