Sierra Toolkit  Version of the Day
GetBuckets.hpp
1 /*------------------------------------------------------------------------*/
2 /* Copyright 2010 Sandia Corporation. */
3 /* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */
4 /* license for use of this work by or on behalf of the U.S. Government. */
5 /* Export of this program may require a license from the */
6 /* United States Government. */
7 /*------------------------------------------------------------------------*/
8 
9 #ifndef stk_mesh_GetBucket_hpp
10 #define stk_mesh_GetBucket_hpp
11 
12 //----------------------------------------------------------------------
13 
14 #include <iosfwd>
15 #include <stk_mesh/base/Types.hpp>
16 #include <stk_mesh/base/Selector.hpp>
17 #include <stk_mesh/base/Iterators.hpp>
18 
19 //----------------------------------------------------------------------
20 
21 namespace stk_classic {
22 namespace mesh {
23 
28 //----------------------------------------------------------------------
29 
30 /* \brief Select buckets from the input to the output. Buckets in the input
31  * vector will be placed in the output vector if the bucket is
32  * selected by the selector argument.
33  * On entry, the output vector is cleared before being filled with
34  * selected buckets.
35  */
36 template<class SELECTOR>
37 inline
38 void get_buckets( const SELECTOR & selector ,
39  const std::vector< Bucket * > & input ,
40  std::vector< Bucket * > & output )
41 {
42  output.clear();
43  for(const auto& b : input ) {
44  if ( selector( *b ) ) { output.push_back( b ); }
45  }
46 }
47 
51 AllSelectedBucketsRange get_buckets( const Selector & selector, const BulkData& mesh );
52 
56 AllBucketsRange get_buckets( const BulkData& mesh );
57 
61 AllBucketsRange get_buckets( EntityRank entity_rank, const BulkData& mesh );
62 
66 AllSelectedBucketsRange get_buckets( const Selector & selector, const AllBucketsRange& range);
67 
68 /* \brief Get the parts from the union part vector that the bucket is
69  * contained in.
70  */
71 void get_involved_parts( const PartVector & union_parts,
72  const Bucket & candidate,
73  PartVector & involved_parts);
74 
75 //----------------------------------------------------------------------
78 } // namespace mesh
79 } // namespace stk_classic
80 
81 //----------------------------------------------------------------------
82 //----------------------------------------------------------------------
83 
84 #endif
85 
std::ostream & output()
Function output returns the processor output log stream. This stream is connected via an mpi_filebuf ...
Definition: Env.cpp:264
Sierra Toolkit.
AllSelectedBucketsRange get_buckets(const Selector &selector, const BulkData &mesh)
Definition: GetBuckets.cpp:26
std::vector< Part *> PartVector
Collections of parts are frequently maintained as a vector of Part pointers.
Definition: Types.hpp:31
EntityRank entity_rank(const EntityKey &key)
Given an entity key, return an entity type (rank).