本文整理汇总了C++中MetaData::get_parts方法的典型用法代码示例。如果您正苦于以下问题:C++ MetaData::get_parts方法的具体用法?C++ MetaData::get_parts怎么用?C++ MetaData::get_parts使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MetaData
的用法示例。
在下文中一共展示了MetaData::get_parts方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: verify_parallel_consistency
void verify_parallel_consistency( const MetaData & s , ParallelMachine pm )
{
const unsigned p_rank = parallel_machine_rank( pm );
const bool is_root = 0 == p_rank ;
CommBroadcast comm( pm , 0 );
if ( is_root ) {
pack( comm.send_buffer() , s.get_parts() );
pack( comm.send_buffer() , s.get_fields() );
}
comm.allocate_buffer();
if ( is_root ) {
pack( comm.send_buffer() , s.get_parts() );
pack( comm.send_buffer() , s.get_fields() );
}
comm.communicate();
int ok[ 2 ];
ok[0] = unpack_verify( comm.recv_buffer() , s.get_parts() );
ok[1] = unpack_verify( comm.recv_buffer() , s.get_fields() );
all_reduce( pm , ReduceMin<2>( ok ) );
ThrowRequireMsg(ok[0], "P" << p_rank << ": FAILED for Parts");
ThrowRequireMsg(ok[1], "P" << p_rank << ": FAILED for Fields");
}
示例2: verify_parallel_consistency
void verify_parallel_consistency( const MetaData & s , ParallelMachine pm )
{
static const char method[] = "phdmesh::verify_parallel_consistency(MetaData)" ;
const unsigned p_rank = parallel_machine_rank( pm );
const bool is_root = 0 == p_rank ;
CommBroadcast comm( pm , 0 );
if ( is_root ) {
pack( comm.send_buffer() , s.get_parts() );
pack( comm.send_buffer() , s.get_fields() );
}
comm.allocate_buffer();
if ( is_root ) {
pack( comm.send_buffer() , s.get_parts() );
pack( comm.send_buffer() , s.get_fields() );
}
comm.communicate();
int ok[ 2 ];
ok[0] = unpack_verify( comm.recv_buffer() , s.get_parts() );
ok[1] = unpack_verify( comm.recv_buffer() , s.get_fields() );
all_reduce( pm , Min<2>( ok ) );
if ( ! ok[0] || ! ok[1] ) {
std::ostringstream msg ;
msg << "P" << p_rank ;
msg << ": " << method ;
msg << " : FAILED for:" ;
if ( ! ok[0] ) { msg << " Parts" ; }
if ( ! ok[1] ) { msg << " Fields" ; }
throw std::logic_error( msg.str() );
}
}
示例3: internal_verify_change_parts
void BulkData::internal_verify_change_parts( const MetaData & meta ,
const Entity & entity ,
const OrdinalVector & parts ) const
{
const std::vector<std::string> & rank_names = meta.entity_rank_names();
const EntityRank undef_rank = InvalidEntityRank;
const EntityRank entity_rank = entity.entity_rank();
bool ok = true ;
std::ostringstream msg ;
for ( OrdinalVector::const_iterator
i = parts.begin() ; i != parts.end() ; ++i ) {
const Part * const p = meta.get_parts()[*i] ;
const unsigned part_rank = p->primary_entity_rank();
bool intersection_ok, rel_target_ok, rank_ok;
internal_basic_part_check(p, entity_rank, undef_rank, intersection_ok, rel_target_ok, rank_ok);
if ( !intersection_ok || !rel_target_ok || !rank_ok ) {
if ( ok ) {
ok = false ;
msg << "change parts for entity " << print_entity_key( entity );
msg << " , { " ;
}
else {
msg << " , " ;
}
msg << p->name() << "[" ;
if ( part_rank < rank_names.size() ) {
msg << rank_names[ part_rank ];
}
else {
msg << part_rank ;
}
msg << "] " ;
if ( !intersection_ok ) { msg << "is_intersection " ; }
if ( !rel_target_ok ) { msg << "is_relation_target " ; }
if ( !rank_ok ) { msg << "is_bad_rank " ; }
}
}
ThrowErrorMsgIf( !ok, msg.str() << "}" );
}