Sierra Toolkit
Version of the Day
|
Functions | |
size_t | db_api_int_size (const Ioss::GroupingEntity *entity) |
bool | invalid_rank (stk_classic::mesh::EntityRank rank) |
stk_classic::mesh::EntityRank | part_primary_entity_rank (const stk_classic::mesh::Part &part) |
stk_classic::mesh::EntityRank | element_rank (const stk_classic::mesh::MetaData &meta) |
stk_classic::mesh::EntityRank | side_rank (const stk_classic::mesh::MetaData &meta) |
stk_classic::mesh::EntityRank | face_rank (const stk_classic::mesh::MetaData &meta) |
stk_classic::mesh::EntityRank | edge_rank (const stk_classic::mesh::MetaData &meta) |
stk_classic::mesh::EntityRank | node_rank (const stk_classic::mesh::MetaData &meta) |
void | set_cell_topology (stk_classic::mesh::Part &part, const CellTopologyData *const cell_topology) |
const CellTopologyData * | get_cell_topology (const stk_classic::mesh::Part &part) |
void | initialize_spatial_dimension (stk_classic::mesh::fem::FEMMetaData &fem_meta, size_t spatial_dimension, const std::vector< std::string > &entity_rank_names) |
void | initialize_spatial_dimension (stk_classic::mesh::MetaData &meta, size_t spatial_dimension, const std::vector< std::string > &entity_rank_names) |
void | get_io_field_type (const stk_classic::mesh::FieldBase *field, const stk_classic::mesh::FieldRestriction &res, std::pair< std::string, Ioss::Field::BasicType > *result) |
const Ioss::GroupingEntity * | get_associated_ioss_entity (const mesh::Part &part) |
void | put_io_part_attribute (mesh::Part &part, Ioss::GroupingEntity *entity) |
void | remove_io_part_attribute (mesh::Part &part) |
bool | is_valid_part_field (const stk_classic::mesh::FieldBase *field, const stk_classic::mesh::EntityRank part_type, const stk_classic::mesh::Part &part, const stk_classic::mesh::Part &universal, const Ioss::Field::RoleType filter_role, bool add_all) |
const CellTopologyData * | map_topology_ioss_to_cell (const Ioss::ElementTopology *topology) |
std::string | map_topology_cell_to_ioss (const CellTopologyData *cell_top, int spatial_dimension) |
void | internal_part_processing (Ioss::GroupingEntity *entity, stk_classic::mesh::fem::FEMMetaData &meta) |
void | internal_part_processing (Ioss::EntityBlock *entity, stk_classic::mesh::fem::FEMMetaData &meta) |
void | internal_part_processing (Ioss::GroupingEntity *entity, stk_classic::mesh::MetaData &meta) |
void | internal_part_processing (Ioss::EntityBlock *entity, stk_classic::mesh::MetaData &meta) |
void | ioss_add_fields (const stk_classic::mesh::Part &part, const stk_classic::mesh::EntityRank part_type, Ioss::GroupingEntity *entity, const Ioss::Field::RoleType filter_role, const bool add_all) |
void | define_io_fields (Ioss::GroupingEntity *entity, Ioss::Field::RoleType role, stk_classic::mesh::Part &part, stk_classic::mesh::EntityRank part_type) |
template<typename INT > | |
void | get_entity_list (Ioss::GroupingEntity *io_entity, stk_classic::mesh::EntityRank part_type, const stk_classic::mesh::BulkData &bulk, std::vector< stk_classic::mesh::Entity *> &entities, INT) |
void | get_entity_list (Ioss::GroupingEntity *io_entity, stk_classic::mesh::EntityRank part_type, const stk_classic::mesh::BulkData &bulk, std::vector< stk_classic::mesh::Entity *> &entities) |
void | field_data_from_ioss (const stk_classic::mesh::FieldBase *field, std::vector< stk_classic::mesh::Entity *> &entities, Ioss::GroupingEntity *io_entity, const std::string &io_fld_name) |
void | field_data_to_ioss (const stk_classic::mesh::FieldBase *field, std::vector< stk_classic::mesh::Entity *> &entities, Ioss::GroupingEntity *io_entity, const std::string &io_fld_name, Ioss::Field::RoleType filter_role) |
bool | include_entity (const Ioss::GroupingEntity *entity) |
void | define_output_db (Ioss::Region &io_region, const mesh::BulkData &bulk_data, const Ioss::Region *input_region, const stk_classic::mesh::Selector *anded_selector, const bool sort_stk_parts) |
void | write_output_db (Ioss::Region &io_region, const stk_classic::mesh::BulkData &bulk, const stk_classic::mesh::Selector *anded_selector) |
bool | is_part_io_part (stk_classic::mesh::Part &part) |
const stk_classic::mesh::Field< double, stk_classic::mesh::ElementNode > * | get_distribution_factor_field (const stk_classic::mesh::Part &p) |
void | set_distribution_factor_field (stk_classic::mesh::Part &p, const stk_classic::mesh::Field< double, stk_classic::mesh::ElementNode > &df_field) |
const Ioss::Field::RoleType * | get_field_role (const stk_classic::mesh::FieldBase &f) |
void | set_field_role (stk_classic::mesh::FieldBase &f, const Ioss::Field::RoleType &role) |
template<typename T > | |
void | default_part_processing (const std::vector< T *> &entities, stk_classic::mesh::fem::FEMMetaData &fem_meta) |
template<typename T > | |
void | default_part_processing (const std::vector< T *> &entities, stk_classic::mesh::MetaData &meta, const stk_classic::mesh::EntityRank) |
void | show_mesh_help () |
void | create_input_mesh (const std::string &mesh_type, const std::string &mesh_filename, stk_classic::ParallelMachine comm, stk_classic::mesh::fem::FEMMetaData &fem_meta, stk_classic::io::MeshData &mesh_data, bool lower_case_variable_names) |
void | create_input_mesh (const std::string &mesh_type, const std::string &mesh_filename, stk_classic::ParallelMachine comm, stk_classic::mesh::fem::FEMMetaData &fem_meta, stk_classic::io::MeshData &mesh_data, const std::vector< std::string > &names_to_add, bool lower_case_variable_names) |
void | create_output_mesh (const std::string &filename, stk_classic::ParallelMachine comm, stk_classic::mesh::BulkData &bulk_data, MeshData &mesh_data, bool lower_case_variable_names) |
int | process_output_request (MeshData &mesh_data, stk_classic::mesh::BulkData &bulk, double time, const std::set< const stk_classic::mesh::Part *> &exclude) |
void | populate_bulk_data (stk_classic::mesh::BulkData &bulk_data, MeshData &mesh_data) |
void | process_mesh_bulk_data (Ioss::Region *region, stk_classic::mesh::BulkData &bulk_data) |
void | define_input_fields (MeshData &mesh_data, stk_classic::mesh::fem::FEMMetaData &fem_meta) |
void | define_output_fields (const MeshData &mesh_data, const stk_classic::mesh::fem::FEMMetaData &fem_meta, bool add_all_fields) |
void | process_input_request (MeshData &mesh_data, stk_classic::mesh::BulkData &bulk, double time) |
void | process_input_request (MeshData &mesh_data, stk_classic::mesh::BulkData &bulk, int step) |
void | input_mesh_fields (Ioss::Region *region, stk_classic::mesh::BulkData &bulk, double time) |
void | input_mesh_fields (Ioss::Region *region, stk_classic::mesh::BulkData &bulk, int step) |
template<typename INT > | |
void | get_element_block_sizes (MeshData &mesh_data, std::vector< INT > &el_blocks) |
template void | get_element_block_sizes (MeshData &mesh_data, std::vector< int > &el_blocks) |
template void | get_element_block_sizes (MeshData &mesh_data, std::vector< int64_t > &el_blocks) |
The stk_classic::io namespace contains functions related to the transfer of data between the Ioss classes and the stk_classic::mesh classes. These functions do not provide a total turnkey mesh reading or results writing capability; rather, they provide helper functions for the application to use which make it easier to read and/or write the data. The application has full control over the mesh reading and results/restart writing.
The basic flow chart for reading mesh data from the Ioss and defining and populating an stk_classic::mesh structure is shown in the use_cases/io_example.cpp file.
void stk_classic::io::show_mesh_help | ( | ) |
Output a help message showing the valid options for the mesh read and options for generated mesh.
Definition at line 481 of file MeshReadWriteUtils.cpp.
void stk_classic::io::create_input_mesh | ( | const std::string & | type, |
const std::string & | filename, | ||
MPI_Comm | comm, | ||
stk_classic::mesh::fem::FEMMetaData & | metadata, | ||
MeshData & | mesh_data, | ||
bool | lower_case_variable_names = true |
||
) |
Read/Generate the metadata for mesh of the specified type. By default, all entities in the mesh (nodeblocks, element blocks, nodesets, sidesets) will have an associated stk mesh part created for it.
If the mesh_data argument contains a non-null m_input_region data member, then this is assumed to be a valid Ioss::Region* that should be used instead of opening the file and creating a new Ioss::Region.
Following this call, the 'populate_bulk_data()' function should be called to read the bulk data from the mesh and generate the corresponding stk mesh entities (nodes, elements, faces, ...)
Only the non-transient data stored in the mesh database will be accessed in this function. To access any transient field data that may be on the mesh database, use the 'define_input_fields()' function.
[in] | type | The format of the mesh that will be "read". Valid types are "exodus", "generated", "pamgen". |
[in] | filename | If the mesh type is file based ("exodus"), then this contains the full pathname to the file containing the mesh information. If the mesh type is a generated type, then this parameter contains data used by the generation routines. See the output from the show_mesh_help() function for details. |
[in] | comm | MPI Communicator to be used for all parallel communication needed to generate the mesh. |
[in,out] | meta_data | The STK meta data object which will be populated with parts and fields based on the mesh model described by the mesh in filename. The meta_data will not be committed by this function, so the caller will need to call meta_data.commit() after the function returns. |
[in,out] | mesh_data | A small class used for maintaining some state used by the stk_io routines. |
[in] | lower_case_variable_names | Sets the case for any varaible names. If true then characters are forced to be lower case. |
Definition at line 584 of file MeshReadWriteUtils.cpp.
void stk_classic::io::create_input_mesh | ( | const std::string & | type, |
const std::string & | filename, | ||
MPI_Comm | comm, | ||
stk_classic::mesh::fem::FEMMetaData & | metadata, | ||
MeshData & | mesh_data, | ||
const std::vector< std::string > & | names_to_add, | ||
bool | lower_case_variable_names = true |
||
) |
Read/Generate the metadata for mesh of the specified type. By default, all entities in the mesh (nodeblocks, element blocks, nodesets, sidesets) will have an associated stk mesh part created for it.
This version of the above call accepts a std::vector<std::string> argument of names to add to the entity_rank_names prior to populating it from the mesh file.
If the mesh_data argument contains a non-null m_input_region data member, then this is assumed to be a valid Ioss::Region* that should be used instead of opening the file and creating a new Ioss::Region.
Following this call, the 'populate_bulk_data()' function should be called to read the bulk data from the mesh and generate the corresponding stk mesh entities (nodes, elements, faces, ...)
Only the non-transient data stored in the mesh database will be accessed in this function. To access any transient field data that may be on the mesh database, use the 'define_input_fields()' function.
[in] | type | The format of the mesh that will be "read". Valid types are "exodus", "generated", "pamgen". |
[in] | filename | If the mesh type is file based ("exodus"), then this contains the full pathname to the file containing the mesh information. If the mesh type is a generated type, then this parameter contains data used by the generation routines. See the output from the show_mesh_help() function for details. |
[in] | comm | MPI Communicator to be used for all parallel communication needed to generate the mesh. |
[in,out] | meta_data | The STK meta data object which will be populated with parts and fields based on the mesh model described by the mesh in filename. The meta_data will not be committed by this function, so the caller will need to call meta_data.commit() after the function returns. |
[in,out] | mesh_data | A small class used for maintaining some state used by the stk_io routines. |
[in] | names_to_add | to the entity_rank_names array prior to reading the mesh. |
[in] | lower_case_variable_names | Sets the case for any varaible names. If true then characters are forced to be lower case. |
Definition at line 629 of file MeshReadWriteUtils.cpp.
void stk_classic::io::create_output_mesh | ( | const std::string & | filename, |
MPI_Comm | comm, | ||
stk_classic::mesh::BulkData & | bulk_data, | ||
MeshData & | mesh_data, | ||
bool | lower_case_variable_names = true |
||
) |
Create an exodus mesh database with the specified filename. This function creates the exodus metadata which is the number and type of element blocks, nodesets, and sidesets; and then outputs the mesh bulk data such as the node coordinates, id maps, element connectivity. When the function returns, the non-transient portion of the mesh will have been defined.
A stk part will have a corresponding exodus entity (element block, nodeset, sideset) defined if the "is_io_part()" function returns true. By default, all parts read from the mesh database in the create_input_mesh() function will return true as will all stk parts on which the function stk_classic::io::put_io_part_attribute() was called. The function stk_classic::io::remove_io_part_attribute(part) can be called to omit a part from being output.
[in] | filename | The full pathname to the file which will be created and the mesh data written to. If the file already exists, it will be overwritten. |
[in] | comm | MPI Communicator to be used for all parallel communication needed by the mesh routines. |
[in] | bulk | The STK bulk data object defining the stk mesh. |
[in,out] | mesh_data | A small class used for maintaining some state used by the stk_io routines. |
[in] | lower_case_variable_names | Sets the case for any varaible names. If true then characters are forced to be lower case. |
Definition at line 682 of file MeshReadWriteUtils.cpp.
int stk_classic::io::process_output_request | ( | MeshData & | mesh_data, |
stk_classic::mesh::BulkData & | bulk, | ||
double | time, | ||
const std::set< const stk_classic::mesh::Part * > & | exclude = std::set< const stk_classic::mesh::Part * >() |
||
) |
Add a transient step to the mesh database at time 'time' and output the data for all defined fields to the database.
Definition at line 723 of file MeshReadWriteUtils.cpp.
void stk_classic::io::populate_bulk_data | ( | stk_classic::mesh::BulkData & | bulk_data, |
stk_classic::io::MeshData & | mesh_data | ||
) |
Read/Generate the bulk data for the mesh. The bulk_data must have been constructed using the meta_data passed to the create_input_mesh() function and the mesh_data must also be the same. This function will create all stk mesh entities (nodes, elements) with the correct nodeal coordinates, element connectivity, element attribute data, and nodeset and sideset membership. Note that meta_data.commit() needs to be called prior to calling this function.
Definition at line 740 of file MeshReadWriteUtils.cpp.
void stk_classic::io::process_mesh_bulk_data | ( | Ioss::Region * | region, |
stk_classic::mesh::BulkData & | bulk_data | ||
) |
Read/Generate the bulk data for the mesh. The bulk_data must have been constructed using the meta_data passed to the create_input_mesh() function and the mesh_data must also be the same. This function will create all stk mesh entities (nodes, elements) with the correct nodal coordinates, element connectivity, element attribute data, and nodeset and sideset membership. Note that meta_data.commit() followed by bulk_data.modification_begin() needs to be called prior to calling this function. Further, bulk_data.modification_end() must be called upon return from this function. The above populate_bulk_data call is a wrapper for this function.
Definition at line 758 of file MeshReadWriteUtils.cpp.
void stk_classic::io::define_input_fields | ( | MeshData & | mesh_data, |
stk_classic::mesh::fem::FEMMetaData & | meta_data | ||
) |
Iterate over all Ioss entities in the input mesh database and define a stk field for each transient field found. The stk field will have the same name as the field on the database.
Note that all transient fields found on the mesh database will have a corresponding stk field defined. If you want just a selected subset of the database fields defined in the stk mesh, you need to define the fields manually.
To populate the stk field with data from the database, call process_input_request().
Definition at line 928 of file MeshReadWriteUtils.cpp.
void stk_classic::io::define_output_fields | ( | const MeshData & | mesh_data, |
const stk_classic::mesh::fem::FEMMetaData & | fem_meta, | ||
bool | add_all_fields = false |
||
) |
Iterate over all stk fields and for each transient field defined on a part that is output to the mesh file, define a corresponding database field. The database field will have the same name as the stk field. A transient field will be defined if the stk_classic::io::is_valid_part_field() returns true. This can be set via a call to stk_classic::io::set_field_role().
If the 'add_all_fields' param is true, then all transient stk fields will have a corresponding database field defined.
Definition at line 951 of file MeshReadWriteUtils.cpp.
void stk_classic::io::process_input_request | ( | MeshData & | mesh_data, |
stk_classic::mesh::BulkData & | bulk, | ||
double | time | ||
) |
For all transient input fields defined either manually or via the define_input_fields() function, read the data at the specified database time 'time' and populate the stk data structures with those values. The database time closest to the specified time will be used with no interpolation (yet).
Definition at line 986 of file MeshReadWriteUtils.cpp.
void stk_classic::io::process_input_request | ( | MeshData & | mesh_data, |
stk_classic::mesh::BulkData & | bulk, | ||
int | step | ||
) |
For all transient input fields defined either manually or via the define_input_fields() function, read the data at the specified database step 'step' (1-based) and populate the stk data structures with those values.
Definition at line 1007 of file MeshReadWriteUtils.cpp.
void stk_classic::io::input_mesh_fields | ( | Ioss::Region * | region, |
stk_classic::mesh::BulkData & | bulk_data, | ||
double | time | ||
) |
For all transient input fields defined either manually or via the define_input_fields() function, read the data at the specified database time 'time' and populate the stk data structures with those values. The database time closest to the specified time will be used with no interpolation (yet). Note that bulk_data.modification_begin() needs to be called prior to calling this function. Further, bulk_data.modification_end() must be called upon return from this function.
Definition at line 1028 of file MeshReadWriteUtils.cpp.
void stk_classic::io::input_mesh_fields | ( | Ioss::Region * | region, |
stk_classic::mesh::BulkData & | bulk_data, | ||
int | step | ||
) |
For all transient input fields defined either manually or via the define_input_fields() function, read the data at the specified database step 'step' (1-based) and populate the stk data structures with those values. Note that bulk_data.modification_begin() needs to be called prior to calling this function. Further, bulk_data.modification_end() must be called upon return from this function. Also note that the two above functions are wrappers for this one.
Definition at line 1049 of file MeshReadWriteUtils.cpp.
void stk_classic::io::get_element_block_sizes | ( | MeshData & | mesh_data, |
std::vector< INT > & | el_blocks | ||
) |
Method to query a MeshData for the number of element blocks and the number of elements in each. MeshData is input, std:vector is output
Definition at line 1065 of file MeshReadWriteUtils.cpp.