omega_h
Reliable mesh adaptation
Typedefs | Enumerations | Functions
Omega_h::exodus Namespace Reference

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_element_fields (int exodus_file, Mesh *mesh, int time_step, std::string const &prefix, std::string const &postfix, bool verbose)
 
void read_nodal_fields (int exodus_file, Mesh *mesh, int time_step, std::string const &prefix, std::string const &postfix, bool verbose)
 
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 &, CommPtr, bool, int, int)
 
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, int classify_with, FieldNames excludedNodalFields)
 

Detailed Description

Functions supporting Exodus II file I/O

Function Documentation

◆ read_mesh()

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:

  • Elements (dim d): each element's class_id is set to its element block ID and class_dim is set to d.
  • Sides (dim d-1): boundary sides are initially given class_id=0.
    • Side sets: each (element, local-side-index) entry provided by Exodus identifies a side, which is assigned class_id equal to the side set ID and class_dim = d-1.
    • Node sets: a side is part of the node set if and only if both of its vertices are in the set (via upward adjacency, see mark_up_all). Those sides are assigned class_id = node_set_id + max_side_set_id (offset to avoid collision with side set IDs) and class_dim = d-1.
  • Vertices (dim 0): never classified directly from sets. Classification is derived by finalize_classification(), which projects downward from sides: a vertex shared by sides of the same model entity inherits that entity's classification; a vertex at the junction of sides belonging to different model entities is classified on a lower-dimensional model entity (e.g., a model vertex, with class_id=-1).

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.

Warning
Overlapping sets are not supported. If a side (or the sides implied by a node set) appears in more than one set, the last write wins and earlier classification is silently overwritten.
Parameters
[in]exodus_fileOpen Exodus file handle.
[in,out]meshOutput mesh; populated and classified by this call.
[in]verboseIf true, print progress information to stdout.
[in]classify_withBitmask selecting classification sources: NODE_SETS, SIDE_SETS, or both.