IOSS 2.0

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