13 #include <stk_util/parallel/ParallelComm.hpp> 14 #include <stk_util/parallel/ParallelReduce.hpp> 16 #include <stk_mesh/base/MetaData.hpp> 17 #include <stk_mesh/base/BulkData.hpp> 18 #include <stk_mesh/base/FieldData.hpp> 19 #include <stk_mesh/base/Comm.hpp> 20 #include <stk_mesh/base/EntityComm.hpp> 27 std::vector<size_t> & counts ,
30 const size_t zero = 0 ;
34 const MetaData & S = MetaData::get(M);
35 const unsigned entity_rank_count = S.entity_rank_count();
36 const size_t comm_count = entity_rank_count + 1 ;
38 std::vector<size_t> local( comm_count , zero );
39 std::vector<size_t> global( comm_count , zero );
44 for (
unsigned i = 0 ; i < entity_rank_count ; ++i ) {
45 const std::vector<Bucket*> & ks = M.
buckets( i );
47 std::vector<Bucket*>::const_iterator ik ;
49 for ( ik = ks.begin() ; ik != ks.end() ; ++ik ) {
51 local[i] += (*ik)->size();
56 local[ entity_rank_count ] = local_flag ;
60 counts.assign( global.begin() , global.begin() + entity_rank_count );
62 return 0 < global[ entity_rank_count ] ;
bool comm_mesh_counts(BulkData &M, std::vector< size_t > &counts, bool local_flag)
Global counts for a mesh's entities.
bool has_superset(const Bucket &bucket, const unsigned &ordinal)
Is this bucket a subset of the given part by partID.
void all_reduce_sum(ParallelMachine comm, const double *local, double *global, unsigned count)
Parallel summation to all processors.
const std::vector< Bucket * > & buckets(EntityRank rank) const
Query all buckets of a given entity rank.
An application-defined subset of a problem domain.
ParallelMachine parallel() const
The parallel machine.
Manager for an integrated collection of entities, entity relations, and buckets of field data...