|
IOSS
2.0
|
An input or output Database. More...
#include <Ioss_DatabaseIO.h>
Public Member Functions | |
| bool | ok (bool write_message=false, std::string *error_message=nullptr, int *bad_count=nullptr) const |
| Check to see if database state is OK. More... | |
| virtual unsigned | entity_field_support () const =0 |
| bool | using_parallel_io () const |
| 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. More... | |
| int64_t | element_global_to_local (int64_t global) const |
| virtual bool | node_major () const |
| virtual | ~DatabaseIO () |
| void | release_memory () |
| virtual void | finalize_database () |
| std::string | get_filename () const |
| Get the file name associated with the database. More... | |
| const std::string & | decoded_filename () const |
| Get a file-per-processor filename associated with the database. More... | |
| bool | is_input () const |
| Determine whether the database is an input database. More... | |
| Ioss::DatabaseUsage | usage () const |
| Get the Ioss::DatabaseUsage type of the database. More... | |
| virtual bool | needs_shared_node_information () const |
| Determine whether the database needs information about process ownership of nodes. More... | |
| Ioss::IfDatabaseExistsBehavior | open_create_behavior () const |
| void | create_path (const std::string &filename) const |
| This function is used to create the path to an output directory (or history, restart, etc.) More... | |
| void | set_region (Region *region) |
| void | openDatabase () const |
| void | closeDatabase () const |
| void | flush_database () const |
| bool | open_group (const std::string &group_name) |
| If a database type supports groups and if the database contains groups, open the specified group. More... | |
| 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. More... | |
| bool | begin (Ioss::State state) |
| Set the database to the given State. More... | |
| bool | end (Ioss::State state) |
| Return the database to STATE_CLOSED. More... | |
| bool | begin_state (Region *region, int state, double time) |
| bool | end_state (Region *region, int state, double time) |
| void | read_meta_data () |
| void | get_step_times () |
| virtual bool | internal_edges_available () const |
| virtual bool | internal_faces_available () const |
| const std::vector< std::string > & | get_information_records () const |
| Get all information records (informative strings) for the database. More... | |
| void | add_information_records (const std::vector< std::string > &info) |
| Add multiple information records (informative strings) to the database. More... | |
| void | add_information_record (const std::string &info) |
| Add an information record (an informative string) to the database. More... | |
| const std::vector< std::string > & | get_qa_records () const |
| Get all QA records, each of which consists of 4 strings, from the database. More... | |
| 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. More... | |
| bool | get_logging () const |
| void | set_logging (bool on_off) |
| template<typename T > | |
| int64_t | get_field (const T *reg, const Field &field, void *data, size_t data_size) const |
| template<typename T > | |
| int64_t | put_field (const T *reg, const Field &field, void *data, size_t data_size) const |
| bool | is_parallel_consistent () const |
| void | set_parallel_consistency (bool on_off) |
| bool | get_use_generic_canonical_name () const |
| void | set_use_generic_canonical_name (bool yes_no) |
| bool | ignore_database_names () const |
| void | ignore_database_names (bool yes_no) |
| virtual int | maximum_symbol_length () const |
| Get the length of the longest name in the database file. More... | |
| virtual void | set_maximum_symbol_length (int) |
| char | get_field_separator () const |
| bool | get_field_recognition () const |
| void | set_field_separator (char separator) |
| Set the character used to separate a field suffix from the field basename when recognizing vector, tensor fields. More... | |
| void | set_field_recognition (bool yes_no) |
| void | set_lower_case_variable_names (bool true_false) const |
| void | set_surface_split_type (Ioss::SurfaceSplitType split_type) |
| Ioss::SurfaceSplitType | get_surface_split_type () const |
| void | set_block_omissions (const std::vector< std::string > &omissions, const std::vector< std::string > &inclusions={}) |
| void | get_block_adjacencies (const Ioss::ElementBlock *eb, std::vector< std::string > &block_adjacency) const |
| void | compute_block_membership (Ioss::SideBlock *efblock, std::vector< std::string > &block_membership) const |
| AxisAlignedBoundingBox | get_bounding_box (const Ioss::ElementBlock *eb) const |
| AxisAlignedBoundingBox | get_bounding_box (const Ioss::StructuredBlock *sb) const |
| virtual int | int_byte_size_db () const =0 |
| int | int_byte_size_api () const |
| Returns 4 or 8. More... | |
| virtual void | set_int_byte_size_api (Ioss::DataSize size) const |
| Returns 4 or 8. More... | |
| Region * | get_region () const |
| void | set_cycle_count (int count) const |
| void | set_overlay_count (int count) const |
| void | set_time_scale_factor (double factor) |
| const Ioss::ParallelUtils & | util () const |
| const Ioss::PropertyManager & | get_property_manager () const |
| int | parallel_rank () const |
| Get the processor that this mesh database is on. More... | |
| int | parallel_size () const |
| bool | is_parallel () const |
| template<> | |
| void | create_group (EntityType type, const std::string &, const std::vector< std::string > &group_spec, const SideSet *) |
Protected Member Functions | |
| DatabaseIO (Region *region, std::string filename, Ioss::DatabaseUsage db_usage, MPI_Comm communicator, const Ioss::PropertyManager &props) | |
| void | set_common_side_topology () const |
| template<typename T > | |
| void | create_groups (const std::string &property_name, EntityType type, const std::string &type_name, const T *set_type) |
| template<typename T > | |
| void | create_group (EntityType type, const std::string &type_name, const std::vector< std::string > &group_spec, const T *set_type) |
| void | handle_groups () |
| void | check_side_topology () const |
Private Member Functions | |
| virtual bool | ok__ (bool write_message, std::string *error_message, int *bad_count) const |
| virtual int64_t | node_global_to_local__ (int64_t global, bool must_exist) const |
| virtual int64_t | element_global_to_local__ (int64_t global) const |
| virtual void | release_memory__ () |
| virtual void | openDatabase__ () const |
| virtual void | closeDatabase__ () const |
| virtual void | flush_database__ () const |
| virtual bool | open_group__ (const std::string &group_name) |
| virtual bool | create_subgroup__ (const std::string &group_name) |
| virtual bool | begin__ (Ioss::State state)=0 |
| virtual bool | end__ (Ioss::State state)=0 |
| virtual void | read_meta_data__ ()=0 |
| virtual void | get_step_times__ () |
| virtual bool | begin_state__ (Region *region, int state, double time) |
| virtual bool | end_state__ (Region *region, int state, double time) |
| void | get_block_adjacencies__ (const Ioss::ElementBlock *eb, std::vector< std::string > &block_adjacency) const |
| virtual void | compute_block_membership__ (Ioss::SideBlock *efblock, std::vector< std::string > &block_membership) const |
| void | compute_block_adjacencies () const |
| void | verify_and_log (const GroupingEntity *ge, const Field &field, int in_out) const |
| virtual int64_t | get_field_internal (const Region *reg, const Field &field, void *data, size_t data_size) const =0 |
| virtual int64_t | get_field_internal (const NodeBlock *nb, const Field &field, void *data, size_t data_size) const =0 |
| virtual int64_t | get_field_internal (const EdgeBlock *nb, const Field &field, void *data, size_t data_size) const =0 |
| virtual int64_t | get_field_internal (const FaceBlock *nb, const Field &field, void *data, size_t data_size) const =0 |
| virtual int64_t | get_field_internal (const ElementBlock *eb, const Field &field, void *data, size_t data_size) const =0 |
| virtual int64_t | get_field_internal (const SideBlock *fb, const Field &field, void *data, size_t data_size) const =0 |
| virtual int64_t | get_field_internal (const NodeSet *ns, const Field &field, void *data, size_t data_size) const =0 |
| virtual int64_t | get_field_internal (const EdgeSet *ns, const Field &field, void *data, size_t data_size) const =0 |
| virtual int64_t | get_field_internal (const FaceSet *ns, const Field &field, void *data, size_t data_size) const =0 |
| virtual int64_t | get_field_internal (const ElementSet *ns, const Field &field, void *data, size_t data_size) const =0 |
| virtual int64_t | get_field_internal (const SideSet *fs, const Field &field, void *data, size_t data_size) const =0 |
| virtual int64_t | get_field_internal (const CommSet *cs, const Field &field, void *data, size_t data_size) const =0 |
| virtual int64_t | get_field_internal (const StructuredBlock *, const Field &, void *, size_t) const |
| virtual int64_t | put_field_internal (const Region *reg, 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 |
| virtual int64_t | put_field_internal (const EdgeBlock *nb, const Field &field, void *data, size_t data_size) const =0 |
| virtual int64_t | put_field_internal (const FaceBlock *nb, const Field &field, void *data, size_t data_size) const =0 |
| virtual int64_t | put_field_internal (const ElementBlock *eb, const Field &field, void *data, size_t data_size) const =0 |
| virtual int64_t | put_field_internal (const SideBlock *fb, const Field &field, void *data, size_t data_size) const =0 |
| virtual int64_t | put_field_internal (const NodeSet *ns, const Field &field, void *data, size_t data_size) const =0 |
| virtual int64_t | put_field_internal (const EdgeSet *ns, const Field &field, void *data, size_t data_size) const =0 |
| virtual int64_t | put_field_internal (const FaceSet *ns, const Field &field, void *data, size_t data_size) const =0 |
| virtual int64_t | put_field_internal (const ElementSet *ns, const Field &field, void *data, size_t data_size) const =0 |
| virtual int64_t | put_field_internal (const SideSet *fs, const Field &field, void *data, size_t data_size) const =0 |
| 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 StructuredBlock *, const Field &, void *, size_t) const |
| DatabaseIO ()=delete | |
| DatabaseIO (const DatabaseIO &)=delete | |
| DatabaseIO & | operator= (const DatabaseIO &)=delete |
Private Attributes | |
| std::map< std::string, AxisAlignedBoundingBox > | elementBlockBoundingBoxes |
| Ioss::ParallelUtils | util_ |
| Region * | region_ {nullptr} |
| char | fieldSeparator {'_'} |
| bool | enableFieldRecognition {true} |
| bool | isInput |
| bool | isParallelConsistent |
| bool | singleProcOnly |
| bool | doLogging {false} |
| bool | useGenericCanonicalName |
| bool | ignoreDatabaseNames |
| bool | blockAdjacenciesCalculated {false} |
An input or output Database.
|
virtualdefault |
Reimplemented in Ioex::DatabaseIO, Iogn::DatabaseIO, Iohb::DatabaseIO, Iopx::DatabaseIO, Iocgns::DatabaseIO, Iofx::DatabaseIO, Iodw::DatabaseIO, Iopg::DatabaseIO, and Iovs::DatabaseIO.
|
protected |
|
privatedelete |
|
privatedelete |
| void Ioss::DatabaseIO::add_information_record | ( | const std::string & | info | ) |
Add an information record (an informative string) to the database.
| [in] | info | The string to add. |
| void Ioss::DatabaseIO::add_information_records | ( | const std::vector< std::string > & | info | ) |
Add multiple information records (informative strings) to the database.
| [in] | info | The strings to add. |
| void Ioss::DatabaseIO::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.
The 4 function parameters correspond to the 4 QA record strings.
| [in] | code | A descriptive code name, such as the application that modified the database. |
| [in] | code_qa | A descriptive string, such as the version of the application that modified the database. |
| [in] | date | A relevant date, such as the date the database was modified. |
| [in] | time | A relevant time, such as the time the database was modified. |
|
inline |
Set the database to the given State.
All transitions must begin from the 'STATE_CLOSED' state or be to the 'STATE_CLOSED' state (There are no nested begin/end pairs at this time.)
The database state is automatically set when Region::begin_mode is called for its associated region, so it may not be necessary to call this method directly.
| [in] | state | The new State to which the database should be set. |
|
privatepure virtual |
|
inline |
|
privatevirtual |
Reimplemented in Ioex::DatabaseIO, Iohb::DatabaseIO, Iogn::DatabaseIO, Iodw::DatabaseIO, Iopg::DatabaseIO, Iocgns::ParallelDatabaseIO, Iocgns::DatabaseIO, and Iovs::DatabaseIO.
|
protected |
Check the topology of all face/element pairs in the model and fill the "TopoContainer faceTopology" variable with the unique pairs. This information is used for the faceblock/facesets and edgeblock/edgesets. If the 'topo_dimension' is 2, then face/element pairs are generated; if 'topo_dimension' is 1, then edge/element pairs are generated.
|
inline |
|
inlineprivatevirtual |
Reimplemented in Ioex::DatabaseIO, Iocgns::DatabaseIO, and Iocgns::ParallelDatabaseIO.
|
private |
|
inline |
|
inlineprivatevirtual |
Reimplemented in Ioex::DatabaseIO.
| void Ioss::DatabaseIO::create_group | ( | EntityType | type, |
| const std::string & | , | ||
| const std::vector< std::string > & | group_spec, | ||
| const SideSet * | |||
| ) |
|
protected |
|
protected |
| void Ioss::DatabaseIO::create_path | ( | const std::string & | filename | ) | const |
This function is used to create the path to an output directory (or history, restart, etc.)
|
inline |
If a database type supports groups, create the specified group as a child of the current group.
The name of the group must not contain a '/' character. If the command is successful, then the group will be the active group for all subsequent writes to the database.
| [in] | group_name | The name of the subgroup to create. |
|
inlineprivatevirtual |
Reimplemented in Ioex::DatabaseIO.
| const std::string & Ioss::DatabaseIO::decoded_filename | ( | ) | const |
Get a file-per-processor filename associated with the database.
\ returns The file-per-processor name for a file on this processor.
|
inline |
|
inlineprivatevirtual |
Reimplemented in Iohb::DatabaseIO, Iocgns::ParallelDatabaseIO, and Iocgns::DatabaseIO.
|
inline |
Return the database to STATE_CLOSED.
The database is automatically set to STATE_CLOSED when Region::end_mode is called for its associated region, so it may not be necessary to call this method directly.
| [in] | state | The State to end, i.e. the current state. |
|
privatepure virtual |
|
inline |
|
privatevirtual |
Reimplemented in Ioex::DatabaseIO, Iohb::DatabaseIO, Iogn::DatabaseIO, Iodw::DatabaseIO, Iopg::DatabaseIO, Iocgns::ParallelDatabaseIO, Iocgns::DatabaseIO, and Iovs::DatabaseIO.
|
pure virtual |
|
inlinevirtual |
Reimplemented in Iocgns::ParallelDatabaseIO, and Iocgns::DatabaseIO.
|
inline |
|
inlineprivatevirtual |
Reimplemented in Ioex::DatabaseIO, and Iohb::DatabaseIO.
|
inline |
|
private |
| AxisAlignedBoundingBox Ioss::DatabaseIO::get_bounding_box | ( | const Ioss::ElementBlock * | eb | ) | const |
| AxisAlignedBoundingBox Ioss::DatabaseIO::get_bounding_box | ( | const Ioss::StructuredBlock * | sb | ) | const |
|
inline |
|
privatepure virtual |
|
privatepure virtual |
|
inlineprivatevirtual |
|
inline |
|
inline |
|
inline |
Get the file name associated with the database.
|
inline |
Get all information records (informative strings) for the database.
|
inline |
|
inline |
|
inline |
Get all QA records, each of which consists of 4 strings, from the database.
The 4 strings that make up a database QA record are:
|
inline |
The owning region of this database.
|
inline |
|
inlineprivatevirtual |
Reimplemented in Ioex::DatabaseIO, Iocgns::ParallelDatabaseIO, Iogn::DatabaseIO, Iocgns::DatabaseIO, Iopx::DatabaseIO, and Iofx::DatabaseIO.
|
inline |
|
inline |
|
protected |
|
inline |
|
inline |
| int Ioss::DatabaseIO::int_byte_size_api | ( | ) | const |
Returns 4 or 8.
|
pure virtual |
Implemented in Ioex::DatabaseIO, Iocgns::ParallelDatabaseIO, Iogn::DatabaseIO, Iohb::DatabaseIO, Iopg::DatabaseIO, Iocgns::DatabaseIO, and Iovs::DatabaseIO.
|
inlinevirtual |
|
inlinevirtual |
|
inline |
Determine whether the database is an input database.
|
inline |
|
inline |
Determine whether application will make field data get/put calls parallel consistently.
True is default and required for parallel-io databases. Even if false, metadata operations must be called by all processors.
|
inlinevirtual |
Get the length of the longest name in the database file.
Reimplemented in Ioex::DatabaseIO, Iodw::DatabaseIO, and Iopg::DatabaseIO.
|
inlinevirtual |
Determine whether the database needs information about process ownership of nodes.
Reimplemented in Iocgns::ParallelDatabaseIO, and Iopx::DatabaseIO.
|
inline |
Get the local (process-specific) node number corresponding to a global node number.
| [in] | global | The global node number |
| [in] | must_exist | If true, error will occur if the global node number is not mapped to any local node number on the current process. |
|
inlineprivatevirtual |
Reimplemented in Iohb::DatabaseIO, Iocgns::ParallelDatabaseIO, and Iocgns::DatabaseIO.
|
inlinevirtual |
If there is a single block of nodes in the model, then it is considered a node_major() database. If instead the nodes are local to each element block or structured block, then it is not a node_major database. Exodus is node major, CGNS is not.
Reimplemented in Iocgns::ParallelDatabaseIO, and Iocgns::DatabaseIO.
|
inline |
Check to see if database state is OK.
| [in] | write_message | If true, then output a warning message indicating the problem. |
| [in,out] | error_message | If non-null on input, then a warning message on output. |
| [in,out] | bad_count | If non-null on input, then count of the number of processors where the file does not exist on output. If ok returns false, but *bad_count==0, then the routine does not support this argument. |
|
inlineprivatevirtual |
Reimplemented in Ioex::DatabaseIO, Iopx::DatabaseIO, and Iofx::DatabaseIO.
| IfDatabaseExistsBehavior Ioss::DatabaseIO::open_create_behavior | ( | ) | const |
|
inline |
If a database type supports groups and if the database contains groups, open the specified group.
If the group_name begins with '/', it specifies the absolute path name from the root with '/' separating groups. Otherwise, the group_name specifies a child group of the currently active group. If group_name == "/" then the root group is opened.
| [in] | group_name | The name of the group to open. |
|
inlineprivatevirtual |
Reimplemented in Ioex::DatabaseIO.
|
inline |
|
inlineprivatevirtual |
Reimplemented in Ioex::DatabaseIO, Iocgns::DatabaseIO, and Iocgns::ParallelDatabaseIO.
|
privatedelete |
|
inline |
Get the processor that this mesh database is on.
|
inline |
|
inline |
|
privatepure virtual |
|
privatepure virtual |
|
inlineprivatevirtual |
|
inline |
|
privatepure virtual |
|
inline |
|
inlineprivatevirtual |
Reimplemented in Iopx::DatabaseIO, and Iocgns::ParallelDatabaseIO.
| void Ioss::DatabaseIO::set_block_omissions | ( | const std::vector< std::string > & | omissions, |
| const std::vector< std::string > & | inclusions = {} |
||
| ) |
|
protected |
Utility function that may be used by derived classes. Determines whether all elements in the model have the same side topology. This can be used to speed-up certain algorithms since they don't have to check each side (or group of sides) individually.
|
inline |
The overlay_count specifies the number of restart outputs which will be overlaid on top of the currently written step before advancing to the next step on the restart database.
For example, if restarts are being output every 0.1 seconds and the overlay count is specified as 2, then restart will write time 0.1 to step 1 of the database. It will then write 0.2 and 0.3 also to step 1. It will then increment the database step and write 0.4 to step 2; overlay 0.5 and 0.6 on step 2... At the end of the analysis, assuming it runs to completion, the database would have times 0.3, 0.6, 0.9, ... However, if there were a problem during the analysis, the last step on the database would contain an intermediate step.
The cycle_count specifies the number of restart steps which will be written to the restart database before previously written steps are overwritten.
For example, if the cycle count is 5 and restart is written every 0.1 seconds, the restart system will write data at times 0.1, 0.2, 0.3, 0.4, 0.5 to the database.
It will then overwrite the first step with data from time 0.6, the second with time 0.7. At time 0.8, the database would contain data at times 0.6, 0.7, 0.8, 0.4, 0.5. Note that time will not necessarily be monotonically increasing on a database that specifies the cycle count.
The cycle count and overlay count can both be used at the same time also. The basic formula is:
db_step = (((output_step - 1) / overlay) % cycle) + 1
where "output_step" is the step that this would have been on the database in a normal write (1,2,3,....) and "db_step" is the step number that this will be written to.
If you only want the last step available on the database, use set_cycle_count(1)
|
inline |
| void Ioss::DatabaseIO::set_field_separator | ( | char | separator | ) |
Set the character used to separate a field suffix from the field basename when recognizing vector, tensor fields.
| [in] | separator | The separator character. |
|
virtual |
Returns 4 or 8.
Set the number of bytes used to represent an integer.
| [in] | size | The number of bytes. This is 4 for INT32 or 8 for INT64. |
Reimplemented in Ioex::DatabaseIO.
|
inline |
|
inline |
|
inlinevirtual |
Reimplemented in Ioex::DatabaseIO.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get the Ioss::DatabaseUsage type of the database.
|
inline |
|
inline |
|
private |
|
mutableprivate |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
Typically used for restart output, but can be used for all output... Maximum number of states on the output file. Overwrite the existing steps in a cyclic manner once exceed this count. Note that this breaks the convention that times be monotonically increasing on an exodusII file. Used by derived classes if they support this capability...
|
protected |
Filename that this Database is connected with. Derived DatabaseIO classes may need to change this if the passed in filename is not the same as the filename actually used E.g., the Ioex_DatabaseIO (exodusII) changes if this is a parallel run since the passed in filename is just the basename, not the processor-specific filename.
|
mutableprotected |
|
mutableprotected |
|
protected |
|
mutableprotected |
|
private |
|
mutableprotected |
|
mutableprivate |
|
protected |
|
mutableprotected |
|
private |
|
mutableprotected |
|
private |
|
private |
|
protected |
|
private |
|
protected |
true if running in parallel
|
private |
|
mutableprotected |
|
protected |
number of processor this database is for
|
protected |
|
mutableprotected |
|
mutableprotected |
|
protected |
The properties member data contains properties that can be used to set database-specific options. Examples include compression, name lengths, integer sizes, floating point sizes. By convention, the property name is all uppercase. Some existing properties recognized by the Exodus DatabaseIO class are:
| Property | Value |
|---|---|
| COMPRESSION_LEVEL | In the range [0..9]. A value of 0 indicates no compression |
| COMPRESSION_SHUFFLE | (true/false) to enable/disable hdf5's shuffle compression |
algorithm. | FILE_TYPE | netcdf4 | MAXIMUM_NAME_LENGTH | Maximum length of names that will be returned/passed via api call. | INTEGER_SIZE_DB | 4 or 8 indicating byte size of integers stored on the database. | INTEGER_SIZE_API | 4 or 8 indicating byte size of integers used in api functions. | LOGGING | (true/false) to enable/disable logging of field input/output
|
protected |
|
private |
|
protected |
Used to speed up faceblock/edgeblock calculations.
|
private |
|
protected |
|
protected |
Scale the time read/written from/to the file by the specified scaleFactor. If the datbase times are 0.1, 0.2, 0.3 and the scaleFactor is 20, then the application will think that the times read are 20, 40, 60.
If specified for an output database, then the analysis time is divided by the scaleFactor time prior to output.
|
private |
|
protected |
|
private |