IOSS 2.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Ioss_DatabaseIO.h
Go to the documentation of this file.
1// Copyright(C) 1999-2025 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
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_);
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 */
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__);
233 }
234
235 void closeDatabase() const
236 {
237 IOSS_FUNC_ENTER(m_);
238 progress(__func__);
240 }
241
242 void flush_database() const
243 {
244 IOSS_FUNC_ENTER(m_);
245 progress(__func__);
247 }
248
250 {
251 IOSS_FUNC_ENTER(m_);
252 progress(__func__);
254 }
255
256 /** \brief If a database type supports internal change sets and if the database
257 * contains internal change sets, open the specified set.
258 *
259 * \param[in] set_name The name of the set to open.
260 * \returns True if successful.
261 */
262 bool open_internal_change_set(const std::string &set_name)
263 {
264 IOSS_FUNC_ENTER(m_);
265 return open_internal_change_set_nl(set_name);
266 }
267
268 /** \brief If a database type supports internal change sets, create the
269 * specified set.
270 *
271 * \param[in] set_name The name of the set to create.
272 * \returns True if successful.
273 */
274 bool create_internal_change_set(const std::string &set_name)
275 {
276 IOSS_FUNC_ENTER(m_);
277 return create_internal_change_set_nl(set_name);
278 }
279
280 /** \brief If a database type supports internal change sets, and if the database
281 * contains internal change sets, return the number of change sets.
282 */
288
289 /** \brief If a database type supports internal change sets, open the change set
290 * specified [zero-based] index
291 *
292 * \param[in] set_index The [zero-based] index of the internal change set to open.
293 * \returns True if successful.
294 */
295 bool open_internal_change_set(int set_index)
296 {
297 IOSS_FUNC_ENTER(m_);
298 return open_internal_change_set_nl(set_index);
299 }
300
301 /** \brief If a database type supports internal change sets, return a list of set names
302 *
303 * \param[in] return_full_names Flag to control return of relative
304 * or full set name paths.
305 * \returns True if successful.
306 */
307 Ioss::NameList internal_change_set_describe(bool return_full_names = false)
308 {
309 IOSS_FUNC_ENTER(m_);
310 return internal_change_set_describe_nl(return_full_names);
311 }
312
313 /** \brief Checks if a database type supports internal change sets
314 *
315 * \returns True if successful.
316 */
322
323 IOSS_NODISCARD virtual std::string get_internal_change_set_name() const { return ""; }
324
325 /** \brief Set the database to the given State.
326 *
327 * All transitions must begin from the 'STATE_CLOSED' state or be to
328 * the 'STATE_CLOSED' state (There are no nested begin/end pairs at
329 * this time.)
330 *
331 * The database state is automatically set when Region::begin_mode is called
332 * for its associated region, so it may not be necessary to call this method
333 * directly.
334 *
335 * \param[in] state The new State to which the database should be set.
336 * \returns True if successful.
337 *
338 */
339 bool begin(Ioss::State state)
340 {
341 IOSS_FUNC_ENTER(m_);
342 progress(__func__);
343 return begin_nl(state);
344 }
345
346 /** \brief Return the database to STATE_CLOSED.
347 *
348 * The database is automatically set to STATE_CLOSED when Region::end_mode
349 * is called for its associated region, so it may not be necessary to call this
350 * method directly.
351 *
352 * \param[in] state The State to end, i.e. the current state.
353 * \returns True if successful.
354 *
355 */
356 bool end(Ioss::State state)
357 {
358 IOSS_FUNC_ENTER(m_);
359 progress(__func__);
360 return end_nl(state);
361 }
362
363 bool begin_state(int state, double time);
364 bool end_state(int state, double time);
365
366 // Metadata-related functions.
368 {
369 IOSS_FUNC_ENTER(m_);
370 progress("Begin read_meta_data()");
372 progress("End read_meta_data()");
373 }
374
376 {
377 IOSS_FUNC_ENTER(m_);
379 }
380
381 /** \brief Return the list of timesteps in the database contingent on certain
382 * controlling properties.
383 *
384 * This is different from get_step_times() in that it does not set timestep
385 * data on the region. If the database supports change sets, it will return the
386 * timestep data for the current change set
387 *
388 * \returns timesteps.
389 *
390 */
391 std::vector<double> get_db_step_times()
392 {
393 IOSS_FUNC_ENTER(m_);
394 return get_db_step_times_nl();
395 }
396
397 IOSS_NODISCARD virtual bool internal_edges_available() const { return false; }
398 IOSS_NODISCARD virtual bool internal_faces_available() const { return false; }
399
400 // Information Records:
401
402 /** \brief Get all information records (informative strings) for the database.
403 *
404 * \returns The informative strings.
405 */
410 void add_information_records(const Ioss::NameList &info);
411 void add_information_record(const std::string &info);
412
413 // QA Records:
414
415 /** \brief Get all QA records, each of which consists of 4 strings, from the database
416 *
417 * The 4 strings that make up a database QA record are:
418 *
419 * 1. A descriptive code name, such as the application that modified the database.
420 *
421 * 2. A descriptive string, such as the version of the application that modified the database.
422 *
423 * 3. A relevant date, such as the date the database was modified.
424 *
425 * 4. A relevant time, such as the time the database was modified.
426 *
427 * \returns All QA records in a single vector. Every 4 consecutive elements of the
428 * vector make up a single QA record.
429 */
431 void add_qa_record(const std::string &code, const std::string &code_qa, const std::string &date,
432 const std::string &time);
433
435 void set_logging(bool on_off) { doLogging = on_off; }
437 void set_nan_detection(bool on_off) { doNanDetection = on_off; }
438
439 // The get_field and put_field functions are just a wrapper around the
440 // pure virtual get_field_internal and put_field_internal functions,
441 // but this lets me add some debug/checking/common code to the
442 // functions without having to do it in the calling code or in the
443 // derived classes code. This also fulfills the heuristic that a
444 // public interface should not contain pure virtual functions.
445 template <typename T>
446 int64_t get_field(const T *reg, const Field &field, void *data, size_t data_size) const
447 {
448 IOSS_FUNC_ENTER(m_);
449 verify_and_log(reg, field, 1);
450 int64_t retval = get_field_internal(reg, field, data, data_size);
451 if (get_nan_detection()) {
453 }
454 verify_and_log(nullptr, field, 1);
455 return retval;
456 }
457
458 template <typename T>
459 int64_t put_field(const T *reg, const Field &field, void *data, size_t data_size) const
460 {
461 IOSS_FUNC_ENTER(m_);
462 verify_and_log(reg, field, 0);
463 if (get_nan_detection()) {
465 }
466 int64_t retval = put_field_internal(reg, field, data, data_size);
467 verify_and_log(nullptr, field, 0);
468 return retval;
469 }
470
471 template <typename T>
472 int64_t get_zc_field(const T *reg, const Field &field, void **data, size_t *data_size) const
473 {
474 IOSS_FUNC_ENTER(m_);
475 verify_and_log(reg, field, 1);
476 int64_t retval = get_zc_field_internal(reg, field, data, data_size);
477 if (get_nan_detection()) {
479 }
480 verify_and_log(nullptr, field, 1);
481 return retval;
482 }
483
484 /** Determine whether application will make field data get/put calls parallel consistently.
485 *
486 * True is default and required for parallel-io databases.
487 * Even if false, metadata operations must be called by all processors.
488 *
489 * \returns True if application will make field data get/put calls parallel consistently.
490 *
491 */
493 void set_parallel_consistency(bool on_off) { isParallelConsistent = on_off; }
494
497
499 void ignore_database_names(bool yes_no) { ignoreDatabaseNames = yes_no; }
500
502 void set_ignore_realn_fields(bool yes_no) { m_ignoreRealnFields = yes_no; }
503
504 /** \brief Get the length of the longest name in the database file.
505 *
506 * \returns The length, or 0 for unlimited.
507 */
509 {
510 return 0;
511 } // Default is unlimited...
512 virtual void set_maximum_symbol_length(int /* requested_symbol_size */) {
513 } // Default does nothing...
514
515 IOSS_NODISCARD std::string get_component_name(const Ioss::Field &field,
516 Ioss::Field::InOut in_out, int component) const;
520 void set_field_separator(char separator);
521 void set_field_recognition(bool yes_no) { enableFieldRecognition = yes_no; }
522 void set_field_strip_trailing_(bool yes_no) { fieldStripTrailing_ = yes_no; }
523
528
529 void set_lowercase_variable_names(bool true_false) const
530 {
531 lowerCaseVariableNames = true_false;
532 }
533
534 void set_lowercase_database_names(bool true_false) const
535 {
536 lowerCaseDatabaseNames = true_false;
537 }
538
539 // Retain for backward compatibility
540 void set_lower_case_variable_names(bool true_false) const
541 {
542 lowerCaseVariableNames = true_false;
543 }
544
545 // Retain for backward compatibility
546 void set_lower_case_database_names(bool true_false) const
547 {
548 lowerCaseDatabaseNames = true_false;
549 }
550
551 /* \brief Set the method used to split sidesets into homogeneous blocks.
552 *
553 * \param[in] split_type The desired method.
554 *
555 */
556 void set_surface_split_type(Ioss::SurfaceSplitType split_type) { splitType = split_type; }
558
559 void set_block_omissions(const Ioss::NameList &omissions,
560 const Ioss::NameList &inclusions = {});
561
562 void set_assembly_omissions(const Ioss::NameList &omissions,
563 const Ioss::NameList &inclusions = {});
564
565 void get_block_adjacencies(const Ioss::ElementBlock *eb, Ioss::NameList &block_adjacency) const
566 {
567 return get_block_adjacencies_nl(eb, block_adjacency);
568 }
569 void compute_block_membership(Ioss::SideBlock *efblock, Ioss::NameList &block_membership) const
570 {
571 return compute_block_membership_nl(efblock, block_membership);
572 }
573
574 IOSS_NODISCARD AxisAlignedBoundingBox get_bounding_box(const Ioss::NodeBlock *nb) const;
575 IOSS_NODISCARD AxisAlignedBoundingBox get_bounding_box(const Ioss::ElementBlock *eb) const;
576 IOSS_NODISCARD AxisAlignedBoundingBox get_bounding_box(const Ioss::StructuredBlock *sb) const;
577
578 IOSS_NODISCARD virtual int int_byte_size_db() const = 0; //! Returns 4 or 8
579 IOSS_NODISCARD int int_byte_size_api() const; //! Returns 4 or 8
580 virtual void set_int_byte_size_api(Ioss::DataSize size) const;
582
583 /*!
584 * The owning region of this database.
585 */
587
588 /*!
589 * The overlay_count specifies the number of restart outputs
590 * which will be overlaid on top of the currently written
591 * step before advancing to the next step on the restart
592 * database.
593 *
594 * For example, if restarts are being output every 0.1
595 * seconds and the overlay count is specified as 2, then
596 * restart will write time 0.1 to step 1 of the database.
597 * It will then write 0.2 and 0.3 also to step 1. It will
598 * then increment the database step and write 0.4 to step 2;
599 * overlay 0.5 and 0.6 on step 2... At the end of the
600 * analysis, assuming it runs to completion, the database
601 * would have times 0.3, 0.6, 0.9, ... However, if there
602 * were a problem during the analysis, the last step on the
603 * database would contain an intermediate step.
604 *
605 * The cycle_count specifies the number of restart steps
606 * which will be written to the restart database before
607 * previously written steps are overwritten.
608 *
609 * For example, if the cycle count is 5 and restart is written every 0.1
610 * seconds, the restart system will write data at times 0.1, 0.2, 0.3,
611 * 0.4, 0.5 to the database.
612 *
613 * It will then overwrite the first step with data from time 0.6, the
614 * second with time 0.7. At time 0.8, the database would contain data at
615 * times 0.6, 0.7, 0.8, 0.4, 0.5. Note that time will not necessarily be
616 * monotonically increasing on a database that specifies the cycle
617 * count.
618 *
619 * The cycle count and overlay count can both be used at the same time
620 * also. The basic formula is:
621 *
622 * db_step = (((output_step - 1) / overlay) % cycle) + 1
623 *
624 * where "output_step" is the step that this would have been on the
625 * database in a normal write (1,2,3,....) and "db_step" is the step
626 * number that this will be written to.
627 *
628 * If you only want the last step available on the database,
629 * use set_cycle_count(1)
630 */
631 void set_cycle_count(int count) const { cycleCount = count; }
633 void set_overlay_count(int count) const { overlayCount = count; }
635 void set_file_per_state(bool yes_no) const { filePerState = yes_no; }
637
638 void set_time_scale_factor(double factor) { timeScaleFactor = factor; }
639
640 IOSS_NODISCARD const Ioss::ParallelUtils &util() const { return util_; }
642 /** \brief Get the processor that this mesh database is on.
643 *
644 * \returns The processor that this mesh database is on.
645 */
647 IOSS_NODISCARD int parallel_size() const { return util().parallel_size(); }
648 IOSS_NODISCARD bool is_parallel() const { return isParallel; }
649
650 void progress(const std::string &output) const
651 {
652 if (m_enableTracing) {
653 util().progress(output);
654 }
655 }
656
657 virtual std::vector<size_t>
658 get_entity_field_data(const std::string &field_name,
659 const std::vector<Ioss::ElementBlock *> &elem_blocks, void *data,
660 size_t data_size) const;
661
662 protected:
663 DatabaseIO(Region *region, std::string filename, Ioss::DatabaseUsage db_usage,
664 Ioss_MPI_Comm communicator, const Ioss::PropertyManager &props);
665
666 /*!
667 * The properties member data contains properties that can be
668 * used to set database-specific options. Examples include
669 * compression, name lengths, integer sizes, floating point
670 * sizes. By convention, the property name is all
671 * uppercase. Some existing properties recognized by the Exodus
672 * DatabaseIO class are:
673 *
674 * | Property | Value
675 * |-----------------------|-------------------
676 * | COMPRESSION_LEVEL | In the range [0..9]. A value of 0 indicates no compression
677 * | COMPRESSION_SHUFFLE | (true/false) to enable/disable hdf5's shuffle compression
678 * algorithm.
679 * | FILE_TYPE | netcdf4
680 * | MAXIMUM_NAME_LENGTH | Maximum length of names that will be returned/passed via api call.
681 * | INTEGER_SIZE_DB | 4 or 8 indicating byte size of integers stored on the database.
682 * | INTEGER_SIZE_API | 4 or 8 indicating byte size of integers used in api functions.
683 * | LOGGING | (true/false) to enable/disable logging of field input/output
684 */
685
687
688 /*!
689 * Utility function that may be used by derived classes.
690 * Determines whether all elements in the model have the same side
691 * topology. This can be used to speed-up certain algorithms since
692 * they don't have to check each side (or group of sides)
693 * individually.
694 */
695 void set_common_side_topology() const;
697
698 template <typename T>
699 void create_groups(const std::string &property_name, EntityType type,
700 const std::string &type_name, const T *set_type);
701 template <typename T>
702 void create_group(EntityType type, const std::string &type_name,
703 const Ioss::NameList &group_spec, const T *set_type);
704
705 // Create new sets as groups of existing exodus sets...
706 void handle_groups();
707
708 /*!
709 * Filename that this Database is connected with. Derived
710 * DatabaseIO classes may need to change this if the passed in
711 * filename is not the same as the filename actually used E.g.,
712 * the Ioex_DatabaseIO (exodusII) changes if this is a parallel
713 * run since the passed in filename is just the basename, not the
714 * processor-specific filename.
715 */
716 std::string originalDBFilename{};
717 std::string DBFilename{};
718 mutable std::string decodedFilename{};
719
720 /*!
721 * `bbName` is a temporary swizzled name which resides inside Burst Buffer namespace.
722 * This is a private trivial mapped name vs original `DBFilename` (which resides in
723 * permanent storage backed by parallel filesystem.
724 * `dwPath` is global BB mountpoint for current job with requested capacity via SLURM \c \#DW
725 * directive. `usingDataWarp` -- a boolean, for convenience of use so that we don't have to do
726 * getenv() calls to see if BB present.
727 */
728 mutable std::string bbName{};
729 mutable std::string pfsName{};
730 mutable std::string dwPath{};
731
733
734 int myProcessor{0}; //!< number of processor this database is for
735
736 int64_t nodeCount{0};
737 int64_t elementCount{0};
738
739 /*!
740 * Check the topology of all face/element pairs in the model and
741 * fill the "TopoContainer faceTopology" variable with the
742 * unique pairs. This information is used for the
743 * faceblock/facesets and edgeblock/edgesets. If the
744 * 'topo_dimension' is 2, then face/element pairs are generated; if
745 * 'topo_dimension' is 1, then edge/element pairs are generated.
746 */
747 void check_side_topology() const;
748
749 /// Used to speed up faceblock/edgeblock calculations.
751
752 /*! Typically used for restart output, but can be used for all output...
753 * Maximum number of states on the output file. Overwrite the existing
754 * steps in a cyclic manner once exceed this count. Note that this breaks
755 * the convention that times be monotonically increasing on an exodusII file.
756 * Used by derived classes if they support this capability...
757 */
758 mutable int cycleCount{0};
759
760 mutable int overlayCount{0};
761
762 /*! Scale the time read/written from/to the file by the specified
763 scaleFactor. If the database times are 0.1, 0.2, 0.3 and the
764 scaleFactor is 20, then the application will think that the
765 times read are 2.0, 4.0, 6.0.
766
767 If specified for an output database, then the analysis time
768 is divided by the scaleFactor time prior to output.
769 */
770 double timeScaleFactor{1.0};
771
774
776
777 /*! EXPERIMENTAL If this is true, then each state (timestep)
778 * output will be directed to a separate file. Currently this is
779 * only implemented for the exodus (parallel or serial, single
780 * file or fpp) database type.
781 */
782 mutable bool filePerState{false};
783 mutable bool usingDataWarp{false};
784 bool isParallel{false}; //!< true if running in parallel
785
786 mutable bool lowerCaseVariableNames{false};
787 mutable bool lowerCaseDatabaseNames{false};
788 bool usingParallelIO{false};
789
790 // List of element blocks that should be omitted or included from
791 // this model. Surfaces will take this into account while
792 // splitting; however, node and nodesets will not be filtered
793 // (perhaps this will be done at a later time...) NOTE: All local
794 // element ids and offsets are still calculated assuming that the
795 // blocks exist in the model...
796 // Only one of these can have values and the other must be empty.
801
804
805 //---Node Map -- Maps internal (1..NUMNP) ids to global ids used on the
806 // application side. global = nodeMap[local]
811
812 mutable std::vector<std::vector<bool>> blockAdjacency;
813
814 virtual void openDatabase_nl() const;
815 virtual void closeDatabase_nl() const;
816 virtual void flush_database_nl() const {}
817
818 virtual void release_memory_nl();
819
820 virtual void reset_database_nl();
821
822 private:
823 virtual bool ok_nl(bool /* write_message */, std::string * /* error_message */,
824 int *bad_count) const
825 {
826 if (bad_count != nullptr) {
827 *bad_count = 0;
828 }
830 }
831
832 virtual int64_t node_global_to_local_nl(int64_t global, bool must_exist) const
833 {
834 return nodeMap.global_to_local(global, must_exist);
835 }
836
837 virtual int64_t element_global_to_local_nl(int64_t global) const
838 {
839 return elemMap.global_to_local(global);
840 }
841
842 virtual bool supports_internal_change_set_nl() { return false; }
843 virtual bool open_internal_change_set_nl(const std::string & /* set_name */) { return false; }
844 virtual bool open_internal_change_set_nl(int /* index */) { return false; }
845 virtual bool create_internal_change_set_nl(const std::string & /* set_name */) { return false; }
846 virtual int num_internal_change_set_nl() { return 0; }
847 virtual Ioss::NameList internal_change_set_describe_nl(bool /* return_full_names */)
848 {
849 return Ioss::NameList();
850 }
851
852 virtual bool begin_nl(Ioss::State state) = 0;
853 virtual bool end_nl(Ioss::State state) = 0;
854
855 virtual void read_meta_data_nl() = 0;
856 virtual void get_step_times_nl() {}
857 virtual std::vector<double> get_db_step_times_nl() { return std::vector<double>(); }
858
859 virtual bool begin_state_nl(int state, double time);
860 virtual bool end_state_nl(int state, double time);
861
862 void get_block_adjacencies_nl(const Ioss::ElementBlock *eb,
863 Ioss::NameList &block_adjacency) const;
864
865 virtual void compute_block_membership_nl(Ioss::SideBlock * /* efblock */,
866 Ioss::NameList & /* block_membership */) const
867 {
868 }
869
870 void compute_block_adjacencies() const;
871
872 bool verify_field_data(const GroupingEntity *ge, const Field &field, Ioss::Field::InOut in_out,
873 void *data) const;
874 void verify_and_log(const GroupingEntity *ge, const Field &field, int in_out) const;
875
876 virtual int64_t get_field_internal(const Region *reg, const Field &field, void *data,
877 size_t data_size) const = 0;
878 virtual int64_t get_field_internal(const NodeBlock *nb, const Field &field, void *data,
879 size_t data_size) const = 0;
880 virtual int64_t get_field_internal(const EdgeBlock *nb, const Field &field, void *data,
881 size_t data_size) const = 0;
882 virtual int64_t get_field_internal(const FaceBlock *nb, const Field &field, void *data,
883 size_t data_size) const = 0;
884 virtual int64_t get_field_internal(const ElementBlock *eb, const Field &field, void *data,
885 size_t data_size) const = 0;
886 virtual int64_t get_field_internal(const SideBlock *fb, const Field &field, void *data,
887 size_t data_size) const = 0;
888 virtual int64_t get_field_internal(const NodeSet *ns, const Field &field, void *data,
889 size_t data_size) const = 0;
890 virtual int64_t get_field_internal(const EdgeSet *ns, const Field &field, void *data,
891 size_t data_size) const = 0;
892 virtual int64_t get_field_internal(const FaceSet *ns, const Field &field, void *data,
893 size_t data_size) const = 0;
894 virtual int64_t get_field_internal(const ElementSet *ns, const Field &field, void *data,
895 size_t data_size) const = 0;
896 virtual int64_t get_field_internal(const SideSet *fs, const Field &field, void *data,
897 size_t data_size) const = 0;
898 virtual int64_t get_field_internal(const CommSet *cs, const Field &field, void *data,
899 size_t data_size) const = 0;
900 virtual int64_t get_field_internal(const Assembly *as, const Field &field, void *data,
901 size_t data_size) const = 0;
902 virtual int64_t get_field_internal(const Blob *bl, const Field &field, void *data,
903 size_t data_size) const = 0;
904 virtual int64_t get_field_internal(const StructuredBlock *sb, const Field &field, void *data,
905 size_t data_size) const = 0;
906
907 virtual int64_t put_field_internal(const Region *reg, const Field &field, void *data,
908 size_t data_size) const = 0;
909 virtual int64_t put_field_internal(const NodeBlock *nb, const Field &field, void *data,
910 size_t data_size) const = 0;
911 virtual int64_t put_field_internal(const EdgeBlock *nb, const Field &field, void *data,
912 size_t data_size) const = 0;
913 virtual int64_t put_field_internal(const FaceBlock *nb, const Field &field, void *data,
914 size_t data_size) const = 0;
915 virtual int64_t put_field_internal(const ElementBlock *eb, const Field &field, void *data,
916 size_t data_size) const = 0;
917 virtual int64_t put_field_internal(const SideBlock *fb, const Field &field, void *data,
918 size_t data_size) const = 0;
919 virtual int64_t put_field_internal(const NodeSet *ns, const Field &field, void *data,
920 size_t data_size) const = 0;
921 virtual int64_t put_field_internal(const EdgeSet *ns, const Field &field, void *data,
922 size_t data_size) const = 0;
923 virtual int64_t put_field_internal(const FaceSet *ns, const Field &field, void *data,
924 size_t data_size) const = 0;
925 virtual int64_t put_field_internal(const ElementSet *ns, const Field &field, void *data,
926 size_t data_size) const = 0;
927 virtual int64_t put_field_internal(const SideSet *fs, const Field &field, void *data,
928 size_t data_size) const = 0;
929 virtual int64_t put_field_internal(const CommSet *cs, const Field &field, void *data,
930 size_t data_size) const = 0;
931 virtual int64_t put_field_internal(const Assembly *as, const Field &field, void *data,
932 size_t data_size) const = 0;
933 virtual int64_t put_field_internal(const Blob *bl, const Field &field, void *data,
934 size_t data_size) const = 0;
935 virtual int64_t put_field_internal(const StructuredBlock *sb, const Field &field, void *data,
936 size_t data_size) const = 0;
937
938 virtual int64_t get_zc_field_internal(const Region *reg, const Field &field, void **data,
939 size_t *data_size) const;
940 virtual int64_t get_zc_field_internal(const NodeBlock *nb, const Field &field, void **data,
941 size_t *data_size) const;
942 virtual int64_t get_zc_field_internal(const EdgeBlock *nb, const Field &field, void **data,
943 size_t *data_size) const;
944 virtual int64_t get_zc_field_internal(const FaceBlock *nb, const Field &field, void **data,
945 size_t *data_size) const;
946 virtual int64_t get_zc_field_internal(const ElementBlock *eb, const Field &field, void **data,
947 size_t *data_size) const;
948 virtual int64_t get_zc_field_internal(const SideBlock *fb, const Field &field, void **data,
949 size_t *data_size) const;
950 virtual int64_t get_zc_field_internal(const NodeSet *ns, const Field &field, void **data,
951 size_t *data_size) const;
952 virtual int64_t get_zc_field_internal(const EdgeSet *ns, const Field &field, void **data,
953 size_t *data_size) const;
954 virtual int64_t get_zc_field_internal(const FaceSet *ns, const Field &field, void **data,
955 size_t *data_size) const;
956 virtual int64_t get_zc_field_internal(const ElementSet *ns, const Field &field, void **data,
957 size_t *data_size) const;
958 virtual int64_t get_zc_field_internal(const SideSet *fs, const Field &field, void **data,
959 size_t *data_size) const;
960 virtual int64_t get_zc_field_internal(const CommSet *cs, const Field &field, void **data,
961 size_t *data_size) const;
962 virtual int64_t get_zc_field_internal(const Assembly *as, const Field &field, void **data,
963 size_t *data_size) const;
964 virtual int64_t get_zc_field_internal(const Blob *bl, const Field &field, void **data,
965 size_t *data_size) const;
966 virtual int64_t get_zc_field_internal(const StructuredBlock *sb, const Field &field,
967 void **data, size_t *data_size) const;
968
969 template <typename T>
970 std::vector<size_t> get_entity_field_data_internal(const std::string &field_name,
971 const std::vector<T *> &entity_container,
972 void *data, size_t data_size) const;
973
974 mutable std::map<std::string, AxisAlignedBoundingBox> elementBlockBoundingBoxes;
975
976 Ioss::ParallelUtils util_; // Encapsulate parallel and other utility functions.
977#if defined(IOSS_THREADSAFE)
978 protected:
979 mutable std::mutex m_;
980
981 private:
982#endif
983 Region *region_{nullptr};
984 char fieldSeparator{'_'};
986
990 bool isInput{true}; // No good default...
992 true}; // True if application will make field data get/put calls parallel
993 // consistently.
994 // True is default and required for parallel-io databases.
995 // Even if false, metadata operations must be called by all processors
996
997 bool singleProcOnly{false}; // True if history or heartbeat which is only written from proc 0...
998 bool doLogging{false}; // True if logging field input/output
999 bool doNanDetection{false}; // True if checking all floating point field data for NaNs
1001 false}; // True if "block_id" is used as canonical name instead of the name
1002 // given on the mesh file e.g. "fireset". Both names are still aliases.
1003 bool ignoreDatabaseNames{false}; // True if "block_{id}" used as canonical name; ignore any
1004 // names on database.
1005 mutable bool blockAdjacenciesCalculated{false}; // True if the lazy creation of
1006 // block adjacencies has been calculated.
1007
1008 bool m_timeStateInOut{false};
1009 bool m_enableTracing{false};
1010 bool m_ignoreRealnFields{false}; // Do not recognize var_1, var_2, ..., var_n as an n-component
1011 // field. Keep as n scalar fields.
1012 std::chrono::time_point<std::chrono::steady_clock>
1013 m_stateStart; // Used for optional output step timing.
1014 };
1015} // namespace Ioss
#define IOSS_FUNC_ENTER(m)
Definition Ioss_CodeTypes.h:106
#define IOSS_NODISCARD
Definition Ioss_CodeTypes.h:56
MPI_Comm Ioss_MPI_Comm
Definition Ioss_CodeTypes.h:61
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
std::string dwPath
Definition Ioss_DatabaseIO.h:730
bool doNanDetection
Definition Ioss_DatabaseIO.h:999
bool useGenericCanonicalName
Definition Ioss_DatabaseIO.h:1000
void set_overlay_count(int count) const
Definition Ioss_DatabaseIO.h:633
void openDatabase() const
Definition Ioss_DatabaseIO.h:228
friend class SerializeIO
Definition Ioss_DatabaseIO.h:65
virtual void read_meta_data_nl()=0
bool fieldSeparatorSpecified
Definition Ioss_DatabaseIO.h:987
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
virtual int num_internal_change_set_nl()
Definition Ioss_DatabaseIO.h:846
IOSS_NODISCARD bool get_ignore_realn_fields() const
Definition Ioss_DatabaseIO.h:501
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
std::string decodedFilename
Definition Ioss_DatabaseIO.h:718
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
bool usingDataWarp
Definition Ioss_DatabaseIO.h:783
std::string DBFilename
Definition Ioss_DatabaseIO.h:717
std::chrono::time_point< std::chrono::steady_clock > m_stateStart
Definition Ioss_DatabaseIO.h:1013
int myProcessor
number of processor this database is for
Definition Ioss_DatabaseIO.h:734
void set_time_scale_factor(double factor)
Definition Ioss_DatabaseIO.h:638
IOSS_NODISCARD const Ioss::NameList & get_information_records() const
Get all information records (informative strings) for the database.
Definition Ioss_DatabaseIO.h:406
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
int64_t elementCount
Definition Ioss_DatabaseIO.h:737
void release_memory()
Definition Ioss_DatabaseIO.h:127
void set_ignore_realn_fields(bool yes_no)
Definition Ioss_DatabaseIO.h:502
IOSS_NODISCARD Ioss::DataSize int_byte_size_data_size() const
Definition Ioss_DatabaseIO.C:382
bool doLogging
Definition Ioss_DatabaseIO.h:998
bool filePerState
Definition Ioss_DatabaseIO.h:782
virtual void closeDatabase_nl() const
Definition Ioss_DatabaseIO.C:570
virtual IOSS_NODISCARD bool internal_edges_available() const
Definition Ioss_DatabaseIO.h:397
Ioss::NameList internal_change_set_describe(bool return_full_names=false)
If a database type supports internal change sets, return a list of set names.
Definition Ioss_DatabaseIO.h:307
Ioss::Map elemMap
Definition Ioss_DatabaseIO.h:810
bool fieldStripTrailing_
Definition Ioss_DatabaseIO.h:989
virtual int64_t get_field_internal(const NodeSet *ns, const Field &field, void *data, size_t data_size) const =0
bool isParallelConsistent
Definition Ioss_DatabaseIO.h:991
bool m_timeStateInOut
Definition Ioss_DatabaseIO.h:1008
virtual int64_t get_field_internal(const ElementSet *ns, const Field &field, void *data, size_t data_size) const =0
TopoContainer sideTopology
Used to speed up faceblock/edgeblock calculations.
Definition Ioss_DatabaseIO.h:750
void set_lowercase_database_names(bool true_false) const
Definition Ioss_DatabaseIO.h:534
void set_cycle_count(int count) const
Definition Ioss_DatabaseIO.h:631
IOSS_NODISCARD char get_field_separator() const
Definition Ioss_DatabaseIO.h:517
virtual IOSS_NODISCARD std::string get_internal_change_set_name() const
Definition Ioss_DatabaseIO.h:323
void set_lower_case_database_names(bool true_false) const
Definition Ioss_DatabaseIO.h:546
void set_lower_case_variable_names(bool true_false) const
Definition Ioss_DatabaseIO.h:540
Ioss::Map nodeMap
Definition Ioss_DatabaseIO.h:807
bool isInput
Definition Ioss_DatabaseIO.h:990
Ioss::ParallelUtils util_
Definition Ioss_DatabaseIO.h:976
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:437
bool begin(Ioss::State state)
Set the database to the given State.
Definition Ioss_DatabaseIO.h:339
virtual void release_memory_nl()
Definition Ioss_DatabaseIO.C:1556
void set_parallel_consistency(bool on_off)
Definition Ioss_DatabaseIO.h:493
bool singleProcOnly
Definition Ioss_DatabaseIO.h:997
bool ignoreDatabaseNames
Definition Ioss_DatabaseIO.h:1003
bool enableFieldRecognition
Definition Ioss_DatabaseIO.h:988
int cycleCount
Definition Ioss_DatabaseIO.h:758
void get_block_adjacencies_nl(const Ioss::ElementBlock *eb, Ioss::NameList &block_adjacency) const
Definition Ioss_DatabaseIO.C:1002
bool end(Ioss::State state)
Return the database to STATE_CLOSED.
Definition Ioss_DatabaseIO.h:356
Ioss::NameList blockOmissions
Definition Ioss_DatabaseIO.h:797
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
std::string originalDBFilename
Definition Ioss_DatabaseIO.h:716
void verify_and_log(const GroupingEntity *ge, const Field &field, int in_out) const
Definition Ioss_DatabaseIO.C:647
std::vector< size_t > get_entity_field_data_internal(const std::string &field_name, const std::vector< T * > &entity_container, void *data, size_t data_size) const
Definition Ioss_DatabaseIO.C:1410
IOSS_NODISCARD std::string get_dw_name() const
Definition Ioss_DatabaseIO.h:146
bool supports_internal_change_set()
Checks if a database type supports internal change sets.
Definition Ioss_DatabaseIO.h:317
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:646
virtual IOSS_NODISCARD int maximum_symbol_length() const
Get the length of the longest name in the database file.
Definition Ioss_DatabaseIO.h:508
void set_lowercase_variable_names(bool true_false) const
Definition Ioss_DatabaseIO.h:529
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:367
virtual bool create_internal_change_set_nl(const std::string &)
Definition Ioss_DatabaseIO.h:845
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
int overlayCount
Definition Ioss_DatabaseIO.h:760
Ioss::DataSize dbIntSizeAPI
Definition Ioss_DatabaseIO.h:775
virtual IOSS_NODISCARD std::string get_format() const =0
IOSS_NODISCARD bool get_nan_detection() const
Definition Ioss_DatabaseIO.h:436
IOSS_NODISCARD bool get_logging() const
Definition Ioss_DatabaseIO.h:434
std::string bbName
Definition Ioss_DatabaseIO.h:728
std::string pfsName
Definition Ioss_DatabaseIO.h:729
virtual int64_t get_field_internal(const StructuredBlock *sb, const Field &field, void *data, size_t data_size) const =0
bool usingParallelIO
Definition Ioss_DatabaseIO.h:788
void set_use_generic_canonical_name(bool yes_no)
Definition Ioss_DatabaseIO.h:496
virtual int64_t put_field_internal(const ElementSet *ns, const Field &field, void *data, size_t data_size) const =0
double timeScaleFactor
Definition Ioss_DatabaseIO.h:770
int64_t get_zc_field(const T *reg, const Field &field, void **data, size_t *data_size) const
Definition Ioss_DatabaseIO.h:472
DatabaseIO & operator=(DatabaseIO &&)=delete
virtual bool open_internal_change_set_nl(int)
Definition Ioss_DatabaseIO.h:844
IOSS_NODISCARD bool is_parallel_consistent() const
Definition Ioss_DatabaseIO.h:492
virtual void flush_database_nl() const
Definition Ioss_DatabaseIO.h:816
IOSS_NODISCARD const Ioss::NameList & get_qa_records() const
Get all QA records, each of which consists of 4 strings, from the database.
Definition Ioss_DatabaseIO.h:430
void set_file_per_state(bool yes_no) const
Definition Ioss_DatabaseIO.h:635
virtual int64_t get_field_internal(const NodeBlock *nb, const Field &field, void *data, size_t data_size) const =0
Ioss::Map edgeMap
Definition Ioss_DatabaseIO.h:808
DatabaseIO & operator=(const DatabaseIO &)=delete
virtual void set_maximum_symbol_length(int)
Definition Ioss_DatabaseIO.h:512
void set_common_side_topology() const
Definition Ioss_DatabaseIO.C:806
IOSS_NODISCARD bool get_field_recognition() const
Definition Ioss_DatabaseIO.h:518
virtual bool supports_internal_change_set_nl()
Definition Ioss_DatabaseIO.h:842
bool open_internal_change_set(int set_index)
If a database type supports internal change sets, open the change set specified [zero-based] index.
Definition Ioss_DatabaseIO.h:295
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:641
virtual int64_t get_field_internal(const CommSet *cs, const Field &field, void *data, size_t data_size) const =0
void get_block_adjacencies(const Ioss::ElementBlock *eb, Ioss::NameList &block_adjacency) const
Definition Ioss_DatabaseIO.h:565
virtual int64_t node_global_to_local_nl(int64_t global, bool must_exist) const
Definition Ioss_DatabaseIO.h:832
virtual Ioss::NameList internal_change_set_describe_nl(bool)
Definition Ioss_DatabaseIO.h:847
Ioss::DatabaseUsage dbUsage
Definition Ioss_DatabaseIO.h:773
IOSS_NODISCARD int parallel_size() const
Definition Ioss_DatabaseIO.h:647
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
virtual void openDatabase_nl() const
Definition Ioss_DatabaseIO.C:568
Ioss::NameList assemblyInclusions
Definition Ioss_DatabaseIO.h:800
bool lowerCaseVariableNames
Definition Ioss_DatabaseIO.h:786
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
std::vector< double > get_db_step_times()
Return the list of timesteps in the database contingent on certain controlling properties.
Definition Ioss_DatabaseIO.h:391
virtual bool ok_nl(bool, std::string *, int *bad_count) const
Definition Ioss_DatabaseIO.h:823
virtual void reset_database_nl()
Definition Ioss_DatabaseIO.C:1564
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:557
bool lowerCaseDatabaseNames
Definition Ioss_DatabaseIO.h:787
Region * region_
Definition Ioss_DatabaseIO.h:983
ElementTopology * commonSideTopology
Definition Ioss_DatabaseIO.h:696
IOSS_NODISCARD int int_byte_size_api() const
Returns 4 or 8.
Definition Ioss_DatabaseIO.C:384
virtual IOSS_NODISCARD int get_file_pointer() const
Definition Ioss_DatabaseIO.h:180
Ioss::Map faceMap
Definition Ioss_DatabaseIO.h:809
virtual int64_t get_zc_field_internal(const Region *reg, const Field &field, void **data, size_t *data_size) const
Definition Ioss_DatabaseIO.C:1466
Ioss::State dbState
Definition Ioss_DatabaseIO.h:732
void get_step_times()
Definition Ioss_DatabaseIO.h:375
int num_internal_change_set()
If a database type supports internal change sets, and if the database contains internal change sets,...
Definition Ioss_DatabaseIO.h:283
void reset_database()
Definition Ioss_DatabaseIO.h:249
void set_surface_split_type(Ioss::SurfaceSplitType split_type)
Definition Ioss_DatabaseIO.h:556
IOSS_NODISCARD std::string get_pfs_name() const
Definition Ioss_DatabaseIO.h:140
virtual void compute_block_membership_nl(Ioss::SideBlock *, Ioss::NameList &) const
Definition Ioss_DatabaseIO.h:865
IOSS_NODISCARD bool using_dw() const
Definition Ioss_DatabaseIO.h:168
IOSS_NODISCARD int get_cycle_count() const
Definition Ioss_DatabaseIO.h:632
bool m_enableTracing
Definition Ioss_DatabaseIO.h:1009
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:398
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
bool open_internal_change_set(const std::string &set_name)
If a database type supports internal change sets and if the database contains internal change sets,...
Definition Ioss_DatabaseIO.h:262
void ignore_database_names(bool yes_no)
Definition Ioss_DatabaseIO.h:499
void set_field_recognition(bool yes_no)
Definition Ioss_DatabaseIO.h:521
void compute_block_membership(Ioss::SideBlock *efblock, Ioss::NameList &block_membership) const
Definition Ioss_DatabaseIO.h:569
IOSS_NODISCARD int64_t element_global_to_local(int64_t global) const
Definition Ioss_DatabaseIO.h:112
bool m_ignoreRealnFields
Definition Ioss_DatabaseIO.h:1010
Ioss::NameList informationRecords
Definition Ioss_DatabaseIO.h:802
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:648
DuplicateFieldBehavior duplicateFieldBehavior
Definition Ioss_DatabaseIO.h:985
IOSS_NODISCARD bool get_field_strip_trailing_() const
Definition Ioss_DatabaseIO.h:519
IOSS_NODISCARD const Ioss::ParallelUtils & util() const
Definition Ioss_DatabaseIO.h:640
Ioss::NameList assemblyOmissions
Definition Ioss_DatabaseIO.h:799
IOSS_NODISCARD Region * get_region() const
Definition Ioss_DatabaseIO.h:586
void set_field_strip_trailing_(bool yes_no)
Definition Ioss_DatabaseIO.h:522
bool verify_field_data(const GroupingEntity *ge, const Field &field, Ioss::Field::InOut in_out, void *data) const
Definition Ioss_DatabaseIO.C:605
IOSS_NODISCARD int get_overlay_count() const
Definition Ioss_DatabaseIO.h:634
Ioss::SurfaceSplitType splitType
Definition Ioss_DatabaseIO.h:772
virtual IOSS_NODISCARD bool node_major() const
Definition Ioss_DatabaseIO.h:123
bool create_internal_change_set(const std::string &set_name)
If a database type supports internal change sets, create the specified set.
Definition Ioss_DatabaseIO.h:274
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 set_int_byte_size_api(Ioss::DataSize size) const
Returns 4 or 8.
Definition Ioss_DatabaseIO.C:396
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:495
virtual void finalize_database() const
Definition Ioss_DatabaseIO.h:135
int64_t nodeCount
Definition Ioss_DatabaseIO.h:736
virtual std::vector< double > get_db_step_times_nl()
Definition Ioss_DatabaseIO.h:857
IOSS_NODISCARD bool get_file_per_state() const
Definition Ioss_DatabaseIO.h:636
virtual int64_t element_global_to_local_nl(int64_t global) const
Definition Ioss_DatabaseIO.h:837
bool isParallel
true if running in parallel
Definition Ioss_DatabaseIO.h:784
void progress(const std::string &output) const
Definition Ioss_DatabaseIO.h:650
bool blockAdjacenciesCalculated
Definition Ioss_DatabaseIO.h:1005
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:435
int64_t get_field(const T *reg, const Field &field, void *data, size_t data_size) const
Definition Ioss_DatabaseIO.h:446
virtual int64_t put_field_internal(const EdgeBlock *nb, const Field &field, void *data, size_t data_size) const =0
virtual bool open_internal_change_set_nl(const std::string &)
Definition Ioss_DatabaseIO.h:843
IOSS_NODISCARD DuplicateFieldBehavior get_duplicate_field_behavior() const
Definition Ioss_DatabaseIO.h:524
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:459
virtual int64_t get_field_internal(const ElementBlock *eb, const Field &field, void *data, size_t data_size) const =0
char fieldSeparator
Definition Ioss_DatabaseIO.h:984
Ioss::NameList blockInclusions
Definition Ioss_DatabaseIO.h:798
Ioss::PropertyManager properties
Definition Ioss_DatabaseIO.h:686
IOSS_NODISCARD bool ignore_database_names() const
Definition Ioss_DatabaseIO.h:498
virtual void get_step_times_nl()
Definition Ioss_DatabaseIO.h:856
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:974
std::vector< std::vector< bool > > blockAdjacency
Definition Ioss_DatabaseIO.h:812
Ioss::NameList qaRecords
Definition Ioss_DatabaseIO.h:803
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:68
Base class for all 'block'-type grouping entities, which means all members of the block are similar o...
Definition Ioss_EntityBlock.h:38
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
@ OUTPUT
Definition Ioss_Field.h:41
@ INPUT
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:32
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
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
@ ERROR_
Definition Ioss_DatabaseIO.h:54
@ IGNORE_
Definition Ioss_DatabaseIO.h:54
@ UNSET_
Definition Ioss_DatabaseIO.h:54
@ WARNING_
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
Ioss::NameList NameList
Definition Ioss_ChangeSetFactory.h:25
IfDatabaseExistsBehavior
Definition Ioss_DBUsage.h:32
EntityType
The particular type of GroupingEntity.
Definition Ioss_EntityType.h:12
Definition Ioss_BoundingBox.h:13