Sierra Toolkit Version of the Day
GetBuckets.hpp
00001 /*------------------------------------------------------------------------*/
00002 /*                 Copyright 2010 Sandia Corporation.                     */
00003 /*  Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive   */
00004 /*  license for use of this work by or on behalf of the U.S. Government.  */
00005 /*  Export of this program may require a license from the                 */
00006 /*  United States Government.                                             */
00007 /*------------------------------------------------------------------------*/
00008 
00009 #ifndef stk_mesh_GetBucket_hpp
00010 #define stk_mesh_GetBucket_hpp
00011 
00012 //----------------------------------------------------------------------
00013 
00014 #include <iosfwd>
00015 #include <stk_mesh/base/Types.hpp>
00016 #include <stk_mesh/base/Selector.hpp>
00017 #include <stk_mesh/base/Iterators.hpp>
00018 
00019 //----------------------------------------------------------------------
00020 
00021 namespace stk {
00022 namespace mesh {
00023 
00028 //----------------------------------------------------------------------
00029 
00030 /* \brief  Select buckets from the input to the output. Buckets in the input
00031  *         vector will be placed in the output vector if the bucket is
00032  *         selected by the selector argument.
00033  *         On entry, the output vector is cleared before being filled with
00034  *         selected buckets.
00035  */
00036 template<class SELECTOR>
00037 inline
00038 void get_buckets( const SELECTOR & selector ,
00039                   const std::vector< Bucket * > & input ,
00040                         std::vector< Bucket * > & output )
00041 {
00042   output.clear();
00043   for ( std::vector< Bucket * >::const_iterator
00044         i = input.begin() ; i != input.end() ; ++i ) {
00045     Bucket * const b = *i ;
00046     if ( selector( *b ) ) { output.push_back( b ); }
00047   }
00048 }
00049 
00053 AllSelectedBucketsRange get_buckets( const Selector & selector, const BulkData& mesh );
00054 
00058 AllBucketsRange get_buckets( const BulkData& mesh );
00059 
00063 AllBucketsRange get_buckets( EntityRank entity_rank, const BulkData& mesh );
00064 
00068 AllSelectedBucketsRange get_buckets( const Selector & selector, const AllBucketsRange& range);
00069 
00070 /* \brief  Get the parts from the union part vector that the bucket is
00071  *         contained in. 
00072  */
00073 void get_involved_parts( const PartVector & union_parts,
00074                          const Bucket & candidate,
00075                          PartVector & involved_parts);
00076 
00077 //----------------------------------------------------------------------
00080 } // namespace mesh
00081 } // namespace stk
00082 
00083 //----------------------------------------------------------------------
00084 //----------------------------------------------------------------------
00085 
00086 #endif
00087 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines