本文整理汇总了C++中stk::mesh::BulkData::get_size_of_entity_index_space方法的典型用法代码示例。如果您正苦于以下问题:C++ BulkData::get_size_of_entity_index_space方法的具体用法?C++ BulkData::get_size_of_entity_index_space怎么用?C++ BulkData::get_size_of_entity_index_space使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stk::mesh::BulkData
的用法示例。
在下文中一共展示了BulkData::get_size_of_entity_index_space方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setup_mesh_indices
void setup_mesh_indices(const stk::mesh::BulkData& bulk, const stk::mesh::Selector& selector)
{
const stk::mesh::BucketVector& nodeBuckets = bulk.buckets(stk::topology::NODE_RANK);
meshIndices = DeviceViewMeshIndicesType("DMeshIndices", bulk.get_size_of_entity_index_space());
constMeshIndices = meshIndices;
hostMeshIndices = Kokkos::create_mirror_view(meshIndices);
for(unsigned bktIndex = 0; bktIndex < nodeBuckets.size(); ++bktIndex)
{
const stk::mesh::Bucket& bucket = *nodeBuckets[bktIndex];
for(unsigned nodeIndex = 0; nodeIndex < bucket.size(); ++nodeIndex)
{
stk::mesh::Entity node = bucket[nodeIndex];
stk::mesh::FastMeshIndex meshIndex(bucket.bucket_id(), nodeIndex);
hostMeshIndices(node.local_offset()) = meshIndex;
}
}
const stk::mesh::BucketVector& elemBuckets = bulk.get_buckets(stk::topology::ELEM_RANK, selector);
for(unsigned bktIndex = 0; bktIndex < elemBuckets.size(); ++bktIndex)
{
const stk::mesh::Bucket& bucket = *elemBuckets[bktIndex];
for(unsigned elemIndex = 0; elemIndex < bucket.size(); ++elemIndex)
{
stk::mesh::Entity elem = bucket[elemIndex];
stk::mesh::FastMeshIndex meshIndex(bucket.bucket_id(), elemIndex);
hostMeshIndices(elem.local_offset()) = meshIndex;
}
}
Kokkos::deep_copy(meshIndices, hostMeshIndices);
}