9#include "iocgns_export.h"
11#include <cgnsconfig.h>
40 class ElementTopology;
58 enum class entity_type { NODE, ELEM };
60 ParallelDatabaseIO(
Ioss::Region *region,
const std::string &filename,
64 ~ParallelDatabaseIO()
override;
66 IOSS_NODISCARD std::string get_format()
const override {
return "CGNS"; }
78 IOSS_NODISCARD bool needs_shared_node_information()
const override {
return false; }
82 IOSS_NODISCARD int int_byte_size_db()
const override {
return CG_SIZEOF_SIZE; }
85 void write_meta_data();
86 void write_results_meta_data();
89 void read_meta_data_nl()
override;
91 IOSS_NODISCARD int64_t node_global_to_local_nl(int64_t global,
bool must_exist)
const override;
92 IOSS_NODISCARD int64_t element_global_to_local_nl(int64_t global)
const override;
94 void release_memory_nl()
override;
96 void open_state_file(
int state);
97 void free_state_pointer();
99 void openDatabase_nl()
const override;
100 void closeDatabase_nl()
const override;
101 void closeBaseDatabase_nl()
const;
106 bool begin_state_nl(
int state,
double time)
override;
107 bool end_state_nl(
int state,
double time)
override;
108 void flush_database_nl()
const override;
110 void handle_structured_blocks();
111 void handle_unstructured_blocks();
112 size_t finalize_structured_blocks();
113 int64_t handle_node_ids(
void *ids, int64_t num_to_get)
const;
114 void finalize_database()
const override;
115 void get_step_times_nl()
override;
116 std::vector<double> get_db_step_times_nl()
override;
117 void write_adjacency_data();
120 size_t data_size)
const override;
122 size_t data_size)
const override;
124 size_t data_size)
const override;
126 size_t data_size)
const override;
128 size_t data_size)
const override;
130 void *data,
size_t data_size)
const override;
132 size_t data_size)
const override;
134 size_t data_size)
const override;
136 size_t data_size)
const override;
138 size_t data_size)
const override;
140 size_t data_size)
const override;
142 size_t data_size)
const override;
144 size_t data_size)
const override;
146 void * ,
size_t )
const override
152 void * ,
size_t )
const override
158 void *data,
size_t data_size)
const;
161 size_t data_size)
const override;
163 size_t data_size)
const override;
165 size_t data_size)
const override;
167 size_t data_size)
const override;
169 size_t data_size)
const override;
171 void *data,
size_t data_size)
const override;
173 size_t data_size)
const override;
175 size_t data_size)
const override;
177 size_t data_size)
const override;
179 size_t data_size)
const override;
181 size_t data_size)
const override;
183 size_t data_size)
const override;
185 size_t data_size)
const override;
187 void * ,
size_t )
const override
193 void * ,
size_t )
const override
199 void *data,
size_t data_size)
const;
202 const Ioss::Map &get_map(entity_type type)
const;
203 const Ioss::Map &get_map(
Ioss::Map &entity_map, int64_t entity_count, int64_t file_offset,
204 int64_t file_count, entity_type type)
const;
206 int64_t handle_element_ids(
const Ioss::ElementBlock *eb,
void *ids,
size_t num_to_get,
207 size_t offset,
size_t count)
const;
211 size_t &owned_node_count,
size_t &owned_node_offset)
const;
213 std::vector<int64_t> get_processor_zone_node_offset()
const;
215 mutable int m_cgnsFilePtr{-1};
216 mutable int m_cgnsBasePtr{-1};
219 mutable std::unique_ptr<DecompositionDataBase> decomp;
221 int m_flushInterval{0};
222 int m_currentVertexSolutionIndex{0};
223 int m_currentCellCenterSolutionIndex{0};
224 mutable bool m_dbFinalized{
false};
226 mutable std::vector<size_t> m_zoneOffset;
228 mutable std::vector<size_t>
230 mutable std::vector<double> m_timesteps;
231 std::map<std::string, int> m_zoneNameMap;
232 mutable std::map<int, Ioss::Map *> m_globalToBlockLocalNodeMap;
234 m_elemGlobalImplicitMap;
std::vector< cgsize_t > CGNSIntVector
Definition Iocgns_Defines.h:12
#define IOSS_NODISCARD
Definition Ioss_CodeTypes.h:55
int Ioss_MPI_Comm
Definition Ioss_CodeTypes.h:64
A homogeneous collection of other GroupingEntities.
Definition Ioss_Assembly.h:31
A homogeneous collection of other GroupingEntities.
Definition Ioss_Blob.h:31
Definition Ioss_CommSet.h:27
An input or output Database.
Definition Ioss_DatabaseIO.h:63
A collection of element edges with the same topology.
Definition Ioss_EdgeBlock.h:29
A collection of element edges.
Definition Ioss_EdgeSet.h:30
A collection of elements having the same topology.
Definition Ioss_ElementBlock.h:29
A collection of elements.
Definition Ioss_ElementSet.h:30
A collection of element faces with the same topology.
Definition Ioss_FaceBlock.h:29
A collection of element faces.
Definition Ioss_FaceSet.h:30
Holds metadata for bulk data associated with a GroupingEntity.
Definition Ioss_Field.h:25
A collection of all nodes in the region.
Definition Ioss_NodeBlock.h:33
A collection of nodes.
Definition Ioss_NodeSet.h:29
A collection of Ioss::Property objects.
Definition Ioss_PropertyManager.h:36
A grouping entity that contains other grouping entities.
Definition Ioss_Region.h:93
A collection of element sides having the same topology.
Definition Ioss_SideBlock.h:37
A collection of element sides.
Definition Ioss_SideSet.h:29
A structured zone – i,j,k.
Definition Ioss_StructuredBlock.h:91
A namespace for the CGNS database format.
Definition Iocgns_DatabaseIO.C:555
int get_file_pointer()
Definition Iofaodel_DatabaseIO.C:55
The main namespace for the Ioss library.
Definition Ioad_DatabaseIO.C:40
State
Access states for a database.
Definition Ioss_State.h:15
DatabaseUsage
Specifies how an Ioss::DatabaseIO object will be used.
Definition Ioss_DBUsage.h:13
MeshType
The mesh type – structured, unstructured, hybrid (future), or unknown.
Definition Ioss_MeshType.h:12