本文整理汇总了C++中MetaData::locally_used_part方法的典型用法代码示例。如果您正苦于以下问题:C++ MetaData::locally_used_part方法的具体用法?C++ MetaData::locally_used_part怎么用?C++ MetaData::locally_used_part使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MetaData
的用法示例。
在下文中一共展示了MetaData::locally_used_part方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_simple_mesh
//.........这里部分代码省略.........
double * const node_2_coord = field_data( node_coordinates , node_2 );
double * const node_3_coord = field_data( node_coordinates , node_3 );
double * const node_4_coord = field_data( node_coordinates , node_4 );
double * const node_5_coord = field_data( node_coordinates , node_5 );
double * const node_6_coord = field_data( node_coordinates , node_6 );
double * const node_7_coord = field_data( node_coordinates , node_7 );
node_0_coord[0] = 0 ; node_0_coord[1] = 0 ; node_0_coord[2] = p_rank ;
node_1_coord[0] = 1 ; node_1_coord[1] = 0 ; node_1_coord[2] = p_rank ;
node_2_coord[0] = 1 ; node_2_coord[1] = 1 ; node_2_coord[2] = p_rank ;
node_3_coord[0] = 0 ; node_3_coord[1] = 1 ; node_3_coord[2] = p_rank ;
node_4_coord[0] = 0 ; node_4_coord[1] = 0 ; node_4_coord[2] = p_rank + 1 ;
node_5_coord[0] = 1 ; node_5_coord[1] = 0 ; node_5_coord[2] = p_rank + 1 ;
node_6_coord[0] = 1 ; node_6_coord[1] = 1 ; node_6_coord[2] = p_rank + 1 ;
node_7_coord[0] = 0 ; node_7_coord[1] = 1 ; node_7_coord[2] = p_rank + 1 ;
// Determine proper parallel sharing and ownership
comm_mesh_discover_sharing( M );
// Generate the parallel ghosting 'aura'
comm_mesh_regenerate_aura( M );
// Verify that the parallel sharing and aura were generated properly
if ( ! comm_mesh_verify_parallel_consistency( M ) ) {
if ( p_rank == 0 ) {
std::cout << method
<< " FAILED: is not parallel consistent"
<< std::endl ;
}
return ;
}
// Get the global counts and identifier stats
{
entity_id_type counts[ EntityTypeEnd ];
entity_id_type max_id[ EntityTypeEnd ];
comm_mesh_stats( M , counts , max_id );
if ( p_rank == 0 ) {
std::cout << method
<< " Stats for { node , edge , face , element , other }"
<< std::endl ;
std::cout << " Global Counts = {"
<< " " << counts[0]
<< " " << counts[1]
<< " " << counts[2]
<< " " << counts[3]
<< " " << counts[4]
<< " " << counts[5]
<< " }" << std::endl ;
std::cout << " Global MaxId = {"
<< " " << max_id[0]
<< " " << max_id[1]
<< " " << max_id[2]
<< " " << max_id[3]
<< " " << max_id[4]
<< " " << max_id[5]
<< " }" << std::endl ;
}
for ( unsigned p = 0 ; p < p_size ; ++p ) {
parallel_machine_barrier( pm );
if ( p_rank == p ) {
count_entities( M , S.locally_used_part() , counts );
std::cout << " P" << p_rank << " Uses Counts = {"
<< " " << counts[0]
<< " " << counts[1]
<< " " << counts[2]
<< " " << counts[3]
<< " " << counts[4]
<< " " << counts[5]
<< " }" << std::endl ;
count_entities( M , S.locally_owned_part() , counts );
std::cout << " P" << p_rank << " Owns Counts = {"
<< " " << counts[0]
<< " " << counts[1]
<< " " << counts[2]
<< " " << counts[3]
<< " " << counts[4]
<< " " << counts[5]
<< " }" << std::endl ;
std::cout.flush();
}
parallel_machine_barrier( pm );
}
}
parallel_machine_barrier( pm );
//------------------------------
if ( p_rank == 0 ) {
std::cout << method << " successful" << std::endl ;
std::cout.flush();
}
}