Sierra Toolkit  Version of the Day
BoxFixture.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_Fixtures_BoxFixture_hpp
10 #define Stk_Mesh_Fixtures_BoxFixture_hpp
11 
12 #include <stk_mesh/base/Types.hpp>
13 #include <stk_mesh/base/MetaData.hpp>
14 #include <stk_mesh/base/BulkData.hpp>
15 
16 #include <stk_mesh/fem/FEMMetaData.hpp>
17 
18 namespace stk_classic {
19 namespace mesh {
20 namespace fixtures {
21 
22 static const size_t spatial_dimension = 3;
26 class BoxFixture {
27 public:
28  BoxFixture(stk_classic::ParallelMachine pm = MPI_COMM_WORLD,
29  unsigned block_size = 1000,
30  const std::vector<std::string>& entity_names = stk_classic::mesh::fem::entity_rank_names(spatial_dimension));
31 
32  ~BoxFixture () {}
33 
34  fem::FEMMetaData & fem_meta () { return m_fem_meta; }
35  BulkData & bulk_data () { return m_bulk_data; }
36 
37  unsigned comm_size() const { return m_comm_size; }
38  unsigned comm_rank() const { return m_comm_rank; }
39 
40  typedef int BOX[3][2];
41 
52  void generate_boxes (const BOX root_box,
53  BOX local_box);
54 
55  Entity &get_new_entity ( EntityRank rank , EntityId parallel_dependent_id );
56 
57 protected:
58  fem::FEMMetaData m_fem_meta;
59  BulkData m_bulk_data;
60 
61  unsigned m_comm_rank;
62  unsigned m_comm_size;
63 
64  BulkData::BulkDataSyncState m_previous_state;
65 
69  static void box_partition( int ip , int up , int axis ,
70  const BOX box ,
71  BOX p_box[] );
72 
73 private:
74 
75  BoxFixture();
76  BoxFixture( const BoxFixture & );
77  BoxFixture & operator = ( const BoxFixture & );
78 };
79 
80 } // namespace fixtures
81 } // namespace mesh
82 } // namespace stk_classic
83 
84 #endif
FEMMetaData is a class that implements a Finite Element Method skin on top of the Sierra Tool Kit Met...
Definition: FEMMetaData.hpp:54
void generate_boxes(const BOX root_box, BOX local_box)
Definition: BoxFixture.cpp:44
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.
MPI_Comm ParallelMachine
Definition: Parallel.hpp:32
static void box_partition(int ip, int up, int axis, const BOX box, BOX p_box[])
Definition: BoxFixture.cpp:108