IOSS 2.0
Loading...
Searching...
No Matches
Ioss_DatabaseIO.h
Go to the documentation of this file.
1// Copyright(C) 1999-2024 National Technology & Engineering Solutions
2// of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3// NTESS, the U.S. Government retains certain rights in this software.
4//
5// See packages/seacas/LICENSE for details
6
7#pragma once
8
9#include "Ioss_BoundingBox.h"
10#include "Ioss_CodeTypes.h"
11#include "Ioss_DBUsage.h" // for DatabaseUsage, etc
12#include "Ioss_DataSize.h" // for DataSize
13#include "Ioss_EntityType.h" // for EntityType
14#include "Ioss_Map.h"
15#include "Ioss_ParallelUtils.h" // for ParallelUtils
16#include "Ioss_PropertyManager.h" // for PropertyManager
17#include "Ioss_State.h" // for State, State::STATE_INVALID
18#include "Ioss_SurfaceSplit.h" // for SurfaceSplitType
19#include <chrono>
20#include <cstddef> // for size_t, nullptr
21#include <cstdint> // for int64_t
22#include <map> // for map
23#include <string> // for string
24#include <utility> // for pair
25#include <vector> // for vector
26
27#include "Ioss_Field.h"
28#include "ioss_export.h"
29
30namespace Ioss {
31 class Assembly;
32 class Blob;
33 class CommSet;
34 class EdgeBlock;
35 class EdgeSet;
36 class ElementBlock;
37 class ElementSet;
38 class ElementTopology;
39 class FaceBlock;
40 class FaceSet;
41 class Field;
42 class GroupingEntity;
43 class NodeBlock;
44 class NodeSet;
45 class Region;
46 class SideBlock;
47 class SideSet;
48 class StructuredBlock;
49} // namespace Ioss
50
51namespace Ioss {
52 class EntityBlock;
53
55
56 // Contains (parent_element, side) topology pairs
57 using TopoContainer = std::vector<std::pair<const ElementTopology *, const ElementTopology *>>;
58
59 /** \brief An input or output Database.
60 *
61 */
62 class IOSS_EXPORT DatabaseIO
63 {
64 public:
65 friend class SerializeIO;
66
67 DatabaseIO() = delete;
68 DatabaseIO(const DatabaseIO &) = delete;
69 DatabaseIO(DatabaseIO &&) = delete;
70 DatabaseIO &operator=(const DatabaseIO &) = delete;
72 virtual ~DatabaseIO();
73
74 /** \brief Check to see if database state is OK.
75 *
76 * \param[in] write_message If true, then output a warning message indicating the problem.
77 * \param[in,out] error_message If non-null on input, then a warning message on output.
78 * \param[in,out] bad_count If non-null on input, then count of the number of processors
79 * where the file does not exist on output. If ok returns false, but
80 * *bad_count==0,
81 * then the routine does not support this argument.
82 * \returns True if database state is OK. False if not.
83 */
84 IOSS_NODISCARD bool ok(bool write_message = false, std::string *error_message = nullptr,
85 int *bad_count = nullptr) const
86 {
88 return ok_nl(write_message, error_message, bad_count);
89 }
90
91 // Check capabilities of input/output database... Returns an
92 // unsigned int with the supported Ioss::EntityTypes or'ed
93 // together. If "return_value & Ioss::EntityType" is set, then the
94 // database supports that type (e.g. return_value & Ioss::FACESET)
95 IOSS_NODISCARD virtual unsigned entity_field_support() const = 0;
96
97 IOSS_NODISCARD bool using_parallel_io() const { return usingParallelIO; }
98
99 /** \brief Get the local (process-specific) node number corresponding to a global node number.
100 *
101 * \param[in] global The global node number
102 * \param[in] must_exist If true, error will occur if the global node number is not
103 * mapped to any local node number on the current process.
104 * \returns The local node number
105 */
106 IOSS_NODISCARD int64_t node_global_to_local(int64_t global, bool must_exist) const
107 {
108 IOSS_FUNC_ENTER(m_);
109 return node_global_to_local_nl(global, must_exist);
110 }
111
112 IOSS_NODISCARD int64_t element_global_to_local(int64_t global) const
113 {
114 IOSS_FUNC_ENTER(m_);
115 return element_global_to_local_nl(global);
116 }
117
118 /** If there is a single block of nodes in the model, then it is
119 * considered a node_major() database. If instead the nodes are
120 * local to each element block or structured block, then it is
121 * not a node_major database. Exodus is node major, CGNS is not.
122 */
123 IOSS_NODISCARD virtual bool node_major() const { return true; }
124
125 // Eliminate as much memory as possible, but still retain meta data information
126 // Typically, eliminate the maps...
128 {
129 IOSS_FUNC_ENTER(m_);
130 release_memory_nl();
131 }
132
133 // Do anything that might be needed to the database prior to it
134 // being closed and destructed.
135 virtual void finalize_database() const {}
136
137 // Let's save the name on disk after Filename gets modified, e.g: decoded_filename
138 void set_pfs_name(const std::string &name) const { pfsName = name; }
139
140 IOSS_NODISCARD std::string get_pfs_name() const { return pfsName; }
141
142 /** \brief this will be the name in BB namespace
143 */
144 void set_dw_name(const std::string &name) const { bbName = name; }
145
146 IOSS_NODISCARD std::string get_dw_name() const
147 {
148 if (!bbName.empty() && !is_input() && using_dw()) {
149 return bbName;
150 }
151 return get_filename();
152 }
153
154 /** \brief We call this ONLY after we assure that using_dw() is TRUE
155 * \returns mount point of Datawarp namespace, e.g: `/opt/cray/....<jobid>`
156 */
157 IOSS_NODISCARD std::string get_dw_path() const { return dwPath; }
158
159 /** Determine whether Cray Datawarp module is loaded and we have BB capacity allocated for this
160 * job ( i.e: DW_JOB_STRIPED is set) && IOSS property to use DATAWARP is set to Y/YES (i.e
161 * environmental variable ENABLE_DATAWARP) . If we are using DW then set some pathnames for
162 * writing directly to BB instead of PFS(i.e Lustre)
163 */
164 void check_set_dw() const;
165
166 /** Set if Cray Datawarp exists and allocated space is found , i.e PATH to DW name space
167 */
168 IOSS_NODISCARD bool using_dw() const { return usingDataWarp; }
169
170 /** \brief Get the file name associated with the database.
171 *
172 * \returns The database file name.
173 */
174 IOSS_NODISCARD std::string get_filename() const { return DBFilename; }
175
176 /** For the database types that support it, return an integer `handle`
177 * through which a client can directly access the underlying file.
178 * Please use sparingly and with discretion. Basically, a kluge
179 */
180 IOSS_NODISCARD virtual int get_file_pointer() const { return 0; }
181
182 /** \brief Get a file-per-processor filename associated with the database.
183 *
184 * \returns The file-per-processor name for a file on this processor.
185 */
186 IOSS_NODISCARD const std::string &decoded_filename() const;
187
188 /** Return a string specifying underlying format of database (exodus, cgns, ...) */
189 IOSS_NODISCARD virtual std::string get_format() const = 0;
190
191 /** \brief Determine whether the database is an input database.
192 *
193 * \returns True if the database is an input database. False otherwise.
194 */
195 IOSS_NODISCARD bool is_input() const { return isInput; }
196
197 /** \brief Get the Ioss::DatabaseUsage type of the database.
198 *
199 * \returns The Ioss::DatabaseUsage type of the database.
200 */
201 IOSS_NODISCARD Ioss::DatabaseUsage usage() const { return dbUsage; }
202
203 /** \brief Determine whether the database needs information about process ownership of nodes.
204 *
205 * \returns True if database needs information about process ownership of nodes.
206 */
207 IOSS_NODISCARD virtual bool needs_shared_node_information() const { return false; }
208
209 IOSS_NODISCARD Ioss::IfDatabaseExistsBehavior open_create_behavior() const;
210
211 void set_region(Region *region) { region_ = region; }
212
213 /** \brief If we are planning to use BB(aka Burst Buffer) service, we will call
214 * simple C API provided by Cray DataWarp module.
215 *
216 * Note: We would only like to use BB during write to avoid cache coherency issues during
217 * read. `dwPath` is the DW namespace which gets set during runtime from environment variable
218 * DW_JOB_STRIPED. Afterword, `using_dw()` function is used extensively for filename redirection
219 * for all related subsequent functions(e.g: get_filename, get_file_ptr etc) once burst buffer
220 * is found and set to be used.
221 */
222 void open_dw(const std::string &filename) const;
223
224 /** \brief Function which invokes stageout from BB to Disk, prior to completion of final close
225 */
226 void close_dw() const;
227
228 void openDatabase() const
229 {
230 IOSS_FUNC_ENTER(m_);
231 progress(__func__);
232 openDatabase_nl();
233 }
234
235 void closeDatabase() const
236 {
237 IOSS_FUNC_ENTER(m_);
238 progress(__func__);
239 closeDatabase_nl();
240 }
241
242 void flush_database() const
243 {
244 IOSS_FUNC_ENTER(m_);
245 progress(__func__);
246 flush_database_nl();
247 }
248
249 /** \brief If a database type supports groups and if the database
250 * contains groups, open the specified group.
251 *
252 * If the group_name begins with '/', it specifies the absolute path
253 * name from the root with '/' separating groups. Otherwise, the
254 * group_name specifies a child group of the currently active group.
255 * If group_name == "/" then the root group is opened.
256 *
257 * \param[in] group_name The name of the group to open.
258 * \returns True if successful.
259 */
260 bool open_group(const std::string &group_name)
261 {
262 IOSS_FUNC_ENTER(m_);
263 return open_group_nl(group_name);
264 }
265
266 /** \brief If a database type supports groups, create the specified
267 * group as a child of the current group.
268 *
269 * The name of the group must not contain a '/' character.
270 * If the command is successful, then the group will be the
271 * active group for all subsequent writes to the database.
272 *
273 * \param[in] group_name The name of the subgroup to create.
274 * \returns True if successful.
275 */
276 bool create_subgroup(const std::string &group_name)
277 {
278 IOSS_FUNC_ENTER(m_);
279 return create_subgroup_nl(group_name);
280 }
281
282 /** \brief Set the database to the given State.
283 *
284 * All transitions must begin from the 'STATE_CLOSED' state or be to
285 * the 'STATE_CLOSED' state (There are no nested begin/end pairs at
286 * this time.)
287 *
288 * The database state is automatically set when Region::begin_mode is called
289 * for its associated region, so it may not be necessary to call this method
290 * directly.
291 *
292 * \param[in] state The new State to which the database should be set.
293 * \returns True if successful.
294 *
295 */
296 bool begin(Ioss::State state)
297 {
298 IOSS_FUNC_ENTER(m_);
299 progress(__func__);
300 return begin_nl(state);
301 }
302
303 /** \brief Return the database to STATE_CLOSED.
304 *
305 * The database is automatically set to STATE_CLOSED when Region::end_mode
306 * is called for its associated region, so it may not be necessary to call this
307 * method directly.
308 *
309 * \param[in] state The State to end, i.e. the current state.
310 * \returns True if successful.
311 *
312 */
313 bool end(Ioss::State state)
314 {
315 IOSS_FUNC_ENTER(m_);
316 progress(__func__);
317 return end_nl(state);
318 }
319
320 bool begin_state(int state, double time);
321 bool end_state(int state, double time);
322
323 // Metadata-related functions.
325 {
326 IOSS_FUNC_ENTER(m_);
327 progress("Begin read_meta_data()");
328 read_meta_data_nl();
329 progress("End read_meta_data()");
330 }
331
333 {
334 IOSS_FUNC_ENTER(m_);
335 return get_step_times_nl();
336 }
337
338 IOSS_NODISCARD virtual bool internal_edges_available() const { return false; }
339 IOSS_NODISCARD virtual bool internal_faces_available() const { return false; }
340
341 // Information Records:
342
343 /** \brief Get all information records (informative strings) for the database.
344 *
345 * \returns The informative strings.
346 */
347 IOSS_NODISCARD const std::vector<std::string> &get_information_records() const
348 {
349 return informationRecords;
350 }
351 void add_information_records(const std::vector<std::string> &info);
352 void add_information_record(const std::string &info);
353
354 // QA Records:
355
356 /** \brief Get all QA records, each of which consists of 4 strings, from the database
357 *
358 * The 4 strings that make up a database QA record are:
359 *
360 * 1. A descriptive code name, such as the application that modified the database.
361 *
362 * 2. A descriptive string, such as the version of the application that modified the database.
363 *
364 * 3. A relevant date, such as the date the database was modified.
365 *
366 * 4. A relevant time, such as the time the database was modified.
367 *
368 * \returns All QA records in a single vector. Every 4 consecutive elements of the
369 * vector make up a single QA record.
370 */
371 IOSS_NODISCARD const std::vector<std::string> &get_qa_records() const { return qaRecords; }
372 void add_qa_record(const std::string &code, const std::string &code_qa, const std::string &date,
373 const std::string &time);
374
375 IOSS_NODISCARD bool get_logging() const { return doLogging && !singleProcOnly; }
376 void set_logging(bool on_off) { doLogging = on_off; }
377 IOSS_NODISCARD bool get_nan_detection() const { return doNanDetection; }
378 void set_nan_detection(bool on_off) { doNanDetection = on_off; }
379
380 // The get_field and put_field functions are just a wrapper around the
381 // pure virtual get_field_internal and put_field_internal functions,
382 // but this lets me add some debug/checking/common code to the
383 // functions without having to do it in the calling code or in the
384 // derived classes code. This also fulfills the heuristic that a
385 // public interface should not contain pure virtual functions.
386 template <typename T>
387 int64_t get_field(const T *reg, const Field &field, void *data, size_t data_size) const
388 {
389 IOSS_FUNC_ENTER(m_);
390 verify_and_log(reg, field, 1);
391 int64_t retval = get_field_internal(reg, field, data, data_size);
392 if (get_nan_detection()) {
393 verify_field_data(reg, field, Ioss::Field::InOut::INPUT, data);
394 }
395 verify_and_log(nullptr, field, 1);
396 return retval;
397 }
398
399 template <typename T>
400 int64_t put_field(const T *reg, const Field &field, void *data, size_t data_size) const
401 {
402 IOSS_FUNC_ENTER(m_);
403 verify_and_log(reg, field, 0);
404 if (get_nan_detection()) {
405 verify_field_data(reg, field, Ioss::Field::InOut::OUTPUT, data);
406 }
407 int64_t retval = put_field_internal(reg, field, data, data_size);
408 verify_and_log(nullptr, field, 0);
409 return retval;
410 }
411
412 template <typename T>
413 int64_t get_zc_field(const T *reg, const Field &field, void **data, size_t *data_size) const
414 {
415 IOSS_FUNC_ENTER(m_);
416 verify_and_log(reg, field, 1);
417 int64_t retval = get_zc_field_internal(reg, field, data, data_size);
418 if (get_nan_detection()) {
419 verify_field_data(reg, field, Ioss::Field::InOut::INPUT, data);
420 }
421 verify_and_log(nullptr, field, 1);
422 return retval;
423 }
424
425 /** Determine whether application will make field data get/put calls parallel consistently.
426 *
427 * True is default and required for parallel-io databases.
428 * Even if false, metadata operations must be called by all processors.
429 *
430 * \returns True if application will make field data get/put calls parallel consistently.
431 *
432 */
433 IOSS_NODISCARD bool is_parallel_consistent() const { return isParallelConsistent; }
434 void set_parallel_consistency(bool on_off) { isParallelConsistent = on_off; }
435
436 IOSS_NODISCARD bool get_use_generic_canonical_name() const { return useGenericCanonicalName; }
437 void set_use_generic_canonical_name(bool yes_no) { useGenericCanonicalName = yes_no; }
438
439 IOSS_NODISCARD bool ignore_database_names() const { return ignoreDatabaseNames; }
440 void ignore_database_names(bool yes_no) { ignoreDatabaseNames = yes_no; }
441
442 IOSS_NODISCARD bool get_ignore_realn_fields() const { return m_ignoreRealnFields; }
443 void set_ignore_realn_fields(bool yes_no) { m_ignoreRealnFields = yes_no; }
444
445 /** \brief Get the length of the longest name in the database file.
446 *
447 * \returns The length, or 0 for unlimited.
448 */
450 {
451 return 0;
452 } // Default is unlimited...
453 virtual void set_maximum_symbol_length(int /* requested_symbol_size */) {
454 } // Default does nothing...
455
456 IOSS_NODISCARD std::string get_component_name(const Ioss::Field &field,
457 Ioss::Field::InOut in_out, int component) const;
458 IOSS_NODISCARD char get_field_separator() const { return fieldSeparator; }
459 IOSS_NODISCARD bool get_field_recognition() const { return enableFieldRecognition; }
460 IOSS_NODISCARD bool get_field_strip_trailing_() const { return fieldStripTrailing_; }
461 void set_field_separator(char separator);
462 void set_field_recognition(bool yes_no) { enableFieldRecognition = yes_no; }
463 void set_field_strip_trailing_(bool yes_no) { fieldStripTrailing_ = yes_no; }
464
466 {
467 return duplicateFieldBehavior;
468 }
469
470 void set_lower_case_variable_names(bool true_false) const
471 {
472 lowerCaseVariableNames = true_false;
473 }
474
475 /* \brief Set the method used to split sidesets into homogeneous blocks.
476 *
477 * \param[in] split_type The desired method.
478 *
479 */
480 void set_surface_split_type(Ioss::SurfaceSplitType split_type) { splitType = split_type; }
482
483 void set_block_omissions(const std::vector<std::string> &omissions,
484 const std::vector<std::string> &inclusions = {});
485
486 void set_assembly_omissions(const std::vector<std::string> &omissions,
487 const std::vector<std::string> &inclusions = {});
488
490 std::vector<std::string> &block_adjacency) const
491 {
492 return get_block_adjacencies_nl(eb, block_adjacency);
493 }
495 std::vector<std::string> &block_membership) const
496 {
497 return compute_block_membership_nl(efblock, block_membership);
498 }
499
500 IOSS_NODISCARD AxisAlignedBoundingBox get_bounding_box(const Ioss::NodeBlock *nb) const;
501 IOSS_NODISCARD AxisAlignedBoundingBox get_bounding_box(const Ioss::ElementBlock *eb) const;
502 IOSS_NODISCARD AxisAlignedBoundingBox get_bounding_box(const Ioss::StructuredBlock *sb) const;
503
504 IOSS_NODISCARD virtual int int_byte_size_db() const = 0; //! Returns 4 or 8
505 IOSS_NODISCARD int int_byte_size_api() const; //! Returns 4 or 8
506 virtual void set_int_byte_size_api(Ioss::DataSize size) const;
507
508 /*!
509 * The owning region of this database.
510 */
511 IOSS_NODISCARD Region *get_region() const { return region_; }
512
513 /*!
514 * The overlay_count specifies the number of restart outputs
515 * which will be overlaid on top of the currently written
516 * step before advancing to the next step on the restart
517 * database.
518 *
519 * For example, if restarts are being output every 0.1
520 * seconds and the overlay count is specified as 2, then
521 * restart will write time 0.1 to step 1 of the database.
522 * It will then write 0.2 and 0.3 also to step 1. It will
523 * then increment the database step and write 0.4 to step 2;
524 * overlay 0.5 and 0.6 on step 2... At the end of the
525 * analysis, assuming it runs to completion, the database
526 * would have times 0.3, 0.6, 0.9, ... However, if there
527 * were a problem during the analysis, the last step on the
528 * database would contain an intermediate step.
529 *
530 * The cycle_count specifies the number of restart steps
531 * which will be written to the restart database before
532 * previously written steps are overwritten.
533 *
534 * For example, if the cycle count is 5 and restart is written every 0.1
535 * seconds, the restart system will write data at times 0.1, 0.2, 0.3,
536 * 0.4, 0.5 to the database.
537 *
538 * It will then overwrite the first step with data from time 0.6, the
539 * second with time 0.7. At time 0.8, the database would contain data at
540 * times 0.6, 0.7, 0.8, 0.4, 0.5. Note that time will not necessarily be
541 * monotonically increasing on a database that specifies the cycle
542 * count.
543 *
544 * The cycle count and overlay count can both be used at the same time
545 * also. The basic formula is:
546 *
547 * db_step = (((output_step - 1) / overlay) % cycle) + 1
548 *
549 * where "output_step" is the step that this would have been on the
550 * database in a normal write (1,2,3,....) and "db_step" is the step
551 * number that this will be written to.
552 *
553 * If you only want the last step available on the database,
554 * use set_cycle_count(1)
555 */
556 void set_cycle_count(int count) const { cycleCount = count; }
557 IOSS_NODISCARD int get_cycle_count() const { return cycleCount; }
558 void set_overlay_count(int count) const { overlayCount = count; }
559 IOSS_NODISCARD int get_overlay_count() const { return overlayCount; }
560 void set_file_per_state(bool yes_no) const { filePerState = yes_no; }
561 IOSS_NODISCARD bool get_file_per_state() const { return filePerState; }
562
563 void set_time_scale_factor(double factor) { timeScaleFactor = factor; }
564
565 IOSS_NODISCARD const Ioss::ParallelUtils &util() const { return util_; }
566 IOSS_NODISCARD const Ioss::PropertyManager &get_property_manager() const { return properties; }
567 /** \brief Get the processor that this mesh database is on.
568 *
569 * \returns The processor that this mesh database is on.
570 */
571 IOSS_NODISCARD int parallel_rank() const { return myProcessor; }
572 IOSS_NODISCARD int parallel_size() const { return util().parallel_size(); }
573 IOSS_NODISCARD bool is_parallel() const { return isParallel; }
574
575 void progress(const std::string &output) const
576 {
577 if (m_enableTracing) {
578 util().progress(output);
579 }
580 }
581
582 virtual std::vector<size_t>
583 get_entity_field_data(const std::string &field_name,
584 const std::vector<Ioss::ElementBlock *> &elem_blocks, void *data,
585 size_t data_size) const;
586
587 protected:
588 DatabaseIO(Region *region, std::string filename, Ioss::DatabaseUsage db_usage,
589 Ioss_MPI_Comm communicator, const Ioss::PropertyManager &props);
590
591 /*!
592 * The properties member data contains properties that can be
593 * used to set database-specific options. Examples include
594 * compression, name lengths, integer sizes, floating point
595 * sizes. By convention, the property name is all
596 * uppercase. Some existing properties recognized by the Exodus
597 * DatabaseIO class are:
598 *
599 * | Property | Value
600 * |-----------------------|-------------------
601 * | COMPRESSION_LEVEL | In the range [0..9]. A value of 0 indicates no compression
602 * | COMPRESSION_SHUFFLE | (true/false) to enable/disable hdf5's shuffle compression
603 * algorithm.
604 * | FILE_TYPE | netcdf4
605 * | MAXIMUM_NAME_LENGTH | Maximum length of names that will be returned/passed via api call.
606 * | INTEGER_SIZE_DB | 4 or 8 indicating byte size of integers stored on the database.
607 * | INTEGER_SIZE_API | 4 or 8 indicating byte size of integers used in api functions.
608 * | LOGGING | (true/false) to enable/disable logging of field input/output
609 */
610
612
613 /*!
614 * Utility function that may be used by derived classes.
615 * Determines whether all elements in the model have the same side
616 * topology. This can be used to speed-up certain algorithms since
617 * they don't have to check each side (or group of sides)
618 * individually.
619 */
620 void set_common_side_topology() const;
621 ElementTopology *commonSideTopology{nullptr};
622
623 template <typename T>
624 void create_groups(const std::string &property_name, EntityType type,
625 const std::string &type_name, const T *set_type);
626 template <typename T>
627 void create_group(EntityType type, const std::string &type_name,
628 const std::vector<std::string> &group_spec, const T *set_type);
629
630 // Create new sets as groups of existing exodus sets...
631 void handle_groups();
632
633 /*!
634 * Filename that this Database is connected with. Derived
635 * DatabaseIO classes may need to change this if the passed in
636 * filename is not the same as the filename actually used E.g.,
637 * the Ioex_DatabaseIO (exodusII) changes if this is a parallel
638 * run since the passed in filename is just the basename, not the
639 * processor-specific filename.
640 */
641 std::string originalDBFilename{};
642 std::string DBFilename{};
643 mutable std::string decodedFilename{};
644
645 /*!
646 * `bbName` is a temporary swizzled name which resides inside Burst Buffer namespace.
647 * This is a private trivial mapped name vs original `DBFilename` (which resides in
648 * permanent storage backed by parallel filesystem.
649 * `dwPath` is global BB mountpoint for current job with requested capacity via SLURM \c \#DW
650 * directive. `usingDataWarp` -- a boolean, for convenience of use so that we don't have to do
651 * getenv() calls to see if BB present.
652 */
653 mutable std::string bbName{};
654 mutable std::string pfsName{};
655 mutable std::string dwPath{};
656
657 mutable Ioss::State dbState{STATE_INVALID};
658
659 int myProcessor{0}; //!< number of processor this database is for
660
661 int64_t nodeCount{0};
662 int64_t elementCount{0};
663
664 /*!
665 * Check the topology of all face/element pairs in the model and
666 * fill the "TopoContainer faceTopology" variable with the
667 * unique pairs. This information is used for the
668 * faceblock/facesets and edgeblock/edgesets. If the
669 * 'topo_dimension' is 2, then face/element pairs are generated; if
670 * 'topo_dimension' is 1, then edge/element pairs are generated.
671 */
672 void check_side_topology() const;
673
674 /// Used to speed up faceblock/edgeblock calculations.
675 TopoContainer sideTopology{};
676
677 /*! Typically used for restart output, but can be used for all output...
678 * Maximum number of states on the output file. Overwrite the existing
679 * steps in a cyclic manner once exceed this count. Note that this breaks
680 * the convention that times be monotonically increasing on an exodusII file.
681 * Used by derived classes if they support this capability...
682 */
683 mutable int cycleCount{0};
684
685 mutable int overlayCount{0};
686
687 /*! Scale the time read/written from/to the file by the specified
688 scaleFactor. If the database times are 0.1, 0.2, 0.3 and the
689 scaleFactor is 20, then the application will think that the
690 times read are 2.0, 4.0, 6.0.
691
692 If specified for an output database, then the analysis time
693 is divided by the scaleFactor time prior to output.
694 */
695 double timeScaleFactor{1.0};
696
699
700 mutable Ioss::DataSize dbIntSizeAPI{USE_INT32_API};
701
702 /*! EXPERIMENTAL If this is true, then each state (timestep)
703 * output will be directed to a separate file. Currently this is
704 * only implemented for the exodus (parallel or serial, single
705 * file or fpp) database type.
706 */
707 mutable bool filePerState{false};
708 mutable bool usingDataWarp{false};
709 bool isParallel{false}; //!< true if running in parallel
710
711 mutable bool lowerCaseVariableNames{true};
712 bool usingParallelIO{false};
713
714 // List of element blocks that should be omitted or included from
715 // this model. Surfaces will take this into account while
716 // splitting; however, node and nodesets will not be filtered
717 // (perhaps this will be done at a later time...) NOTE: All local
718 // element ids and offsets are still calculated assuming that the
719 // blocks exist in the model...
720 // Only one of these can have values and the other must be empty.
721 std::vector<std::string> blockOmissions{};
722 std::vector<std::string> blockInclusions{};
723 std::vector<std::string> assemblyOmissions{};
724 std::vector<std::string> assemblyInclusions{};
725
726 std::vector<std::string> informationRecords{};
727 std::vector<std::string> qaRecords{};
728
729 //---Node Map -- Maps internal (1..NUMNP) ids to global ids used on the
730 // application side. global = nodeMap[local]
731 mutable Ioss::Map nodeMap{"node", DBFilename, myProcessor};
732 mutable Ioss::Map edgeMap{"edge", DBFilename, myProcessor};
733 mutable Ioss::Map faceMap{"face", DBFilename, myProcessor};
734 mutable Ioss::Map elemMap{"element", DBFilename, myProcessor};
735
736 mutable std::vector<std::vector<bool>> blockAdjacency;
737
738 virtual void openDatabase_nl() const;
739 virtual void closeDatabase_nl() const;
740 virtual void flush_database_nl() const {}
741
742 private:
743 virtual bool ok_nl(bool /* write_message */, std::string * /* error_message */,
744 int *bad_count) const
745 {
746 if (bad_count != nullptr) {
747 *bad_count = 0;
748 }
749 return dbState != Ioss::STATE_INVALID;
750 }
751
752 virtual int64_t node_global_to_local_nl(int64_t global, bool must_exist) const
753 {
754 return nodeMap.global_to_local(global, must_exist);
755 }
756
757 virtual int64_t element_global_to_local_nl(int64_t global) const
758 {
759 return elemMap.global_to_local(global);
760 }
761
762 virtual void release_memory_nl()
763 {
764 nodeMap.release_memory();
765 edgeMap.release_memory();
766 faceMap.release_memory();
767 elemMap.release_memory();
768 }
769
770 virtual bool open_group_nl(const std::string & /* group_name */) { return false; }
771 virtual bool create_subgroup_nl(const std::string & /* group_name */) { return false; }
772
773 virtual bool begin_nl(Ioss::State state) = 0;
774 virtual bool end_nl(Ioss::State state) = 0;
775
776 virtual void read_meta_data_nl() = 0;
777 virtual void get_step_times_nl() {}
778
779 virtual bool begin_state_nl(int state, double time);
780 virtual bool end_state_nl(int state, double time);
781
782 void get_block_adjacencies_nl(const Ioss::ElementBlock *eb,
783 std::vector<std::string> &block_adjacency) const;
784
785 virtual void
787 std::vector<std::string> & /* block_membership */) const
788 {
789 }
790
791 void compute_block_adjacencies() const;
792
793 bool verify_field_data(const GroupingEntity *ge, const Field &field, Ioss::Field::InOut in_out,
794 void *data) const;
795 void verify_and_log(const GroupingEntity *ge, const Field &field, int in_out) const;
796
797 virtual int64_t get_field_internal(const Region *reg, const Field &field, void *data,
798 size_t data_size) const = 0;
799 virtual int64_t get_field_internal(const NodeBlock *nb, const Field &field, void *data,
800 size_t data_size) const = 0;
801 virtual int64_t get_field_internal(const EdgeBlock *nb, const Field &field, void *data,
802 size_t data_size) const = 0;
803 virtual int64_t get_field_internal(const FaceBlock *nb, const Field &field, void *data,
804 size_t data_size) const = 0;
805 virtual int64_t get_field_internal(const ElementBlock *eb, const Field &field, void *data,
806 size_t data_size) const = 0;
807 virtual int64_t get_field_internal(const SideBlock *fb, const Field &field, void *data,
808 size_t data_size) const = 0;
809 virtual int64_t get_field_internal(const NodeSet *ns, const Field &field, void *data,
810 size_t data_size) const = 0;
811 virtual int64_t get_field_internal(const EdgeSet *ns, const Field &field, void *data,
812 size_t data_size) const = 0;
813 virtual int64_t get_field_internal(const FaceSet *ns, const Field &field, void *data,
814 size_t data_size) const = 0;
815 virtual int64_t get_field_internal(const ElementSet *ns, const Field &field, void *data,
816 size_t data_size) const = 0;
817 virtual int64_t get_field_internal(const SideSet *fs, const Field &field, void *data,
818 size_t data_size) const = 0;
819 virtual int64_t get_field_internal(const CommSet *cs, const Field &field, void *data,
820 size_t data_size) const = 0;
821 virtual int64_t get_field_internal(const Assembly *as, const Field &field, void *data,
822 size_t data_size) const = 0;
823 virtual int64_t get_field_internal(const Blob *bl, const Field &field, void *data,
824 size_t data_size) const = 0;
825 virtual int64_t get_field_internal(const StructuredBlock *sb, const Field &field, void *data,
826 size_t data_size) const = 0;
827
828 virtual int64_t put_field_internal(const Region *reg, const Field &field, void *data,
829 size_t data_size) const = 0;
830 virtual int64_t put_field_internal(const NodeBlock *nb, const Field &field, void *data,
831 size_t data_size) const = 0;
832 virtual int64_t put_field_internal(const EdgeBlock *nb, const Field &field, void *data,
833 size_t data_size) const = 0;
834 virtual int64_t put_field_internal(const FaceBlock *nb, const Field &field, void *data,
835 size_t data_size) const = 0;
836 virtual int64_t put_field_internal(const ElementBlock *eb, const Field &field, void *data,
837 size_t data_size) const = 0;
838 virtual int64_t put_field_internal(const SideBlock *fb, const Field &field, void *data,
839 size_t data_size) const = 0;
840 virtual int64_t put_field_internal(const NodeSet *ns, const Field &field, void *data,
841 size_t data_size) const = 0;
842 virtual int64_t put_field_internal(const EdgeSet *ns, const Field &field, void *data,
843 size_t data_size) const = 0;
844 virtual int64_t put_field_internal(const FaceSet *ns, const Field &field, void *data,
845 size_t data_size) const = 0;
846 virtual int64_t put_field_internal(const ElementSet *ns, const Field &field, void *data,
847 size_t data_size) const = 0;
848 virtual int64_t put_field_internal(const SideSet *fs, const Field &field, void *data,
849 size_t data_size) const = 0;
850 virtual int64_t put_field_internal(const CommSet *cs, const Field &field, void *data,
851 size_t data_size) const = 0;
852 virtual int64_t put_field_internal(const Assembly *as, const Field &field, void *data,
853 size_t data_size) const = 0;
854 virtual int64_t put_field_internal(const Blob *bl, const Field &field, void *data,
855 size_t data_size) const = 0;
856 virtual int64_t put_field_internal(const StructuredBlock *sb, const Field &field, void *data,
857 size_t data_size) const = 0;
858
859 virtual int64_t get_zc_field_internal(const Region *reg, const Field &field, void **data,
860 size_t *data_size) const;
861 virtual int64_t get_zc_field_internal(const NodeBlock *nb, const Field &field, void **data,
862 size_t *data_size) const;
863 virtual int64_t get_zc_field_internal(const EdgeBlock *nb, const Field &field, void **data,
864 size_t *data_size) const;
865 virtual int64_t get_zc_field_internal(const FaceBlock *nb, const Field &field, void **data,
866 size_t *data_size) const;
867 virtual int64_t get_zc_field_internal(const ElementBlock *eb, const Field &field, void **data,
868 size_t *data_size) const;
869 virtual int64_t get_zc_field_internal(const SideBlock *fb, const Field &field, void **data,
870 size_t *data_size) const;
871 virtual int64_t get_zc_field_internal(const NodeSet *ns, const Field &field, void **data,
872 size_t *data_size) const;
873 virtual int64_t get_zc_field_internal(const EdgeSet *ns, const Field &field, void **data,
874 size_t *data_size) const;
875 virtual int64_t get_zc_field_internal(const FaceSet *ns, const Field &field, void **data,
876 size_t *data_size) const;
877 virtual int64_t get_zc_field_internal(const ElementSet *ns, const Field &field, void **data,
878 size_t *data_size) const;
879 virtual int64_t get_zc_field_internal(const SideSet *fs, const Field &field, void **data,
880 size_t *data_size) const;
881 virtual int64_t get_zc_field_internal(const CommSet *cs, const Field &field, void **data,
882 size_t *data_size) const;
883 virtual int64_t get_zc_field_internal(const Assembly *as, const Field &field, void **data,
884 size_t *data_size) const;
885 virtual int64_t get_zc_field_internal(const Blob *bl, const Field &field, void **data,
886 size_t *data_size) const;
887 virtual int64_t get_zc_field_internal(const StructuredBlock *sb, const Field &field,
888 void **data, size_t *data_size) const;
889
890 template <typename T>
891 std::vector<size_t> get_entity_field_data_internal(const std::string &field_name,
892 const std::vector<T *> &entity_container,
893 void *data, size_t data_size) const;
894
895 mutable std::map<std::string, AxisAlignedBoundingBox> elementBlockBoundingBoxes;
896
897 Ioss::ParallelUtils util_; // Encapsulate parallel and other utility functions.
898#if defined(IOSS_THREADSAFE)
899 protected:
900 mutable std::mutex m_;
901
902 private:
903#endif
904 Region *region_{nullptr};
905 char fieldSeparator{'_'};
906 DuplicateFieldBehavior duplicateFieldBehavior{DuplicateFieldBehavior::UNSET_};
907
908 bool fieldSeparatorSpecified{false};
909 bool enableFieldRecognition{true};
910 bool fieldStripTrailing_{false};
911 bool isInput{true}; // No good default...
912 bool isParallelConsistent{
913 true}; // True if application will make field data get/put calls parallel
914 // consistently.
915 // True is default and required for parallel-io databases.
916 // Even if false, metadata operations must be called by all processors
917
918 bool singleProcOnly{false}; // True if history or heartbeat which is only written from proc 0...
919 bool doLogging{false}; // True if logging field input/output
920 bool doNanDetection{false}; // True if checking all floating point field data for NaNs
921 bool useGenericCanonicalName{
922 false}; // True if "block_id" is used as canonical name instead of the name
923 // given on the mesh file e.g. "fireset". Both names are still aliases.
924 bool ignoreDatabaseNames{false}; // True if "block_{id}" used as canonical name; ignore any
925 // names on database.
926 mutable bool blockAdjacenciesCalculated{false}; // True if the lazy creation of
927 // block adjacencies has been calculated.
928
929 bool m_timeStateInOut{false};
930 bool m_enableTracing{false};
931 bool m_ignoreRealnFields{false}; // Do not recognize var_1, var_2, ..., var_n as an n-component
932 // field. Keep as n scalar fields.
933 std::chrono::time_point<std::chrono::steady_clock>
934 m_stateStart; // Used for optional output step timing.
935 };
936} // namespace Ioss
#define IOSS_FUNC_ENTER(m)
Definition Ioss_CodeTypes.h:104
#define IOSS_NODISCARD
Definition Ioss_CodeTypes.h:54
int Ioss_MPI_Comm
Definition Ioss_CodeTypes.h:63
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
IOSS_NODISCARD std::string get_filename() const
Get the file name associated with the database.
Definition Ioss_DatabaseIO.h:174
IOSS_NODISCARD int64_t node_global_to_local(int64_t global, bool must_exist) const
Get the local (process-specific) node number corresponding to a global node number.
Definition Ioss_DatabaseIO.h:106
void set_overlay_count(int count) const
Definition Ioss_DatabaseIO.h:558
void openDatabase() const
Definition Ioss_DatabaseIO.h:228
virtual void read_meta_data_nl()=0
virtual int64_t get_field_internal(const FaceBlock *nb, const Field &field, void *data, size_t data_size) const =0
virtual int64_t get_field_internal(const SideSet *fs, const Field &field, void *data, size_t data_size) const =0
IOSS_NODISCARD const std::vector< std::string > & get_qa_records() const
Get all QA records, each of which consists of 4 strings, from the database.
Definition Ioss_DatabaseIO.h:371
IOSS_NODISCARD bool get_ignore_realn_fields() const
Definition Ioss_DatabaseIO.h:442
virtual int64_t get_field_internal(const SideBlock *fb, const Field &field, void *data, size_t data_size) const =0
DatabaseIO(DatabaseIO &&)=delete
virtual IOSS_NODISCARD unsigned entity_field_support() const =0
virtual int64_t get_field_internal(const Blob *bl, const Field &field, void *data, size_t data_size) const =0
virtual IOSS_NODISCARD int int_byte_size_db() const =0
virtual int64_t put_field_internal(const ElementBlock *eb, const Field &field, void *data, size_t data_size) const =0
virtual bool create_subgroup_nl(const std::string &)
Definition Ioss_DatabaseIO.h:771
std::chrono::time_point< std::chrono::steady_clock > m_stateStart
Definition Ioss_DatabaseIO.h:934
void set_time_scale_factor(double factor)
Definition Ioss_DatabaseIO.h:563
virtual int64_t put_field_internal(const FaceBlock *nb, const Field &field, void *data, size_t data_size) const =0
IOSS_NODISCARD Ioss::DatabaseUsage usage() const
Get the Ioss::DatabaseUsage type of the database.
Definition Ioss_DatabaseIO.h:201
IOSS_NODISCARD bool using_parallel_io() const
Definition Ioss_DatabaseIO.h:97
void set_region(Region *region)
Definition Ioss_DatabaseIO.h:211
virtual int64_t put_field_internal(const Region *reg, const Field &field, void *data, size_t data_size) const =0
void compute_block_membership(Ioss::SideBlock *efblock, std::vector< std::string > &block_membership) const
Definition Ioss_DatabaseIO.h:494
void release_memory()
Definition Ioss_DatabaseIO.h:127
void set_ignore_realn_fields(bool yes_no)
Definition Ioss_DatabaseIO.h:443
virtual IOSS_NODISCARD bool internal_edges_available() const
Definition Ioss_DatabaseIO.h:338
virtual int64_t get_field_internal(const NodeSet *ns, const Field &field, void *data, size_t data_size) const =0
virtual int64_t get_field_internal(const ElementSet *ns, const Field &field, void *data, size_t data_size) const =0
void set_cycle_count(int count) const
Definition Ioss_DatabaseIO.h:556
IOSS_NODISCARD char get_field_separator() const
Definition Ioss_DatabaseIO.h:458
void set_lower_case_variable_names(bool true_false) const
Definition Ioss_DatabaseIO.h:470
Ioss::ParallelUtils util_
Definition Ioss_DatabaseIO.h:897
virtual int64_t put_field_internal(const SideSet *fs, const Field &field, void *data, size_t data_size) const =0
void set_nan_detection(bool on_off)
Definition Ioss_DatabaseIO.h:378
bool begin(Ioss::State state)
Set the database to the given State.
Definition Ioss_DatabaseIO.h:296
void set_parallel_consistency(bool on_off)
Definition Ioss_DatabaseIO.h:434
bool end(Ioss::State state)
Return the database to STATE_CLOSED.
Definition Ioss_DatabaseIO.h:313
virtual int64_t put_field_internal(const NodeSet *ns, const Field &field, void *data, size_t data_size) const =0
virtual bool end_nl(Ioss::State state)=0
IOSS_NODISCARD std::string get_dw_name() const
Definition Ioss_DatabaseIO.h:146
virtual bool begin_nl(Ioss::State state)=0
IOSS_NODISCARD int parallel_rank() const
Get the processor that this mesh database is on.
Definition Ioss_DatabaseIO.h:571
virtual IOSS_NODISCARD int maximum_symbol_length() const
Get the length of the longest name in the database file.
Definition Ioss_DatabaseIO.h:449
void set_dw_name(const std::string &name) const
this will be the name in BB namespace
Definition Ioss_DatabaseIO.h:144
void flush_database() const
Definition Ioss_DatabaseIO.h:242
void read_meta_data()
Definition Ioss_DatabaseIO.h:324
virtual IOSS_NODISCARD bool needs_shared_node_information() const
Determine whether the database needs information about process ownership of nodes.
Definition Ioss_DatabaseIO.h:207
virtual int64_t get_field_internal(const EdgeBlock *nb, const Field &field, void *data, size_t data_size) const =0
virtual IOSS_NODISCARD std::string get_format() const =0
IOSS_NODISCARD bool get_nan_detection() const
Definition Ioss_DatabaseIO.h:377
IOSS_NODISCARD bool get_logging() const
Definition Ioss_DatabaseIO.h:375
virtual int64_t get_field_internal(const StructuredBlock *sb, const Field &field, void *data, size_t data_size) const =0
void set_use_generic_canonical_name(bool yes_no)
Definition Ioss_DatabaseIO.h:437
virtual int64_t put_field_internal(const ElementSet *ns, const Field &field, void *data, size_t data_size) const =0
int64_t get_zc_field(const T *reg, const Field &field, void **data, size_t *data_size) const
Definition Ioss_DatabaseIO.h:413
DatabaseIO & operator=(DatabaseIO &&)=delete
IOSS_NODISCARD bool is_parallel_consistent() const
Definition Ioss_DatabaseIO.h:433
virtual void flush_database_nl() const
Definition Ioss_DatabaseIO.h:740
void set_file_per_state(bool yes_no) const
Definition Ioss_DatabaseIO.h:560
virtual int64_t get_field_internal(const NodeBlock *nb, const Field &field, void *data, size_t data_size) const =0
DatabaseIO & operator=(const DatabaseIO &)=delete
virtual void set_maximum_symbol_length(int)
Definition Ioss_DatabaseIO.h:453
virtual void release_memory_nl()
Definition Ioss_DatabaseIO.h:762
IOSS_NODISCARD bool get_field_recognition() const
Definition Ioss_DatabaseIO.h:459
virtual int64_t put_field_internal(const CommSet *cs, const Field &field, void *data, size_t data_size) const =0
virtual int64_t put_field_internal(const NodeBlock *nb, const Field &field, void *data, size_t data_size) const =0
IOSS_NODISCARD const Ioss::PropertyManager & get_property_manager() const
Definition Ioss_DatabaseIO.h:566
IOSS_NODISCARD const std::vector< std::string > & get_information_records() const
Get all information records (informative strings) for the database.
Definition Ioss_DatabaseIO.h:347
virtual int64_t get_field_internal(const CommSet *cs, const Field &field, void *data, size_t data_size) const =0
virtual int64_t node_global_to_local_nl(int64_t global, bool must_exist) const
Definition Ioss_DatabaseIO.h:752
IOSS_NODISCARD int parallel_size() const
Definition Ioss_DatabaseIO.h:572
IOSS_NODISCARD bool ok(bool write_message=false, std::string *error_message=nullptr, int *bad_count=nullptr) const
Check to see if database state is OK.
Definition Ioss_DatabaseIO.h:84
virtual int64_t put_field_internal(const SideBlock *fb, const Field &field, void *data, size_t data_size) const =0
IOSS_NODISCARD std::string get_dw_path() const
We call this ONLY after we assure that using_dw() is TRUE.
Definition Ioss_DatabaseIO.h:157
virtual bool ok_nl(bool, std::string *, int *bad_count) const
Definition Ioss_DatabaseIO.h:743
void set_pfs_name(const std::string &name) const
Definition Ioss_DatabaseIO.h:138
IOSS_NODISCARD Ioss::SurfaceSplitType get_surface_split_type() const
Definition Ioss_DatabaseIO.h:481
virtual IOSS_NODISCARD int get_file_pointer() const
Definition Ioss_DatabaseIO.h:180
bool open_group(const std::string &group_name)
If a database type supports groups and if the database contains groups, open the specified group.
Definition Ioss_DatabaseIO.h:260
void get_step_times()
Definition Ioss_DatabaseIO.h:332
void set_surface_split_type(Ioss::SurfaceSplitType split_type)
Definition Ioss_DatabaseIO.h:480
IOSS_NODISCARD std::string get_pfs_name() const
Definition Ioss_DatabaseIO.h:140
IOSS_NODISCARD bool using_dw() const
Definition Ioss_DatabaseIO.h:168
IOSS_NODISCARD int get_cycle_count() const
Definition Ioss_DatabaseIO.h:557
virtual int64_t put_field_internal(const Blob *bl, const Field &field, void *data, size_t data_size) const =0
virtual IOSS_NODISCARD bool internal_faces_available() const
Definition Ioss_DatabaseIO.h:339
void closeDatabase() const
Definition Ioss_DatabaseIO.h:235
virtual int64_t get_field_internal(const EdgeSet *ns, const Field &field, void *data, size_t data_size) const =0
DatabaseIO(const DatabaseIO &)=delete
void ignore_database_names(bool yes_no)
Definition Ioss_DatabaseIO.h:440
void set_field_recognition(bool yes_no)
Definition Ioss_DatabaseIO.h:462
IOSS_NODISCARD int64_t element_global_to_local(int64_t global) const
Definition Ioss_DatabaseIO.h:112
virtual int64_t put_field_internal(const StructuredBlock *sb, const Field &field, void *data, size_t data_size) const =0
IOSS_NODISCARD bool is_parallel() const
Definition Ioss_DatabaseIO.h:573
IOSS_NODISCARD bool get_field_strip_trailing_() const
Definition Ioss_DatabaseIO.h:460
IOSS_NODISCARD const Ioss::ParallelUtils & util() const
Definition Ioss_DatabaseIO.h:565
void get_block_adjacencies(const Ioss::ElementBlock *eb, std::vector< std::string > &block_adjacency) const
Definition Ioss_DatabaseIO.h:489
IOSS_NODISCARD Region * get_region() const
Definition Ioss_DatabaseIO.h:511
bool create_subgroup(const std::string &group_name)
If a database type supports groups, create the specified group as a child of the current group.
Definition Ioss_DatabaseIO.h:276
void set_field_strip_trailing_(bool yes_no)
Definition Ioss_DatabaseIO.h:463
IOSS_NODISCARD int get_overlay_count() const
Definition Ioss_DatabaseIO.h:559
virtual IOSS_NODISCARD bool node_major() const
Definition Ioss_DatabaseIO.h:123
virtual int64_t put_field_internal(const FaceSet *ns, const Field &field, void *data, size_t data_size) const =0
virtual ~DatabaseIO()
IOSS_NODISCARD bool is_input() const
Determine whether the database is an input database.
Definition Ioss_DatabaseIO.h:195
virtual void compute_block_membership_nl(Ioss::SideBlock *, std::vector< std::string > &) const
Definition Ioss_DatabaseIO.h:786
virtual bool open_group_nl(const std::string &)
Definition Ioss_DatabaseIO.h:770
virtual int64_t put_field_internal(const Assembly *as, const Field &field, void *data, size_t data_size) const =0
virtual int64_t get_field_internal(const Assembly *as, const Field &field, void *data, size_t data_size) const =0
DatabaseIO()=delete
IOSS_NODISCARD bool get_use_generic_canonical_name() const
Definition Ioss_DatabaseIO.h:436
virtual void finalize_database() const
Definition Ioss_DatabaseIO.h:135
IOSS_NODISCARD bool get_file_per_state() const
Definition Ioss_DatabaseIO.h:561
virtual int64_t element_global_to_local_nl(int64_t global) const
Definition Ioss_DatabaseIO.h:757
void progress(const std::string &output) const
Definition Ioss_DatabaseIO.h:575
virtual int64_t get_field_internal(const Region *reg, const Field &field, void *data, size_t data_size) const =0
void set_logging(bool on_off)
Definition Ioss_DatabaseIO.h:376
int64_t get_field(const T *reg, const Field &field, void *data, size_t data_size) const
Definition Ioss_DatabaseIO.h:387
virtual int64_t put_field_internal(const EdgeBlock *nb, const Field &field, void *data, size_t data_size) const =0
IOSS_NODISCARD DuplicateFieldBehavior get_duplicate_field_behavior() const
Definition Ioss_DatabaseIO.h:465
virtual int64_t get_field_internal(const FaceSet *ns, const Field &field, void *data, size_t data_size) const =0
int64_t put_field(const T *reg, const Field &field, void *data, size_t data_size) const
Definition Ioss_DatabaseIO.h:400
virtual int64_t get_field_internal(const ElementBlock *eb, const Field &field, void *data, size_t data_size) const =0
Ioss::PropertyManager properties
Definition Ioss_DatabaseIO.h:611
IOSS_NODISCARD bool ignore_database_names() const
Definition Ioss_DatabaseIO.h:439
virtual void get_step_times_nl()
Definition Ioss_DatabaseIO.h:777
virtual int64_t put_field_internal(const EdgeSet *ns, const Field &field, void *data, size_t data_size) const =0
std::map< std::string, AxisAlignedBoundingBox > elementBlockBoundingBoxes
Definition Ioss_DatabaseIO.h:895
std::vector< std::vector< bool > > blockAdjacency
Definition Ioss_DatabaseIO.h:736
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
Represents an element topology.
Definition Ioss_ElementTopology.h:69
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
InOut
Definition Ioss_Field.h:41
Base class for all 'grouping' entities. The following derived classes are typical:
Definition Ioss_GroupingEntity.h:67
Definition Ioss_Map.h:46
A collection of all nodes in the region.
Definition Ioss_NodeBlock.h:33
A collection of nodes.
Definition Ioss_NodeSet.h:29
Definition Ioss_ParallelUtils.h:31
A collection of Ioss::Property objects.
Definition Ioss_PropertyManager.h:36
A grouping entity that contains other grouping entities.
Definition Ioss_Region.h:90
Class SerializeIO is a sentry class which performs serialization for mesh database I/O.
Definition Ioss_SerializeIO.h:57
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:104
The main namespace for the Ioss library.
Definition Ioad_DatabaseIO.C:40
State
Access states for a database.
Definition Ioss_State.h:15
@ STATE_INVALID
Definition Ioss_State.h:16
DataSize
The number of bytes used to store an integer type.
Definition Ioss_DataSize.h:13
@ USE_INT32_API
Definition Ioss_DataSize.h:13
DatabaseUsage
Specifies how an Ioss::DatabaseIO object will be used.
Definition Ioss_DBUsage.h:13
std::vector< std::pair< const ElementTopology *, const ElementTopology * > > TopoContainer
Definition Ioss_DatabaseIO.h:57
DuplicateFieldBehavior
Definition Ioss_DatabaseIO.h:54
SurfaceSplitType
Method used to split sidesets into homogeneous blocks.
Definition Ioss_SurfaceSplit.h:11
@ SPLIT_BY_TOPOLOGIES
Definition Ioss_SurfaceSplit.h:13
IfDatabaseExistsBehavior
Definition Ioss_DBUsage.h:32
EntityType
The particular type of GroupingEntity.
Definition Ioss_EntityType.h:12
Definition Ioss_BoundingBox.h:13