Sierra Toolkit
Version of the Day
|
Functions | |
void | process_nodeblocks (Ioss::Region ®ion, stk_classic::mesh::MetaData &meta) |
void | process_elementblocks (Ioss::Region ®ion, stk_classic::mesh::MetaData &meta) |
void | process_nodesets (Ioss::Region ®ion, stk_classic::mesh::MetaData &meta) |
void | process_sidesets (Ioss::Region ®ion, stk_classic::mesh::MetaData &meta) |
void | process_nodeblocks (Ioss::Region ®ion, stk_classic::mesh::BulkData &bulk) |
void | process_elementblocks (Ioss::Region ®ion, stk_classic::mesh::BulkData &bulk) |
void | process_nodesets (Ioss::Region ®ion, stk_classic::mesh::BulkData &bulk) |
void | process_sidesets (Ioss::Region ®ion, stk_classic::mesh::BulkData &bulk) |
void | process_input_request (Ioss::Region ®ion, stk_classic::mesh::BulkData &bulk, int step) |
void | process_output_request (Ioss::Region ®ion, stk_classic::mesh::BulkData &bulk, int step) |
void | io_example (stk_classic::ParallelMachine comm, const std::string &in_filename, const std::string &out_filename, const std::string &decomp_method) |
void | process_surface_entity (Ioss::SideSet *sset, stk_classic::mesh::MetaData &meta, stk_classic::mesh::EntityRank sset_rank) |
void | process_surface_entity (const Ioss::SideSet *sset, stk_classic::mesh::BulkData &bulk) |
void | get_field_data (stk_classic::mesh::BulkData &bulk, stk_classic::mesh::Part &part, stk_classic::mesh::EntityRank part_type, Ioss::GroupingEntity *io_entity, Ioss::Field::RoleType filter_role) |
void | put_field_data (stk_classic::mesh::BulkData &bulk, stk_classic::mesh::Part &part, stk_classic::mesh::EntityRank part_type, Ioss::GroupingEntity *io_entity, Ioss::Field::RoleType filter_role) |
Example code showing a basic, but complete, mesh to results output coding including subsetting and periodic field input and output. Includes handling of nodeblocks, element blocks, nodesets, and sidesets. Attribute fields and distribution factor fields are also supported.
This example can serve as the basis for adding binary IO support to an application. The code here uses the Ioss to/from stk_classic::mesh bridge functions in the stk_classic::io namespace defined in IossBridge.hpp include file.
void stk_example_io::process_nodeblocks | ( | Ioss::Region & | region, |
stk_classic::mesh::MetaData & | meta | ||
) |
Declare "coordinates" field and put it on the universal part. This example also defines all Ioss::Field::TRANSIENT fields that exist on the Ioss::Nodeblock as fields on the universal part.
Definition at line 368 of file io_example.cpp.
void stk_example_io::process_elementblocks | ( | Ioss::Region & | region, |
stk_classic::mesh::MetaData & | meta | ||
) |
Declare a part for each element block on the Ioss::Region 'region' unless the element block has the "omitted" property set to the value 1. The example then iterates each element block and defines any Ioss::Field::ATTRIBUTE and Ioss::Field::TRANSIENT fields that exist on the Ioss::ElementBlock as fields on the corresponding part.
Definition at line 393 of file io_example.cpp.
void stk_example_io::process_nodesets | ( | Ioss::Region & | region, |
stk_classic::mesh::MetaData & | meta | ||
) |
Declare a part for each Ioss::NodeSet on the Ioss::Region 'region' unless the nodeset has the "omitted" property set to the value 1. The example then iterates each nodeset and defines any "distribution factor" and Ioss::Field::TRANSIENT fields that exist on the Ioss::NodeSet as fields on the corresponding part.
Definition at line 439 of file io_example.cpp.
void stk_example_io::process_sidesets | ( | Ioss::Region & | region, |
stk_classic::mesh::MetaData & | meta | ||
) |
Declare a part for each Ioss::SideSet on the Ioss::Region 'region' unless the sideset has the "omitted" property set to the value 1. The example then iterates each sideset and defines any "distribution factor" and Ioss::Field::TRANSIENT fields that exist on the Ioss::SideSet as fields on the corresponding part.
Each sideblock in the active sidesets is then processed by defining a part for each Ioss::SideBlock on the Ioss::SideSet unless the sideblock has the "omitted" property set to the value
Definition at line 532 of file io_example.cpp.
void stk_example_io::process_nodeblocks | ( | Ioss::Region & | region, |
stk_classic::mesh::BulkData & | bulk | ||
) |
NOTE: This must be called after the process_elementblocks() call since there may be nodes that exist in the database that are not part of the analysis mesh due to subsetting of the element blocks.
Populates the "coordinates" field for all active nodes in the model.
Definition at line 553 of file io_example.cpp.
void stk_example_io::process_elementblocks | ( | Ioss::Region & | region, |
stk_classic::mesh::BulkData & | bulk | ||
) |
NOTE: This should be the first function called of any of the "process_X" type functions that take an stk_classic::mesh::BulkData argument, especially if the input Ioss::Region mesh is going to be subsetted (have element blocks omitted).
This function iterates all non-omitted element blocks and declares each element (and the corresponding nodes) in the element block. If there are any Ioss::Field::ATTRIBUTE fields on the element block (for example, shell thickness or particle radius), then that field data is alse read and the corresponding stk_classic::mesh::Field populated.
Definition at line 580 of file io_example.cpp.
void stk_example_io::process_nodesets | ( | Ioss::Region & | region, |
stk_classic::mesh::BulkData & | bulk | ||
) |
Iterates each non-omitted Ioss::NodeSet and then iterates each node in the Ioss::NodeSet. If the node exists (that is, it is connected to a non-omitted Ioss::ElementBlock), then that node is associated with the part corresponding to this Ioss::NodeSet. If the "distribution_factor" field exists, then that data is also associated with the field.
Definition at line 638 of file io_example.cpp.
void stk_example_io::process_sidesets | ( | Ioss::Region & | region, |
stk_classic::mesh::BulkData & | bulk | ||
) |
Process each non-omitted Ioss::SideSet and the contained non-omitted Ioss::SideBlock and associate each element-side pair with the corresponding part if the underlying element is active. If the "distribution_factor" field exists, then that data is also associated with the corresponding field.
Definition at line 743 of file io_example.cpp.
void stk_example_io::process_input_request | ( | Ioss::Region & | region, |
stk_classic::mesh::BulkData & | bulk, | ||
int | step | ||
) |
A minimal example function showing how field data on the Ioss::Region entities can be periodically transferred to the corresponding field(s) on the stk_classic::mesh entities. This would be used to bring in initial condition data or interpolation data or any other scenario in which data on the mesh file needs to be transferred to the stk_classic::mesh fields.
Definition at line 780 of file io_example.cpp.
void stk_example_io::process_output_request | ( | Ioss::Region & | region, |
stk_classic::mesh::BulkData & | bulk, | ||
int | step | ||
) |
A minimal example function showing how stk_classic::mesh field data can periodically be output to a results, history, heartbeat, or restart database. The scheduling would be done either in this function or at a higher level and is not shown here. The function iterates all parts and if there is a corresponding Ioss part on the Ioss::Region, all fields defined to be output are iterated and their data output to the corresponding Ioss::Field. The function calls the stk_classic::io::is_valid_part_field() function to determine whether the field should be output and then calls the stk_classic::io::field_data_to_ioss() function to do the actual output of the field.
Definition at line 853 of file io_example.cpp.
void stk_example_io::io_example | ( | stk_classic::ParallelMachine | comm, |
const std::string & | in_filename, | ||
const std::string & | out_filename, | ||
const std::string & | decomp_method | ||
) |
This function shows the basic calls needed to perform definition and input of the mesh model and definition and periodic output of a results database. The function is given the mesh filename and the output filename and goes through all steps of associating the filename with an Ioss::DatabaseIO object of the correct type ("exodusII" in this example); creating an Ioss::Region and then defining an stk_classic::mesh corresponding to this mesh. The function also provides an example of how specific element blocks existing in the mesh database could be omitted from the analysis model.
The example then shows how to define a results database corresponding to the analysis model and periodically output the results in an execute loop.
A true application would have to provide additional functionality and robustness, but the example shows how the basic functionality can be provided by an application.
Note that the paradigm illustrated here is different than the mesh input and output paradigm provided in the current framework. In this case, the application is responsible for the majority of the IO behavior and the toolkit only provides some helper functions to bridge between the Ioss and the stk_classic::mesh. It is hoped that this paradigm will result in more functionality for the application with less complication and overhead.
The real app would also only register a subset of the stk_classic::mesh fields as output fields and would probably have a mapping from the internally used name to some name picked by the user. In this example, all Ioss::Field::TRANSIENT fields defined on the stk_classic::mesh are output to the results database and the internal stk_classic::mesh field name is used as the name on the database....
Definition at line 162 of file io_example.cpp.
void stk_example_io::process_surface_entity | ( | Ioss::SideSet * | sset, |
stk_classic::mesh::MetaData & | meta, | ||
stk_classic::mesh::EntityRank | sset_rank | ||
) |
Definition at line 479 of file io_example.cpp.