|
Sierra Toolkit
Version of the Day
|
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_fixture_SelectorFixture_hpp 00010 #define stk_mesh_fixture_SelectorFixture_hpp 00011 00012 #include <stk_mesh/base/MetaData.hpp> 00013 #include <stk_mesh/base/BulkData.hpp> 00014 #include <stk_mesh/base/Types.hpp> 00015 00016 namespace stk_classic { 00017 namespace mesh { 00018 namespace fixtures { 00019 00020 // Example Mesh primarily used for testing Selectors: 00021 // 00022 // PartA, PartB, PartC, PartD 00023 // Entity1, Entity2, Entity3, Entity4 00024 // All entities are rank 0 00025 // 00026 // PartA contains Entity1, Entity2 00027 // PartB contains Entity2, Entity3 00028 // PartC contains Entity3, Entity4 00029 // PartD contains no entities 00030 // Entity5 is not contained in any user-defined Part 00031 // 00032 // FieldA is defined on PartA 00033 // FieldABC is defined on Parts A, B, C 00034 // 00035 // |----------|--|-------|--|----------| |-------------| 00036 // |<--PartA---->| |<--PartC---->| | PartD | 00037 // | |<---PartB--->| | | | 00038 // | 1 |2 | |3 | 4 | 5 | | 00039 // | | | | | | | | 00040 // | | | | | | | | 00041 // |----------|--|-------|--|----------| |-------------| 00042 // 00043 00044 class SelectorFixture { 00045 public: 00046 SelectorFixture(); 00047 ~SelectorFixture(); 00048 00049 const stk_classic::mesh::MetaData & get_MetaData() const { return m_meta_data ; } 00050 stk_classic::mesh::MetaData & get_NonconstMetaData() { return m_meta_data ; } 00051 00052 const stk_classic::mesh::BulkData & get_BulkData() const { return m_bulk_data ; } 00053 stk_classic::mesh::BulkData & get_NonconstBulkData() { return m_bulk_data ; } 00054 00055 stk_classic::mesh::MetaData m_meta_data ; 00056 stk_classic::mesh::BulkData m_bulk_data ; 00057 00058 stk_classic::mesh::Part & m_partA ; 00059 stk_classic::mesh::Part & m_partB ; 00060 stk_classic::mesh::Part & m_partC ; 00061 stk_classic::mesh::Part & m_partD ; 00062 00063 stk_classic::mesh::Entity * m_entity1 ; 00064 stk_classic::mesh::Entity * m_entity2 ; 00065 stk_classic::mesh::Entity * m_entity3 ; 00066 stk_classic::mesh::Entity * m_entity4 ; 00067 stk_classic::mesh::Entity * m_entity5 ; 00068 00069 stk_classic::mesh::Field<double>& m_fieldA; 00070 stk_classic::mesh::Field<double>& m_fieldABC; 00071 00072 void generate_mesh(); 00073 00074 private: 00075 SelectorFixture( const SelectorFixture & ); 00076 SelectorFixture & operator = ( const SelectorFixture & ); 00077 }; 00078 00079 class VariableSelectorFixture { 00080 public: 00081 VariableSelectorFixture(int NumParts); 00082 ~VariableSelectorFixture(); 00083 00084 stk_classic::mesh::MetaData m_MetaData ; 00085 stk_classic::mesh::BulkData m_BulkData ; 00086 00087 stk_classic::mesh::PartVector m_declared_part_vector; 00088 std::vector<stk_classic::mesh::Entity*> m_entities ; 00089 00090 private: 00091 VariableSelectorFixture( const VariableSelectorFixture & ); 00092 VariableSelectorFixture & operator = ( const VariableSelectorFixture & ); 00093 }; 00094 00095 } // fixtures 00096 } // mesh 00097 } // stk 00098 00099 #endif // stk_mesh_fixture_SelectorFixture_hpp