|
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_Fixtures_BoxFixture_hpp 00010 #define Stk_Mesh_Fixtures_BoxFixture_hpp 00011 00012 #include <stk_mesh/base/Types.hpp> 00013 #include <stk_mesh/base/MetaData.hpp> 00014 #include <stk_mesh/base/BulkData.hpp> 00015 00016 #include <stk_mesh/fem/FEMMetaData.hpp> 00017 00018 namespace stk_classic { 00019 namespace mesh { 00020 namespace fixtures { 00021 00022 static const size_t spatial_dimension = 3; 00026 class BoxFixture { 00027 public: 00028 BoxFixture(stk_classic::ParallelMachine pm = MPI_COMM_WORLD, 00029 unsigned block_size = 1000, 00030 const std::vector<std::string>& entity_names = stk_classic::mesh::fem::entity_rank_names(spatial_dimension)); 00031 00032 ~BoxFixture () {} 00033 00034 fem::FEMMetaData & fem_meta () { return m_fem_meta; } 00035 BulkData & bulk_data () { return m_bulk_data; } 00036 00037 unsigned comm_size() const { return m_comm_size; } 00038 unsigned comm_rank() const { return m_comm_rank; } 00039 00040 typedef int BOX[3][2]; 00041 00052 void generate_boxes (const BOX root_box, 00053 BOX local_box); 00054 00055 Entity &get_new_entity ( EntityRank rank , EntityId parallel_dependent_id ); 00056 00057 protected: 00058 fem::FEMMetaData m_fem_meta; 00059 BulkData m_bulk_data; 00060 00061 unsigned m_comm_rank; 00062 unsigned m_comm_size; 00063 00064 BulkData::BulkDataSyncState m_previous_state; 00065 00069 static void box_partition( int ip , int up , int axis , 00070 const BOX box , 00071 BOX p_box[] ); 00072 00073 private: 00074 00075 BoxFixture(); 00076 BoxFixture( const BoxFixture & ); 00077 BoxFixture & operator = ( const BoxFixture & ); 00078 }; 00079 00080 } // namespace fixtures 00081 } // namespace mesh 00082 } // namespace stk_classic 00083 00084 #endif