Sierra Toolkit  Version of the Day
Gears.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_io_util_Gears_hpp
10 #define stk_io_util_Gears_hpp
11 
12 #include <vector>
13 
14 #include <stk_util/parallel/Parallel.hpp>
15 #include <stk_mesh/base/Types.hpp>
16 #include <stk_mesh/base/Field.hpp>
17 #include <stk_mesh/fem/FEMMetaData.hpp>
18 #include <stk_mesh/fem/TopologyDimensions.hpp>
19 #include <stk_mesh/fem/CoordinateSystems.hpp>
20 
21 namespace stk_classic {
22 namespace mesh {
23 class MetaData;
24 class BulkData;
25 }
26 
27 namespace io {
28 namespace util {
29 
30 struct GearFields {
31 
32  enum { SpatialDimension = 3 };
33 
36 
37  CylindricalField & gear_coord ;
38  CartesianField & model_coord ;
39 
40  GearFields( stk_classic::mesh::MetaData & S );
41  GearFields( stk_classic::mesh::fem::FEMMetaData & S );
42 
43 private:
44  GearFields();
45  GearFields( const GearFields & );
46  GearFields & operator = ( const GearFields & );
47 };
48 
49 class Gear {
50 public:
52  const std::string & name ,
53  const GearFields & gear_fields ,
54  const double center[] ,
55  const double rad_min ,
56  const double rad_max ,
57  const size_t rad_num ,
58  const double z_min ,
59  const double z_max ,
60  const size_t z_num ,
61  const size_t angle_num ,
62  const int turn_direction );
63 
64  void mesh( stk_classic::mesh::BulkData &M );
65  void turn( double turn_angle ) const ;
66 
67  stk_classic::mesh::fem::FEMMetaData *m_mesh_fem_meta_data ;
68  stk_classic::mesh::MetaData & m_mesh_meta_data ;
70  stk_classic::mesh::Part & m_gear ;
71  stk_classic::mesh::Part & m_surf ;
72  const GearFields::CylindricalField & m_gear_coord ;
73  const GearFields::CartesianField & m_model_coord ;
74 
75 private:
76 
77  Gear( const Gear & );
78  Gear & operator = ( const Gear & );
79 
80  double m_center[3] ;
81  double m_z_min ;
82  double m_z_max ;
83  double m_z_inc ;
84  double m_rad_min ;
85  double m_rad_max ;
86  double m_rad_inc ;
87  double m_ang_inc ;
88  size_t m_rad_num ;
89  size_t m_z_num ;
90  size_t m_angle_num ;
91  int m_turn_dir ;
92 
93  stk_classic::mesh::Entity &create_node( const std::vector<stk_classic::mesh::Part*> &parts ,
94  stk_classic::mesh::EntityId node_id_base ,
95  size_t iz ,
96  size_t ir ,
97  size_t ia ) const ;
98 };
99 
100 }
101 }
102 }
103 
104 #endif
105 
FEMMetaData is a class that implements a Finite Element Method skin on top of the Sierra Tool Kit Met...
Definition: FEMMetaData.hpp:54
The manager of an integrated collection of parts and fields.
Definition: MetaData.hpp:56
Field with defined data type and multi-dimensions (if any)
Definition: Field.hpp:118
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.