Sierra Toolkit Version of the Day
UseCase_mesh.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_UTIL_USECASE_MESH_HPP
00010 #define STK_IO_UTIL_USECASE_MESH_HPP
00011 #include <stk_mesh/base/BulkData.hpp>
00012 #include <stk_mesh/base/MetaData.hpp>
00013 #include <Ioss_SubSystem.h>
00014 #include <stk_mesh/fem/FEMMetaData.hpp>
00015 
00016 // *************************************************************************
00017 // NOTE: The functionality provided in this file is deprecated and
00018 // NOTE: will not be supported in the future.  You should instead
00019 // NOTE: be using the functionality provided by ../MeshReadWriteUtils
00020 // *************************************************************************
00021 namespace stk {
00022   namespace mesh {
00023     class MetaData;
00024     class Part;
00025   }
00026   namespace io {
00027     namespace util {
00028       class Gear;
00029 
00030       class MeshData {
00031   // Used to maintain state between the meta data and bulk data
00032   // portions of the mesh generation process for use cases.
00033       public:
00034   MeshData() : m_region(NULL)
00035   {}
00036 
00037   ~MeshData();
00038   Ioss::Region *m_region;
00039   std::vector<stk::io::util::Gear*> m_gears;
00040 
00041       private:
00042   MeshData(const MeshData&); // Do not implement
00043   MeshData& operator=(const MeshData&); // Do not implement
00044 
00045       };
00046 
00051       void show_mesh_help();
00052 
00053 
00054       Ioss::Region *create_output_mesh(const std::string &mesh_filename,
00055                const std::string &mesh_extension,
00056                const std::string &working_directory,
00057                MPI_Comm comm,
00058                stk::mesh::BulkData &bulk_data,
00059                const Ioss::Region *in_region,
00060                stk::mesh::MetaData &meta_data,
00061                bool add_transient = true,
00062                bool add_all_fields = false);
00063 
00064 
00065       void create_input_mesh(const std::string &mesh_type,
00066            const std::string &mesh_filename,
00067            const std::string &working_directory,
00068            MPI_Comm comm,
00069            stk::mesh::fem::FEMMetaData &meta_data,
00070            stk::io::util::MeshData &mesh_data,
00071            bool hex_only = false) ;
00072       void create_output_mesh(const std::string &mesh_filename,
00073             const std::string &mesh_extension,
00074             const std::string &working_directory,
00075             MPI_Comm comm,
00076             stk::mesh::BulkData &bulk_data,
00077             stk::mesh::fem::FEMMetaData &meta_data,
00078                               MeshData &mesh_data,
00079             bool add_transient = true,
00080             bool add_all_fields = false);
00081       Ioss::Region *create_output_mesh(const std::string &mesh_filename,
00082                const std::string &mesh_extension,
00083                const std::string &working_directory,
00084                MPI_Comm comm,
00085                stk::mesh::BulkData &bulk_data,
00086                const Ioss::Region *in_region,
00087                stk::mesh::fem::FEMMetaData &meta_data,
00088                bool add_transient = true,
00089                bool add_all_fields = false) ;
00090 
00091       void process_nodeblocks(Ioss::Region &region, stk::mesh::MetaData &meta);
00092       void process_nodeblocks(Ioss::Region &region, stk::mesh::fem::FEMMetaData &meta) ;
00093       void process_nodeblocks(Ioss::Region &region, stk::mesh::BulkData &bulk);
00094 
00095       void process_elementblocks(Ioss::Region &region, stk::mesh::MetaData &meta);
00096       void process_elementblocks(Ioss::Region &region, stk::mesh::fem::FEMMetaData &meta) ;
00097       void process_elementblocks(Ioss::Region &region, stk::mesh::BulkData &bulk);
00098 
00099 
00100       void process_sidesets(Ioss::Region &region, stk::mesh::BulkData &bulk);
00101       void process_sidesets(Ioss::Region &region, stk::mesh::MetaData &meta);
00102       void process_sidesets(Ioss::Region &region, stk::mesh::fem::FEMMetaData &meta) ;
00103 
00104       void process_nodesets(Ioss::Region &region, stk::mesh::BulkData &bulk);
00105       void process_nodesets(Ioss::Region &region, stk::mesh::MetaData &meta);
00106       void process_nodesets(Ioss::Region &region, stk::mesh::fem::FEMMetaData &meta) ;
00107 
00108       void put_field_data(stk::mesh::BulkData &bulk, stk::mesh::Part &part,
00109         stk::mesh::EntityRank part_type,
00110         Ioss::GroupingEntity *io_entity,
00111         Ioss::Field::RoleType filter_role,
00112         bool add_all = false);
00113 
00114 
00115       int process_output_request(MeshData &mesh_data,
00116                                  stk::mesh::BulkData &bulk,
00117                                  double time, bool add_all_fields = false);
00118 
00119       void process_output_request(Ioss::Region &region,
00120           stk::mesh::BulkData &bulk,
00121           int step, bool add_all_fields = false);
00122 
00123       void populate_bulk_data(stk::mesh::BulkData &bulk_data,
00124             stk::io::util::MeshData &mesh_data,
00125             const std::string &mesh_type,
00126                               int step=-1);
00127     }
00128   }
00129 }
00130 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends