|
omega_h
Reliable mesh adaptation
|
Classes | |
| struct | FieldComponent |
Typedefs | |
| typedef std::vector< std::string > | FieldNames |
Enumerations | |
| enum | ClassifyWith { NODE_SETS = 0x1 , SIDE_SETS = 0x2 } |
Functions | |
| int | open (filesystem::path const &path, bool verbose) |
| void | close (int exodus_file) |
| int | get_num_time_steps (int exodus_file) |
| void | read_nodal_fields (int exodus_file, Mesh *mesh, int time_step, std::string const &prefix="", std::string const &postfix="", bool verbose=false, bool merge_components=false) |
| Read nodal (vertex) fields from an open Exodus file into a mesh. More... | |
| void | read_element_fields (int exodus_file, Mesh *mesh, int time_step, std::string const &prefix="", std::string const &postfix="", bool verbose=false, bool merge_components=false) |
| Read element fields from an open Exodus file into a mesh. More... | |
| void | read_mesh (int exodus_file, Mesh *mesh, bool verbose=false, int classify_with=NODE_SETS|SIDE_SETS) |
| Read an Exodus II file into an Omega_h::Mesh and assign geometric classification. More... | |
| Mesh | read_sliced (filesystem::path const &path, CommPtr comm, bool verbose=false, int classify_with=NODE_SETS|SIDE_SETS, int time_step=-1, bool merge_components=false) |
| Collectively read an Exodus II file into a distributed Omega_h::Mesh. More... | |
| bool | isExcludedField (FieldNames excludedNodalFields, std::string fieldName) |
| void | write_nodal_fields (int exodus_file, Mesh *mesh, int time_step, std::string const &prefix, std::string const &postfix, FieldNames excludedNodalFields, bool verbose) |
| void | write (filesystem::path const &path, Mesh *mesh, bool verbose=false, int classify_with=NODE_SETS|SIDE_SETS, FieldNames excludedNodalFields=FieldNames()) |
| Write an Omega_h::Mesh to an Exodus II file. More... | |
Functions supporting Exodus II file I/O
| void Omega_h::exodus::read_element_fields | ( | int | exodus_file, |
| Mesh * | mesh, | ||
| int | time_step, | ||
| std::string const & | prefix = "", |
||
| std::string const & | postfix = "", |
||
| bool | verbose = false, |
||
| bool | merge_components = false |
||
| ) |
Read element fields from an open Exodus file into a mesh.
Identical to exodus::read_nodal_fields() except that element variables (EX_ELEM_BLOCK) are read and stored as tags on the element dimension (mesh->dim()) rather than on vertices.
| void Omega_h::exodus::read_mesh | ( | int | exodus_file, |
| Mesh * | mesh, | ||
| bool | verbose = false, |
||
| int | classify_with = NODE_SETS|SIDE_SETS |
||
| ) |
Read an Exodus II file into an Omega_h::Mesh and assign geometric classification.
Builds the Omega_h::Mesh from element blocks and derives entity classification from those blocks plus optional node sets and/or side sets, controlled by the classify_with bitmask (bitwise-OR of NODE_SETS and/or SIDE_SETS).
Classification is assigned as follows:
Node set, side set, and element block names are recorded in Omega_h::Mesh::class_sets map (keyed by name, paired with their classification dimension and ID), and optionally written to the .osh file, for later retrieval when writing back to Exodus or another format.
| [in] | exodus_file | Open Exodus file handle. |
| [in,out] | mesh | Output mesh; populated and classified by this call. |
| [in] | verbose | If true, print progress information to stdout. |
| [in] | classify_with | Bitmask selecting classification sources: NODE_SETS, SIDE_SETS, or both. |
| void Omega_h::exodus::read_nodal_fields | ( | int | exodus_file, |
| Mesh * | mesh, | ||
| int | time_step, | ||
| std::string const & | prefix = "", |
||
| std::string const & | postfix = "", |
||
| bool | verbose = false, |
||
| bool | merge_components = false |
||
| ) |
Read nodal (vertex) fields from an open Exodus file into a mesh.
Reads all nodal variables at the given 0-based time_step and adds them as tags on Mesh::VERT. The mesh must already be populated by exodus::read_mesh(). Each Exodus variable named <name> becomes an Omega_h tag named prefix + name + postfix.
When merge_components is true, variables matching <base>_<N> (zero- or one-based N) are combined into a single multi-component tag named <base>.
| [in] | exodus_file | Open Exodus file handle. |
| [in,out] | mesh | Mesh to add tags to. |
| [in] | time_step | 0-based time step index to read. |
| [in] | prefix | Prepended to each tag name (default ""). |
| [in] | postfix | Appended to each tag name (default ""). |
| [in] | verbose | If true, print variable names to stdout. |
| [in] | merge_components | If true, reassemble <base>_N variables into a single multi-component tag. |
| Mesh Omega_h::exodus::read_sliced | ( | filesystem::path const & | path, |
| CommPtr | comm, | ||
| bool | verbose = false, |
||
| int | classify_with = NODE_SETS|SIDE_SETS, |
||
| int | time_step = -1, |
||
| bool | merge_components = false |
||
| ) |
Collectively read an Exodus II file into a distributed Omega_h::Mesh.
Opens the Exodus file in parallel via MPI-IO and distributes contiguous slices of nodes and elements across all ranks of comm.
Requires Omega_h built with -DOmega_h_USE_MPI=ON and an Exodus library compiled with PARALLEL_AWARE_EXODUS; otherwise calls Omega_h_fail.
The Exodus file must contain:
coordx/y/z — nodal coordinates (NetCDF variables)connect<N> — element-to-node connectivity per element block (1-based)| [in] | path | Path to the .e / .exo file. |
| [in] | comm | Omega_h communicator; all ranks must call collectively. |
| [in] | verbose | If true, rank 0 prints progress to stdout. |
| [in] | classify_with | Accepted for API consistency; currently ignored. |
| [in] | time_step | 0-based time step to read (-1 = last step). Ignored when the file has no transient data. |
| [in] | merge_components | If true, reassemble <base>_N nodal variables into a single multi-component tag. |
| void Omega_h::exodus::write | ( | filesystem::path const & | path, |
| Mesh * | mesh, | ||
| bool | verbose = false, |
||
| int | classify_with = NODE_SETS|SIDE_SETS, |
||
| FieldNames | excludedNodalFields = FieldNames() |
||
| ) |
Write an Omega_h::Mesh to an Exodus II file.
Writes mesh topology, nodal coordinates, geometric classification, and all floating-point nodal tags to a new Exodus file (clobbers any existing file). Element blocks are written one per unique element class_id; block names come from Mesh::class_sets or default to block_<id>. Boundary surfaces are written as side sets and/or node sets depending on classify_with. Multi-component nodal tags are split into separate scalar Exodus variables named <tag_name>_<component_index>.
| [in] | path | Path to the output .e / .exo file. |
| [in] | mesh | Mesh to write. |
| [in] | verbose | If true, print progress information to stdout. |
| [in] | classify_with | Bitmask of NODE_SETS and/or SIDE_SETS controlling which boundary set types to write. |
| [in] | excludedNodalFields | Names of vertex tags to omit from output. |