|
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_io_util_Gears_hpp 00010 #define stk_io_util_Gears_hpp 00011 00012 #include <vector> 00013 00014 #include <stk_util/parallel/Parallel.hpp> 00015 #include <stk_mesh/base/Types.hpp> 00016 #include <stk_mesh/base/Field.hpp> 00017 #include <stk_mesh/fem/FEMMetaData.hpp> 00018 #include <stk_mesh/fem/TopologyDimensions.hpp> 00019 #include <stk_mesh/fem/CoordinateSystems.hpp> 00020 00021 namespace stk_classic { 00022 namespace mesh { 00023 class MetaData; 00024 class BulkData; 00025 } 00026 00027 namespace io { 00028 namespace util { 00029 00030 struct GearFields { 00031 00032 enum { SpatialDimension = 3 }; 00033 00034 typedef stk_classic::mesh::Field<double,stk_classic::mesh::Cartesian> CartesianField ; 00035 typedef stk_classic::mesh::Field<double,stk_classic::mesh::Cylindrical> CylindricalField ; 00036 00037 CylindricalField & gear_coord ; 00038 CartesianField & model_coord ; 00039 00040 GearFields( stk_classic::mesh::MetaData & S ); 00041 GearFields( stk_classic::mesh::fem::FEMMetaData & S ); 00042 00043 private: 00044 GearFields(); 00045 GearFields( const GearFields & ); 00046 GearFields & operator = ( const GearFields & ); 00047 }; 00048 00049 class Gear { 00050 public: 00051 Gear( stk_classic::mesh::fem::FEMMetaData & S , 00052 const std::string & name , 00053 const GearFields & gear_fields , 00054 const double center[] , 00055 const double rad_min , 00056 const double rad_max , 00057 const size_t rad_num , 00058 const double z_min , 00059 const double z_max , 00060 const size_t z_num , 00061 const size_t angle_num , 00062 const int turn_direction ); 00063 00064 void mesh( stk_classic::mesh::BulkData &M ); 00065 void turn( double turn_angle ) const ; 00066 00067 stk_classic::mesh::fem::FEMMetaData *m_mesh_fem_meta_data ; 00068 stk_classic::mesh::MetaData & m_mesh_meta_data ; 00069 stk_classic::mesh::BulkData * m_mesh ; 00070 stk_classic::mesh::Part & m_gear ; 00071 stk_classic::mesh::Part & m_surf ; 00072 const GearFields::CylindricalField & m_gear_coord ; 00073 const GearFields::CartesianField & m_model_coord ; 00074 00075 private: 00076 00077 Gear( const Gear & ); 00078 Gear & operator = ( const Gear & ); 00079 00080 double m_center[3] ; 00081 double m_z_min ; 00082 double m_z_max ; 00083 double m_z_inc ; 00084 double m_rad_min ; 00085 double m_rad_max ; 00086 double m_rad_inc ; 00087 double m_ang_inc ; 00088 size_t m_rad_num ; 00089 size_t m_z_num ; 00090 size_t m_angle_num ; 00091 int m_turn_dir ; 00092 00093 stk_classic::mesh::Entity &create_node( const std::vector<stk_classic::mesh::Part*> &parts , 00094 stk_classic::mesh::EntityId node_id_base , 00095 size_t iz , 00096 size_t ir , 00097 size_t ia ) const ; 00098 }; 00099 00100 } 00101 } 00102 } 00103 00104 #endif 00105