12 #include <stk_mesh/base/Types.hpp> 13 #include <stk_mesh/base/GetBuckets.hpp> 14 #include <stk_mesh/base/BulkData.hpp> 15 #include <stk_mesh/base/MetaData.hpp> 16 #include <stk_mesh/base/Bucket.hpp> 17 #include <stk_mesh/base/Part.hpp> 28 AllBucketsRange all_buckets = mesh.get_bucket_range();
29 return get_selected_bucket_range(all_buckets, selector);
34 return mesh.get_bucket_range();
44 return get_selected_bucket_range(range, selector);
47 void copy_ids( std::vector<unsigned> & v ,
const PartVector & p )
50 const size_t n = p.size();
52 for (
size_t k = 0 ; k < n ; ++k ) {
53 v[k] = p[k]->mesh_meta_data_ordinal();
58 std::vector<unsigned>::iterator i = v.begin() , j = v.end();
60 i = std::unique( i , j );
65 void get_involved_parts(
67 const Bucket & candidate,
71 involved_parts.clear();
72 if (union_parts.size() == 0) {
77 MetaData & meta_data = MetaData::get( * union_parts[0]);
78 const PartVector & all_parts = meta_data.get_parts();
80 const std::pair<const unsigned *,const unsigned *>
81 bucket_part_begin_end_iterators = candidate.superset_part_ordinals();
83 std::vector<unsigned> union_parts_ids;
84 copy_ids( union_parts_ids , union_parts );
85 std::vector<unsigned>::const_iterator union_part_id_it = union_parts_ids.begin();
86 const unsigned * bucket_part_id_it = bucket_part_begin_end_iterators.first ;
88 while ( union_part_id_it != union_parts_ids.end() &&
89 bucket_part_id_it != bucket_part_begin_end_iterators.second )
91 if ( *union_part_id_it < *bucket_part_id_it ) {
94 else if ( *bucket_part_id_it < *union_part_id_it ) {
99 Part *
const part = all_parts[ *union_part_id_it ];
100 involved_parts.push_back( part );
This is a class for selecting buckets based on a set of meshparts and set logic.
Manager for an integrated collection of entities, entity relations, and buckets of field data...
AllSelectedBucketsRange get_buckets(const Selector &selector, const BulkData &mesh)
std::vector< Part *> PartVector
Collections of parts are frequently maintained as a vector of Part pointers.
EntityRank entity_rank(const EntityKey &key)
Given an entity key, return an entity type (rank).