Sierra Toolkit  Version of the Day
SelectorFixture.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_fixture_SelectorFixture_hpp
10 #define stk_mesh_fixture_SelectorFixture_hpp
11 
12 #include <stk_mesh/base/MetaData.hpp>
13 #include <stk_mesh/base/BulkData.hpp>
14 #include <stk_mesh/base/Types.hpp>
15 
16 namespace stk_classic {
17 namespace mesh {
18 namespace fixtures {
19 
20 // Example Mesh primarily used for testing Selectors:
21 //
22 // PartA, PartB, PartC, PartD
23 // Entity1, Entity2, Entity3, Entity4
24 // All entities are rank 0
25 //
26 // PartA contains Entity1, Entity2
27 // PartB contains Entity2, Entity3
28 // PartC contains Entity3, Entity4
29 // PartD contains no entities
30 // Entity5 is not contained in any user-defined Part
31 //
32 // FieldA is defined on PartA
33 // FieldABC is defined on Parts A, B, C
34 //
35 // |----------|--|-------|--|----------| |-------------|
36 // |<--PartA---->| |<--PartC---->| | PartD |
37 // | |<---PartB--->| | | |
38 // | 1 |2 | |3 | 4 | 5 | |
39 // | | | | | | | |
40 // | | | | | | | |
41 // |----------|--|-------|--|----------| |-------------|
42 //
43 
44 class SelectorFixture {
45  public:
46  SelectorFixture();
47  ~SelectorFixture();
48 
49  const stk_classic::mesh::MetaData & get_MetaData() const { return m_meta_data ; }
50  stk_classic::mesh::MetaData & get_NonconstMetaData() { return m_meta_data ; }
51 
52  const stk_classic::mesh::BulkData & get_BulkData() const { return m_bulk_data ; }
53  stk_classic::mesh::BulkData & get_NonconstBulkData() { return m_bulk_data ; }
54 
55  stk_classic::mesh::MetaData m_meta_data ;
56  stk_classic::mesh::BulkData m_bulk_data ;
57 
58  stk_classic::mesh::Part & m_partA ;
59  stk_classic::mesh::Part & m_partB ;
60  stk_classic::mesh::Part & m_partC ;
61  stk_classic::mesh::Part & m_partD ;
62 
63  stk_classic::mesh::Entity * m_entity1 ;
64  stk_classic::mesh::Entity * m_entity2 ;
65  stk_classic::mesh::Entity * m_entity3 ;
66  stk_classic::mesh::Entity * m_entity4 ;
67  stk_classic::mesh::Entity * m_entity5 ;
68 
71 
72  void generate_mesh();
73 
74  private:
75  SelectorFixture( const SelectorFixture & );
76  SelectorFixture & operator = ( const SelectorFixture & );
77 };
78 
79 class VariableSelectorFixture {
80  public:
81  VariableSelectorFixture(int NumParts);
82  ~VariableSelectorFixture();
83 
84  stk_classic::mesh::MetaData m_MetaData ;
85  stk_classic::mesh::BulkData m_BulkData ;
86 
87  stk_classic::mesh::PartVector m_declared_part_vector;
88  std::vector<stk_classic::mesh::Entity*> m_entities ;
89 
90  private:
91  VariableSelectorFixture( const VariableSelectorFixture & );
92  VariableSelectorFixture & operator = ( const VariableSelectorFixture & );
93 };
94 
95 } // fixtures
96 } // mesh
97 } // stk
98 
99 #endif // stk_mesh_fixture_SelectorFixture_hpp
The manager of an integrated collection of parts and fields.
Definition: MetaData.hpp:56
An application-defined subset of a problem domain.
Definition: Part.hpp:49
Manager for an integrated collection of entities, entity relations, and buckets of field data...
Definition: BulkData.hpp:49
A fundamental unit within the discretization of a problem domain, including but not limited to nodes...
Definition: Entity.hpp:120
Sierra Toolkit.
std::vector< Part *> PartVector
Collections of parts are frequently maintained as a vector of Part pointers.
Definition: Types.hpp:31