Sierra Toolkit  Version of the Day
GetEntities.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 
10 #ifndef stk_mesh_GetEntities_hpp
11 #define stk_mesh_GetEntities_hpp
12 
13 //----------------------------------------------------------------------
14 
15 #include <stk_mesh/base/Entity.hpp>
16 #include <stk_mesh/base/Selector.hpp>
17 #include <stk_mesh/base/BulkData.hpp>
18 #include <stk_mesh/base/Bucket.hpp>
19 #include <stk_mesh/base/Iterators.hpp>
20 
21 //----------------------------------------------------------------------
22 
23 namespace stk_classic {
24 namespace mesh {
25 
30 //----------------------------------------------------------------------
31 
38 void count_entities( const Selector & selector ,
39  const BulkData & mesh ,
40  std::vector<EntityRank> & count );
41 
43 void get_entities( const BulkData & mesh , EntityRank entity_rank,
44  std::vector< Entity*> & entities);
45 
46 // Note: Order will be different than above method because above method sorts
47 // TODO: remove underscore once API and STK_Mesh are in different namespaces
48 BucketVectorEntityIteratorRange get_entities( EntityRank entity_rank, const BulkData& mesh );
49 
53 unsigned count_selected_entities( const Selector & selector ,
54  const std::vector< Bucket * > & input_buckets );
55 
59 void get_selected_entities( const Selector & selector ,
60  const std::vector< Bucket * > & input_buckets ,
61  std::vector< Entity * > & entities );
62 
63 SelectedBucketRangeEntityIteratorRange get_selected_entities( const Selector & selector,
64  const AllBucketsRange& bucket_range );
65 
68 } // namespace mesh
69 } // namespace stk_classic
70 
71 //----------------------------------------------------------------------
72 //----------------------------------------------------------------------
73 
74 #endif // stk_mesh_GetEntities_hpp
unsigned count_selected_entities(const Selector &selector, const std::vector< Bucket * > &input_buckets)
Count entities in selected buckets (selected by the given selector instance), and sorted by ID...
Definition: GetEntities.cpp:59
void get_selected_entities(const Selector &selector, const std::vector< Bucket * > &input_buckets, std::vector< Entity * > &entities)
Get entities in selected buckets (selected by the given selector instance), and sorted by ID...
Definition: GetEntities.cpp:77
void get_entities(const BulkData &mesh, EntityRank entity_rank, std::vector< Entity *> &entities)
Get all entities of the specified type, sorted by ID.
Definition: GetEntities.cpp:25
Sierra Toolkit.
void count_entities(const Selector &selector, const BulkData &mesh, std::vector< EntityRank > &count)
Local count selected entities of each type.
EntityRank entity_rank(const EntityKey &key)
Given an entity key, return an entity type (rank).