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 {
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::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 
127  void create_input_mesh(const std::string &type,
128  const std::string &filename,
129  MPI_Comm comm,
130  stk::mesh::fem::FEMMetaData &metadata,
131  MeshData &mesh_data);
132 
182  void create_input_mesh(const std::string &type,
183  const std::string &filename,
184  MPI_Comm comm,
185  stk::mesh::fem::FEMMetaData &metadata,
186  MeshData &mesh_data,
187  const std::vector<std::string>& names_to_add);
188 
199  void populate_bulk_data(stk::mesh::BulkData &bulk_data, stk::io::MeshData &mesh_data);
200 
214  void process_mesh_bulk_data(Ioss::Region *region, stk::mesh::BulkData &bulk_data);
215 
230  void define_input_fields(MeshData &mesh_data, stk::mesh::fem::FEMMetaData &meta_data);
231 
238  void process_input_request(MeshData &mesh_data, stk::mesh::BulkData &bulk, int step);
239 
247  void process_input_request(MeshData &mesh_data, stk::mesh::BulkData &bulk, double time);
248 
259  void input_mesh_fields(Ioss::Region *region, stk::mesh::BulkData &bulk_data, int step);
260 
271  void input_mesh_fields(Ioss::Region *region, stk::mesh::BulkData &bulk_data, double time);
272 
304  void create_output_mesh(const std::string &filename,
305  MPI_Comm comm,
306  stk::mesh::BulkData &bulk_data,
307  MeshData &mesh_data);
308 
320  void define_output_fields(const MeshData &mesh_data,
321  const stk::mesh::fem::FEMMetaData &fem_meta,
322  bool add_all_fields = false);
323 
328  int process_output_request(MeshData &mesh_data,
329  stk::mesh::BulkData &bulk,
330  double time,
331  const std::set<const stk::mesh::Part*> &exclude=std::set<const stk::mesh::Part*>());
336  template <typename INT>
337  void get_element_block_sizes(MeshData &mesh_data,
338  std::vector<INT>& el_blocks);
339  }
340 }
341 #endif
This is a class for selecting buckets based on a set of meshparts and set logic.
Definition: Selector.hpp:112
void process_mesh_bulk_data(Ioss::Region *region, stk::mesh::BulkData &bulk_data)
void create_output_mesh(const std::string &filename, stk::ParallelMachine comm, stk::mesh::BulkData &bulk_data, MeshData &mesh_data)
Sierra Toolkit.
int process_output_request(MeshData &mesh_data, stk::mesh::BulkData &bulk, double time, const std::set< const stk::mesh::Part * > &exclude)
void populate_bulk_data(stk::mesh::BulkData &bulk_data, MeshData &mesh_data)
void process_input_request(MeshData &mesh_data, stk::mesh::BulkData &bulk, double time)
void input_mesh_fields(Ioss::Region *region, stk::mesh::BulkData &bulk, double time)
void create_input_mesh(const std::string &mesh_type, const std::string &mesh_filename, stk::ParallelMachine comm, stk::mesh::fem::FEMMetaData &fem_meta, stk::io::MeshData &mesh_data)
void get_element_block_sizes(MeshData &mesh_data, std::vector< INT > &el_blocks)
void define_output_fields(const MeshData &mesh_data, const stk::mesh::fem::FEMMetaData &fem_meta, bool add_all_fields)
Manager for an integrated collection of entities, entity relations, and buckets of field data...
Definition: BulkData.hpp:49
void define_input_fields(MeshData &mesh_data, stk::mesh::fem::FEMMetaData &fem_meta)
FEMMetaData is a class that implements a Finite Element Method skin on top of the Sierra Tool Kit Met...
Definition: FEMMetaData.hpp:54
void show_mesh_help()