Sierra Toolkit Version of the Day
MeshReadWriteUtils.hpp
00001 /*------------------------------------------------------------------------*/
00002 /*                 Copyright 2010, 2011 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_MESHREADWRITEUTILS_HPP
00010 #define STK_IO_MESHREADWRITEUTILS_HPP
00011 #include <string>
00012 #include <vector>
00013 #include <stk_util/parallel/Parallel.hpp>
00014 
00015 namespace Ioss {
00016   class Region;
00017 }
00018 
00019 namespace stk {
00020   namespace mesh {
00021     class Part;
00022     class BulkData;
00023     namespace fem {
00024       class FEMMetaData;
00025     }
00026   }
00027   namespace io {
00028     class MeshData {
00029       // Used to maintain state between the meta data and bulk data
00030       // portions of the mesh generation process for use cases.
00031     public:
00032       MeshData() : m_input_region(NULL), m_output_region(NULL)
00033       {}
00034 
00035       ~MeshData();
00036       Ioss::Region *m_input_region;
00037       Ioss::Region *m_output_region;
00038 
00039     private:
00040       MeshData(const MeshData&); // Do not implement
00041       MeshData& operator=(const MeshData&); // Do not implement
00042 
00043     };
00044 
00048     void show_mesh_help();
00049 
00092     void create_input_mesh(const std::string &type,
00093          const std::string &filename,
00094          MPI_Comm comm,
00095          stk::mesh::fem::FEMMetaData &metadata,
00096          MeshData &mesh_data);
00097 
00108     void populate_bulk_data(stk::mesh::BulkData &bulk_data, stk::io::MeshData &mesh_data);
00109 
00124     void define_input_fields(MeshData &mesh_data, stk::mesh::fem::FEMMetaData &meta_data);
00125     
00132     void process_input_request(MeshData &mesh_data, stk::mesh::BulkData &bulk, int step);
00133 
00141     void process_input_request(MeshData &mesh_data, stk::mesh::BulkData &bulk, double time);
00142 
00174     void create_output_mesh(const std::string &filename,
00175           MPI_Comm comm,
00176           stk::mesh::BulkData &bulk_data,
00177           MeshData &mesh_data);
00178 
00190     void define_output_fields(MeshData &mesh_data,
00191             stk::mesh::fem::FEMMetaData &fem_meta,
00192             bool add_all_fields = false);
00193     
00198     int process_output_request(MeshData &mesh_data,
00199              stk::mesh::BulkData &bulk,
00200              double time);
00205     void get_element_block_sizes(MeshData &mesh_data,
00206                                  std::vector<int>& el_blocks);
00207   }
00208 }
00209 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends