Sierra Toolkit  Version of the Day
MeshReadWriteUtils.hpp
1 /*------------------------------------------------------------------------*/
2 /* Copyright 2010, 2011 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_MESHREADWRITEUTILS_HPP
10 #define STK_IO_MESHREADWRITEUTILS_HPP
11 #include <string>
12 #include <vector>
13 #include <set>
14 #include <stk_util/parallel/Parallel.hpp>
15 #include <Ioss_PropertyManager.h>
16 
17 namespace Ioss {
18  class Region;
19 }
20 
21 namespace stk_classic {
22  namespace mesh {
23  class Part;
24  class BulkData;
25  class Selector;
26  namespace fem {
27  class FEMMetaData;
28  }
29  }
30  namespace io {
31  class MeshData {
32  // Used to maintain state between the meta data and bulk data
33  // portions of the mesh generation process for use cases.
34  public:
35  MeshData() : m_input_region(NULL), m_output_region(NULL),
36  m_anded_selector(NULL)
37  {}
38 
39  ~MeshData();
40 
61  Ioss::PropertyManager m_property_manager;
62 
63  Ioss::Region *m_input_region;
64  Ioss::Region *m_output_region;
65 
72  stk_classic::mesh::Selector *m_anded_selector;
73 
74  private:
75  MeshData(const MeshData&); // Do not implement
76  MeshData& operator=(const MeshData&); // Do not implement
77 
78  };
79 
83  void show_mesh_help();
84 
130  void create_input_mesh(const std::string &type,
131  const std::string &filename,
132  MPI_Comm comm,
134  MeshData &mesh_data,
135  bool lower_case_variable_names=true);
136 
189  void create_input_mesh(const std::string &type,
190  const std::string &filename,
191  MPI_Comm comm,
193  MeshData &mesh_data,
194  const std::vector<std::string>& names_to_add,
195  bool lower_case_variable_names=true);
196 
207  void populate_bulk_data(stk_classic::mesh::BulkData &bulk_data, stk_classic::io::MeshData &mesh_data);
208 
222  void process_mesh_bulk_data(Ioss::Region *region, stk_classic::mesh::BulkData &bulk_data);
223 
238  void define_input_fields(MeshData &mesh_data, stk_classic::mesh::fem::FEMMetaData &meta_data);
239 
246  void process_input_request(MeshData &mesh_data, stk_classic::mesh::BulkData &bulk, int step);
247 
255  void process_input_request(MeshData &mesh_data, stk_classic::mesh::BulkData &bulk, double time);
256 
267  void input_mesh_fields(Ioss::Region *region, stk_classic::mesh::BulkData &bulk_data, int step);
268 
279  void input_mesh_fields(Ioss::Region *region, stk_classic::mesh::BulkData &bulk_data, double time);
280 
315  void create_output_mesh(const std::string &filename,
316  MPI_Comm comm,
317  stk_classic::mesh::BulkData &bulk_data,
318  MeshData &mesh_data,
319  bool lower_case_variable_names=true);
320 
332  void define_output_fields(const MeshData &mesh_data,
333  const stk_classic::mesh::fem::FEMMetaData &fem_meta,
334  bool add_all_fields = false);
335 
340  int process_output_request(MeshData &mesh_data,
342  double time,
343  const std::set<const stk_classic::mesh::Part*> &exclude=std::set<const stk_classic::mesh::Part*>());
348  template <typename INT>
349  void get_element_block_sizes(MeshData &mesh_data,
350  std::vector<INT>& el_blocks);
351  }
352 }
353 #endif
void process_input_request(MeshData &mesh_data, stk_classic::mesh::BulkData &bulk, double time)
FEMMetaData is a class that implements a Finite Element Method skin on top of the Sierra Tool Kit Met...
Definition: FEMMetaData.hpp:54
void create_output_mesh(const std::string &filename, stk_classic::ParallelMachine comm, stk_classic::mesh::BulkData &bulk_data, MeshData &mesh_data, bool lower_case_variable_names)
This is a class for selecting buckets based on a set of meshparts and set logic.
Definition: Selector.hpp:112
void populate_bulk_data(stk_classic::mesh::BulkData &bulk_data, MeshData &mesh_data)
void define_input_fields(MeshData &mesh_data, stk_classic::mesh::fem::FEMMetaData &fem_meta)
void define_output_fields(const MeshData &mesh_data, const stk_classic::mesh::fem::FEMMetaData &fem_meta, bool add_all_fields)
void get_element_block_sizes(MeshData &mesh_data, std::vector< INT > &el_blocks)
Manager for an integrated collection of entities, entity relations, and buckets of field data...
Definition: BulkData.hpp:49
void create_input_mesh(const std::string &mesh_type, const std::string &mesh_filename, stk_classic::ParallelMachine comm, stk_classic::mesh::fem::FEMMetaData &fem_meta, stk_classic::io::MeshData &mesh_data, bool lower_case_variable_names)
Sierra Toolkit.
void process_mesh_bulk_data(Ioss::Region *region, stk_classic::mesh::BulkData &bulk_data)
void input_mesh_fields(Ioss::Region *region, stk_classic::mesh::BulkData &bulk, double time)
int process_output_request(MeshData &mesh_data, stk_classic::mesh::BulkData &bulk, double time, const std::set< const stk_classic::mesh::Part *> &exclude)