本文整理汇总了C++中stk::mesh::BulkData::in_receive_ghost方法的典型用法代码示例。如果您正苦于以下问题:C++ BulkData::in_receive_ghost方法的具体用法?C++ BulkData::in_receive_ghost怎么用?C++ BulkData::in_receive_ghost使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stk::mesh::BulkData
的用法示例。
在下文中一共展示了BulkData::in_receive_ghost方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: find_ghosted_nodes_that_need_to_be_shared
void find_ghosted_nodes_that_need_to_be_shared(const stk::mesh::BulkData & bulk, stk::mesh::EntityVector& ghosted_nodes_that_are_now_shared)
{
stk::mesh::EntityRank endRank = static_cast<stk::mesh::EntityRank>(bulk.mesh_meta_data().entity_rank_count());
if (endRank >= stk::topology::END_RANK)
{
endRank = stk::topology::END_RANK;
}
for (stk::mesh::EntityRank rank=stk::topology::EDGE_RANK; rank<endRank; ++rank)
{
const stk::mesh::BucketVector& entity_buckets = bulk.buckets(rank);
for(size_t i=0; i<entity_buckets.size(); ++i)
{
const stk::mesh::Bucket& bucket = *entity_buckets[i];
if ( bucket.owned() )
{
for(size_t n=0; n<bucket.size(); ++n)
{
const stk::mesh::Entity * nodes = bulk.begin_nodes(bucket[n]);
unsigned num_nodes = bulk.num_nodes(bucket[n]);
for (unsigned j=0;j<num_nodes;++j)
{
if (bulk.in_receive_ghost(bulk.entity_key(nodes[j])))
{
ghosted_nodes_that_are_now_shared.push_back(nodes[j]);
}
}
}
}
}
}
std::sort(ghosted_nodes_that_are_now_shared.begin(), ghosted_nodes_that_are_now_shared.end());
stk::mesh::EntityVector::iterator iter = std::unique(ghosted_nodes_that_are_now_shared.begin(), ghosted_nodes_that_are_now_shared.end());
ghosted_nodes_that_are_now_shared.erase(iter, ghosted_nodes_that_are_now_shared.end());
}