本文整理汇总了C++中stk::mesh::BulkData::declare_element_side方法的典型用法代码示例。如果您正苦于以下问题:C++ BulkData::declare_element_side方法的具体用法?C++ BulkData::declare_element_side怎么用?C++ BulkData::declare_element_side使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stk::mesh::BulkData
的用法示例。
在下文中一共展示了BulkData::declare_element_side方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: build_element_from_topology_verify_ordinals_and_permutations
void build_element_from_topology_verify_ordinals_and_permutations(stk::mesh::BulkData &bulk,
const stk::topology topo,
const stk::mesh::EntityIdVector & elem_node_ids,
const stk::mesh::EntityIdVector & edge_ids,
const std::vector < std::vector < unsigned > > &gold_side_node_ids,
const unsigned * gold_side_permutations,
const std::vector < std::vector < unsigned > > &gold_edge_node_ids,
const unsigned * gold_edge_permutations)
{
stk::mesh::EntityId element_id[1] = {1};
stk::mesh::MetaData &meta = bulk.mesh_meta_data();
stk::mesh::Part &elem_part = meta.declare_part_with_topology("elem_part", topo);
meta.commit();
bulk.modification_begin();
stk::mesh::Entity elem = stk::mesh::declare_element(bulk, elem_part, element_id[0], elem_node_ids);
stk::mesh::EntityVector side_nodes;
uint num_sides = topo.num_sides();
stk::topology::rank_t sub_topo_rank = topo.side_rank();
for(uint i = 0; i < num_sides; ++i)
{
stk::topology sub_topo = topo.side_topology(i);
bulk.declare_element_side(elem, i, {&meta.get_topology_root_part(sub_topo)});
side_nodes.clear();
for (uint j = 0; j < sub_topo.num_nodes(); ++j)
{
stk::mesh::Entity side_node = bulk.get_entity(stk::topology::NODE_RANK, gold_side_node_ids[i][j]);
side_nodes.push_back(side_node);
}
stk::mesh::OrdinalAndPermutation ordinalAndPermutation = stk::mesh::get_ordinal_and_permutation(bulk, elem, sub_topo_rank, side_nodes);
EXPECT_EQ(ordinalAndPermutation.second, gold_side_permutations[i]) << topo;
EXPECT_EQ(ordinalAndPermutation.first, i) << topo;
}
if (edge_ids.empty()) {
bulk.modification_end();
return;
}
stk::mesh::EntityVector edge_nodes;
uint num_edges = topo.num_edges();
for(uint i = 0; i < num_edges; ++i)
{
edge_nodes.clear();
stk::mesh::Entity edge = bulk.declare_entity(stk::topology::EDGE_RANK, edge_ids[i],
meta.get_topology_root_part(topo.edge_topology()));
for (uint j = 0; j < topo.edge_topology().num_nodes(); ++j)
{
stk::mesh::Entity edge_node = bulk.get_entity(stk::topology::NODE_RANK, gold_edge_node_ids[i][j]);
edge_nodes.push_back(edge_node);
bulk.declare_relation(edge, edge_node, j);
}
std::pair<stk::mesh::ConnectivityOrdinal, stk::mesh::Permutation> ordinalAndPermutation
= stk::mesh::get_ordinal_and_permutation(bulk, elem, stk::topology::EDGE_RANK, edge_nodes);
EXPECT_EQ(ordinalAndPermutation.second, gold_edge_permutations[i]) << topo;
EXPECT_EQ(ordinalAndPermutation.first, i) << topo;
}
bulk.modification_end();
}