GeneratedMesh.hpp

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_GENERATEDMESH_HPP
00010 #define STK_IO_UTIL_GENERATEDMESH_HPP
00011 #include <string>
00012 #include <vector>
00013 
00014 namespace stk {
00015   namespace io {
00016     namespace util {
00017       class GeneratedMesh
00018       {
00019       public:
00020   enum ShellLocation {MX =  0,  PX =  1,
00021           MY =  2,  PY =  3,
00022           MZ =  4,  PZ =  5};
00023 
00133   explicit GeneratedMesh(const std::string &parameters, int proc_count = 1, int my_proc = 0);
00134   GeneratedMesh(int num_x, int num_y, int num_z,        int proc_count = 1, int my_proc = 0);
00135   ~GeneratedMesh();
00136 
00150   size_t add_shell_block(ShellLocation loc);
00151     
00166   void set_scale(double scl_x, double scl_y, double scl_z);
00167   void set_offset(double off_x, double off_y, double off_z);
00168   void set_bbox(double xmin, double ymin, double zmin,
00169           double xmax, double ymax, double zmax);
00170   
00177   void set_rotation(const std::string &axis, double angle_degrees);
00178 
00182   size_t node_count() const;
00183 
00187   size_t node_count_proc() const;
00188 
00192   size_t block_count() const;
00193 
00197   size_t element_count() const;
00198 
00202   size_t shell_element_count(ShellLocation) const;
00203 
00207   size_t element_count_proc() const;
00208 
00212   size_t shell_element_count_proc(ShellLocation) const;
00213 
00219   size_t element_count(size_t block_number) const;
00220 
00226   size_t element_count_proc(size_t block_number) const;
00227 
00233   std::pair<std::string, int>  topology_type(size_t block_number) const;
00234     
00240   void node_map(std::vector<int> &map);
00241 
00242   void node_communication_map(std::vector<int> &map, std::vector<int> &proc);
00243     
00249   void element_map(size_t block_number, std::vector<int> &map);
00250 
00256   void element_map(std::vector<int> &map);
00257     
00264   void element_surface_map(ShellLocation loc, std::vector<int> &map);
00265     
00276   void connectivity(size_t block_number, std::vector<int> &connect) const;
00277 
00285   void coordinates(std::vector<double> &coord) const;
00286 
00293   void coordinates(std::vector<double> &x,
00294        std::vector<double> &y,
00295        std::vector<double> &z) const;
00296     
00297       private:
00298     
00299   GeneratedMesh( const GeneratedMesh & );
00300   GeneratedMesh & operator = ( const GeneratedMesh & );
00301 
00302   void parse_options(const std::vector<std::string> &groups);
00303   void show_parameters() const;
00304   void initialize();
00305   
00306         std::vector<ShellLocation> shellBlocks;
00307         size_t faceNodes[6][4];
00308         double rotmat[3][3];
00309   size_t numX, numY, numZ;
00310   size_t myNumZ, myStartZ;
00311 
00312   size_t processorCount;
00313   size_t myProcessor;
00314 
00315   double offX, offY, offZ; 
00316   double sclX, sclY, sclZ; 
00320   bool doRotation;
00321       };
00322     }
00323   }
00324 }
00325 #endif
Generated on Wed Apr 13 10:05:48 2011 for Sierra Toolkit by  doxygen 1.6.3