void Transaction::translate_partset_to_partvector ( const PartSet &in , PartVector &out ) const { out.resize ( in.size() ); unsigned i = 0; for ( PartSet::const_iterator cur_in = in.begin() ; cur_in != in.end() ; cur_in++ ) { out[i] = *cur_in; ++i; } }
void Bucket::supersets( PartVector & ps ) const { const MetaData & mesh_meta_data = mesh().mesh_meta_data(); std::pair<const unsigned *, const unsigned *> part_ord = superset_part_ordinals(); ps.resize( part_ord.second - part_ord.first ); for ( unsigned i = 0 ; part_ord.first < part_ord.second ; ++(part_ord.first) , ++i ) { ps[i] = & mesh_meta_data.get_part( * part_ord.first ); } }
void unpack_entity_info( CommBuffer & buf, const BulkData & mesh , EntityKey & key , unsigned & owner , PartVector & parts , std::vector<Relation> & relations ) { unsigned nparts = 0 ; unsigned nrel = 0 ; buf.unpack<EntityKey>( key ); buf.unpack<unsigned>( owner ); buf.unpack<unsigned>( nparts ); parts.resize( nparts ); for ( unsigned i = 0 ; i < nparts ; ++i ) { unsigned part_ordinal = ~0u ; buf.unpack<unsigned>( part_ordinal ); parts[i] = & MetaData::get(mesh).get_part( part_ordinal ); } buf.unpack( nrel ); relations.clear(); relations.reserve( nrel ); for ( unsigned i = 0 ; i < nrel ; ++i ) { EntityKey rel_key ; unsigned rel_id = 0 ; unsigned rel_attr = 0 ; buf.unpack<EntityKey>( rel_key ); buf.unpack<unsigned>( rel_id ); buf.unpack<unsigned>( rel_attr ); Entity * const entity = mesh.get_entity( entity_rank(rel_key), entity_id(rel_key) ); if ( entity && EntityLogDeleted != entity->log_query() ) { Relation rel( * entity, rel_id ); rel.set_attribute(rel_attr); relations.push_back( rel ); } } }