IOSS 2.0
Loading...
Searching...
No Matches
Ioss::Region Class Reference

A grouping entity that contains other grouping entities. More...

#include <Ioss_Region.h>

Inheritance diagram for Ioss::Region:
[legend]
Collaboration diagram for Ioss::Region:
[legend]

Public Member Functions

 Region (DatabaseIO *iodatabase=nullptr, const std::string &my_name="")
 Constructor reads in all metadata from disk.
 
 ~Region () override
 
IOSS_NODISCARD std::string type_string () const override
 Get the name of the particular type of entity.
 
IOSS_NODISCARD std::string short_type_string () const override
 Get a short name of the particular type of entity.
 
IOSS_NODISCARD std::string contains_string () const override
 What does this entity contain.
 
IOSS_NODISCARD EntityType type () const override
 Get the EntityType, which indicates the particular type of GroupingEntity this is.
 
IOSS_NODISCARD MeshType mesh_type () const
 
IOSS_NODISCARD std::string mesh_type_string () const
 
IOSS_NODISCARD bool node_major () const
 
void output_summary (std::ostream &strm, bool do_transient=true) const
 Print a summary of entities in the region.
 
IOSS_NODISCARD bool supports_field_type (Ioss::EntityType fld_type) const
 
IOSS_NODISCARD int64_t node_global_to_local (int64_t global, bool must_exist=true) const
 
bool begin_mode (State new_state)
 Set the Region and the associated DatabaseIO to the given State.
 
bool end_mode (State current_state)
 Return the Region and the associated DatabaseIO to STATE_CLOSED.
 
virtual int add_state (double time)
 
virtual int add_state_nl (double time)
 Add a state for a specified time.
 
virtual IOSS_NODISCARD double get_state_time (int state=-1) const
 Get the time corresponding to the specified state or the currently active state.
 
IOSS_NODISCARD int get_current_state () const
 Get the index (1-based) of the currently-active state.
 
double begin_state (int state)
 Begin a state (moment in time).
 
double end_state (int state)
 End a state (moment in time).
 
IOSS_NODISCARD bool model_defined () const
 Determine whether the metadata defining the model (nontransient, geometry, and toploloty) has been set.
 
IOSS_NODISCARD bool transient_defined () const
 Determine whether the metadata related to the transient data has been set.
 
void erase_fields (Field::RoleType role)
 Remove all fields of the specified role from all entities in the region.
 
IOSS_NODISCARD std::pair< int, double > get_max_time () const
 Get the maximum time step index (1-based) and time for the region.
 
IOSS_NODISCARD std::pair< int, double > get_min_time () const
 Get the minimum time step index (1-based) and time for the region.
 
bool add (NodeBlock *node_block)
 Add a node block to the region.
 
bool add (EdgeBlock *edge_block)
 Add an edge block to the region.
 
bool add (FaceBlock *face_block)
 Add a face block to the region.
 
bool add (ElementBlock *element_block)
 Add an element block to the region.
 
bool add (SideSet *sideset)
 Add a side set to the region.
 
bool add (NodeSet *nodeset)
 Add a node set to the region.
 
bool add (EdgeSet *edgeset)
 Add an edge set to the region.
 
bool add (FaceSet *faceset)
 Add a face set to the region.
 
bool add (ElementSet *elementset)
 Add an element set to the region.
 
bool add (CommSet *commset)
 Add a comm set to the region.
 
bool add (StructuredBlock *structured_block)
 Add a structured block to the region.
 
bool add (Assembly *assembly)
 Add an assembly to the region.
 
bool add (Blob *blob)
 Add an blob to the region.
 
bool add (const CoordinateFrame &frame)
 Add a coordinate frame to the region.
 
bool remove (Assembly *removal)
 Remove an assembly to the region.
 
IOSS_NODISCARD const NodeBlockContainerget_node_blocks () const
 Get all the region's NodeBlock objects.
 
IOSS_NODISCARD const EdgeBlockContainerget_edge_blocks () const
 Get all the region's EdgeBlock objects.
 
IOSS_NODISCARD const FaceBlockContainerget_face_blocks () const
 Get all the region's FaceBlock objects.
 
IOSS_NODISCARD const ElementBlockContainerget_element_blocks () const
 Get all the region's ElementBlock objects.
 
IOSS_NODISCARD const SideSetContainerget_sidesets () const
 Get all the region's SideSet objects.
 
IOSS_NODISCARD const NodeSetContainerget_nodesets () const
 Get all the region's NodeSet objects.
 
IOSS_NODISCARD const EdgeSetContainerget_edgesets () const
 Get all the region's EdgeSet objects.
 
IOSS_NODISCARD const FaceSetContainerget_facesets () const
 Get all the region's FaceSet objects.
 
IOSS_NODISCARD const ElementSetContainerget_elementsets () const
 Get all the region's ElementSet objects.
 
IOSS_NODISCARD const CommSetContainerget_commsets () const
 Get all the region's CommSet objects.
 
IOSS_NODISCARD const StructuredBlockContainerget_structured_blocks () const
 Get all the region's StructuredBlock objects.
 
IOSS_NODISCARD const AssemblyContainerget_assemblies () const
 Get all the region's Assembly objects.
 
IOSS_NODISCARD const BlobContainerget_blobs () const
 Get all the region's Blob objects.
 
IOSS_NODISCARD const CoordinateFrameContainerget_coordinate_frames () const
 Get all the region's CoordinateFrame objects.
 
IOSS_NODISCARD GroupingEntityget_entity (const std::string &my_name, EntityType io_type) const
 Get an entity of a known EntityType.
 
IOSS_NODISCARD GroupingEntityget_entity (const std::string &my_name) const
 Get an entity of a unknown EntityType.
 
IOSS_NODISCARD NodeBlockget_node_block (const std::string &my_name) const
 Get the node block with the given name.
 
IOSS_NODISCARD EdgeBlockget_edge_block (const std::string &my_name) const
 Get the edge block with the given name.
 
IOSS_NODISCARD FaceBlockget_face_block (const std::string &my_name) const
 Get the face block with the given name.
 
IOSS_NODISCARD ElementBlockget_element_block (const std::string &my_name) const
 Get the element block with the given name.
 
IOSS_NODISCARD SideSetget_sideset (const std::string &my_name) const
 Get the side set with the given name.
 
IOSS_NODISCARD SideBlockget_sideblock (const std::string &my_name) const
 Get the side block with the given name.
 
IOSS_NODISCARD NodeSetget_nodeset (const std::string &my_name) const
 Get the node set with the given name.
 
IOSS_NODISCARD EdgeSetget_edgeset (const std::string &my_name) const
 Get the edge set with the given name.
 
IOSS_NODISCARD FaceSetget_faceset (const std::string &my_name) const
 Get the face set with the given name.
 
IOSS_NODISCARD ElementSetget_elementset (const std::string &my_name) const
 Get the element set with the given name.
 
IOSS_NODISCARD CommSetget_commset (const std::string &my_name) const
 Get the comm set with the given name.
 
IOSS_NODISCARD StructuredBlockget_structured_block (const std::string &my_name) const
 Get the structured block with the given name.
 
IOSS_NODISCARD Assemblyget_assembly (const std::string &my_name) const
 Get the assembly with the given name.
 
IOSS_NODISCARD Blobget_blob (const std::string &my_name) const
 Get the blob with the given name.
 
IOSS_NODISCARD GroupingEntityget_entity (int64_t id, EntityType io_type) const
 Get an entity of a known EntityType and specified id.
 
IOSS_NODISCARD const CoordinateFrameget_coordinate_frame (int64_t id) const
 Get the coordinate frame with the given id.
 
bool add_alias (const std::string &db_name, const std::string &alias, EntityType type)
 Add an alias for a name in a region.
 
bool add_alias (const std::string &db_name, const std::string &alias)
 
bool add_alias (const GroupingEntity *ge)
 Add a grouping entity's name as an alias for itself.
 
IOSS_NODISCARD std::string get_alias (const std::string &alias, EntityType type) const
 Get the original name for an alias.
 
IOSS_NODISCARD std::string get_alias_nl (const std::string &alias, EntityType type) const
 
IOSS_NODISCARD const AliasMapget_alias_map (EntityType entity_type) const
 Get all original name / alias pairs for the region.
 
int get_aliases (const std::string &my_name, EntityType type, std::vector< std::string > &aliases) const
 Get a map containing all aliases defined for the entity with basename 'my_name'.
 
void transfer_mesh_aliases (Region *to) const
 Transfer all relevant aliases from this region to another region.
 
void synchronize_id_and_name (const Region *from, bool sync_attribute_field_names=false)
 Ensure that the restart and results files have the same ids.
 
IOSS_NODISCARD bool is_valid_io_entity (const std::string &my_name, unsigned int io_type, std::string *my_type=nullptr) const
 Determine whether the entity with the given name and type exists.
 
void check_for_duplicate_names (const Ioss::GroupingEntity *entity) const
 
IOSS_NODISCARD ElementBlockget_element_block (size_t local_id) const
 Get the element block containing a specified element.
 
IOSS_NODISCARD StructuredBlockget_structured_block (size_t global_offset) const
 Get the structured block containing a specified global-offset-node.
 
IOSS_NODISCARD Property get_implicit_property (const std::string &my_name) const override
 Get an implicit property – These are calculated from data stored in the grouping entity instead of having an explicit value assigned.
 
IOSS_NODISCARD const std::vector< std::string > & get_information_records () const
 Get all information records (informative strings) for the region's database.
 
void add_information_records (const std::vector< std::string > &info)
 Add multiple information records (informative strings) to the region's database.
 
void add_information_record (const std::string &info)
 Add an information record (an informative string) to the region's database.
 
IOSS_NODISCARD const std::vector< std::string > & get_qa_records () const
 Get all QA records, each of which consists of 4 strings, from the region's database.
 
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 region's database.
 
template<typename T , typename U >
std::vector< size_t > get_entity_field_data (const std::string &field_name, const std::vector< T * > &entity_container, std::vector< U > &field_data) const
 
- Public Member Functions inherited from Ioss::GroupingEntity
 GroupingEntity ()=default
 
 GroupingEntity (DatabaseIO *io_database, const std::string &my_name, int64_t entity_count)
 Base class constructor adds "name" and "entity_count" properties to the entity.
 
 GroupingEntity (const GroupingEntity &other)
 
GroupingEntityoperator= (const GroupingEntity &rhs)=delete
 
virtual ~GroupingEntity ()
 
IOSS_NODISCARD State get_state () const
 Get the current Ioss::State of the entity.
 
IOSS_NODISCARD DatabaseIOget_database () const
 
void set_database (DatabaseIO *io_database)
 
void reset_database (DatabaseIO *io_database)
 
virtual IOSS_NODISCARD const GroupingEntitycontained_in () const
 
IOSS_NODISCARD const std::string & name () const
 Get name of entity.
 
void set_name (const std::string &new_name)
 Set the name of the entity.
 
IOSS_NODISCARD std::string generic_name () const
 Get a generated name based on the type of the entity and the id.
 
IOSS_NODISCARD bool is_alias (const std::string &my_name) const
 
virtual void block_membership (std::vector< std::string > &)
 Get list of blocks that the entities in this GroupingEntity "touch".
 
IOSS_NODISCARD std::string get_filename () const
 Get the file name associated with the database containing this entity.
 
void property_add (const Property &new_prop)
 Add a property to the entity's property manager.
 
void property_erase (const std::string &property_name)
 Remove a property from the entity's property manager.
 
IOSS_NODISCARD bool property_exists (const std::string &property_name) const
 Checks if a property exists in the entity's property manager.
 
IOSS_NODISCARD Property get_property (const std::string &property_name) const
 Get the Property from the property manager associated with the entity.
 
IOSS_NODISCARD int64_t get_optional_property (const std::string &property, int64_t optional_value) const
 
IOSS_NODISCARD std::string get_optional_property (const std::string &property_name, const std::string &optional_value) const
 
IOSS_NODISCARD NameList property_describe () const
 Get the names of all properties in the property manager for this entity.
 
int property_describe (NameList *names) const
 Get the names of all properties in the property manager for this entity.
 
IOSS_NODISCARD NameList property_describe (Ioss::Property::Origin origin) const
 
int property_describe (Ioss::Property::Origin origin, NameList *names) const
 
IOSS_NODISCARD size_t property_count () const
 Get the number of properties defined in the property manager for this entity.
 
void property_update (const std::string &property, int64_t value) const
 
void property_update (const std::string &property, const std::string &value) const
 
void field_add (Field new_field)
 Add a field to the entity's field manager.
 
void field_erase (const std::string &field_name)
 Remove a field from the entity's field manager.
 
void field_erase (Field::RoleType role)
 Remove all fields of type role from the entity's field manager.
 
IOSS_NODISCARD bool field_exists (const std::string &field_name) const
 Checks if a field with a given name exists in the entity's field manager.
 
IOSS_NODISCARD Field get_field (const std::string &field_name) const
 Get a field from the entity's field manager.
 
IOSS_NODISCARD const Fieldget_fieldref (const std::string &field_name) const
 Get a reference to a field from the entity's field manager.
 
int field_describe (NameList *names) const
 Get the names of all fields in the entity's field manager.
 
IOSS_NODISCARD NameList field_describe () const
 Get the names of all fields in the entity's field manager.
 
int field_describe (Field::RoleType role, NameList *names) const
 Get the names of all fields of a specified RoleType in the entity's field manager.
 
IOSS_NODISCARD NameList field_describe (Field::RoleType role) const
 Get the names of all fields of a specified RoleType in the entity's field manager.
 
IOSS_NODISCARD size_t field_count () const
 Get the number of fields in the entity's field manager.
 
IOSS_NODISCARD size_t field_count (Field::RoleType role) const
 Get the number of fields with the given role (MESH, ATTRIBUTE, TRANSIENT, REDUCTION, etc.) in the entity's field manager.
 
IOSS_NODISCARD bool check_for_duplicate (const Ioss::Field &new_field) const
 
int64_t get_field_data (const std::string &field_name, void *data, size_t data_size) const
 Read field data from the database file into memory using a pointer.
 
int64_t put_field_data (const std::string &field_name, void *data, size_t data_size) const
 Write field data from memory into the database file using a pointer.
 
int64_t get_field_data (const std::string &field_name, void **data, size_t *data_size) const
 
template<typename T >
int64_t get_field_data (const std::string &field_name, std::vector< T > &data) const
 Read type 'T' field data from the database file into memory using a std::vector.
 
template<typename T >
int64_t put_field_data (const std::string &field_name, const std::vector< T > &data) const
 Write type 'T' field data from memory into the database file using a std::vector.
 
template<typename T >
int64_t put_field_data (const std::string &field_name, std::vector< T > &data) const
 
IOSS_NODISCARD Ioss::Field::BasicType field_int_type () const
 
IOSS_NODISCARD unsigned int hash () const
 
IOSS_NODISCARD int64_t entity_count () const
 
IOSS_NODISCARD bool operator!= (const GroupingEntity &rhs) const
 
IOSS_NODISCARD bool operator== (const GroupingEntity &rhs) const
 
IOSS_NODISCARD bool equal (const GroupingEntity &rhs) const
 

Protected Member Functions

int64_t internal_get_field_data (const Field &field, void *data, size_t data_size=0) const override
 
int64_t internal_put_field_data (const Field &field, void *data, size_t data_size=0) const override
 
int64_t internal_get_zc_field_data (const Field &field, void **data, size_t *data_size) const override
 
- Protected Member Functions inherited from Ioss::GroupingEntity
void count_attributes () const
 
bool set_state (State new_state)
 
void really_delete_database ()
 
IOSS_NODISCARD bool equal_ (const GroupingEntity &rhs, bool quiet) const
 

Private Member Functions

template<typename T >
std::vector< size_t > internal_get_entity_field_data (const std::string &field_name, const std::vector< T * > &entity_container, void *data, size_t data_size=0) const
 
bool add_alias_nl (const std::string &db_name, const std::string &alias, EntityType type)
 
bool add_alias_nl (const GroupingEntity *ge)
 
bool begin_mode_nl (State new_state)
 
bool end_mode_nl (State current_state)
 
void delete_database () override
 

Private Attributes

std::map< EntityType, AliasMapaliases_
 Stores alias mappings.
 
NodeBlockContainer nodeBlocks
 
EdgeBlockContainer edgeBlocks
 
FaceBlockContainer faceBlocks
 
ElementBlockContainer elementBlocks
 
NodeSetContainer nodeSets
 
EdgeSetContainer edgeSets
 
FaceSetContainer faceSets
 
ElementSetContainer elementSets
 
SideSetContainer sideSets
 
CommSetContainer commSets
 
CoordinateFrameContainer coordinateFrames
 
StructuredBlockContainer structuredBlocks
 
AssemblyContainer assemblies
 
BlobContainer blobs
 
StateTimeContainer stateTimes
 
int currentState {-1}
 
int stateCount {0}
 
bool modelDefined {false}
 
bool transientDefined {false}
 

Additional Inherited Members

- Protected Attributes inherited from Ioss::GroupingEntity
PropertyManager properties
 
FieldManager fields
 
int64_t entityCount = 0
 

Detailed Description

A grouping entity that contains other grouping entities.

Maintains a list of NodeBlocks, ElementBlocks, NodeLists, CommLists and Surfaces. [Similar to the "Composite Pattern" in Design Patterns] All interface to GroupingEntities is through the Region class; clients of the IO subsystem have no direct access to the underlying GroupingEntities (other than the Region).

Constructor & Destructor Documentation

◆ Region()

Ioss::Region::Region ( DatabaseIO * iodatabase = nullptr,
const std::string & my_name = "" )
explicit

Constructor reads in all metadata from disk.

This constructor connects this region to the database, opens the underlying file, reads all the metadata in the file into Region and its subentities, and closes the underlying file. Region properties, such as spatial_dimension, element_block_count, element_count, etc, are also added to the Region's property manager.

Parameters
[in]iodatabaseThe name of the database associated with the Region.
[in]my_nameThe name of the Region.

◆ ~Region()

Ioss::Region::~Region ( )
override

Member Function Documentation

◆ add() [1/14]

bool Ioss::Region::add ( Assembly * assembly)

Add an assembly to the region.

Parameters
[in]assemblyThe assembly to add
Returns
True if successful.

◆ add() [2/14]

bool Ioss::Region::add ( Blob * blob)

Add an blob to the region.

Parameters
[in]blobThe blob to add
Returns
True if successful.

◆ add() [3/14]

bool Ioss::Region::add ( CommSet * commset)

Add a comm set to the region.

Parameters
[in]commsetThe comm set to add
Returns
True if successful.

◆ add() [4/14]

bool Ioss::Region::add ( const CoordinateFrame & frame)

Add a coordinate frame to the region.

Parameters
[in]frameThe coordinate frame to add
Returns
True if successful.

◆ add() [5/14]

bool Ioss::Region::add ( EdgeBlock * edge_block)

Add an edge block to the region.

Parameters
[in]edge_blockThe edge block to add
Returns
True if successful.

◆ add() [6/14]

bool Ioss::Region::add ( EdgeSet * edgeset)

Add an edge set to the region.

Parameters
[in]edgesetThe edge set to add
Returns
True if successful.

◆ add() [7/14]

bool Ioss::Region::add ( ElementBlock * element_block)

Add an element block to the region.

Parameters
[in]element_blockThe element block to add
Returns
True if successful.

◆ add() [8/14]

bool Ioss::Region::add ( ElementSet * elementset)

Add an element set to the region.

Parameters
[in]elementsetThe element set to add
Returns
True if successful.

◆ add() [9/14]

bool Ioss::Region::add ( FaceBlock * face_block)

Add a face block to the region.

Parameters
[in]face_blockThe face block to add
Returns
True if successful.

◆ add() [10/14]

bool Ioss::Region::add ( FaceSet * faceset)

Add a face set to the region.

Parameters
[in]facesetThe face set to add
Returns
True if successful.

◆ add() [11/14]

bool Ioss::Region::add ( NodeBlock * node_block)

Add a node block to the region.

Parameters
[in]node_blockThe node block to add
Returns
True if successful.

◆ add() [12/14]

bool Ioss::Region::add ( NodeSet * nodeset)

Add a node set to the region.

Parameters
[in]nodesetThe node set to add
Returns
True if successful.

◆ add() [13/14]

bool Ioss::Region::add ( SideSet * sideset)

Add a side set to the region.

Parameters
[in]sidesetThe side set to add
Returns
True if successful.

◆ add() [14/14]

bool Ioss::Region::add ( StructuredBlock * structured_block)

Add a structured block to the region.

Parameters
[in]structured_blockThe structured block to add
Returns
True if successful.

◆ add_alias() [1/3]

bool Ioss::Region::add_alias ( const GroupingEntity * ge)

Add a grouping entity's name as an alias for itself.

Parameters
[in]geThe grouping entity.
Returns
True if successful

◆ add_alias() [2/3]

bool Ioss::Region::add_alias ( const std::string & db_name,
const std::string & alias )

◆ add_alias() [3/3]

bool Ioss::Region::add_alias ( const std::string & db_name,
const std::string & alias,
EntityType type )

Add an alias for a name in a region.

For use with the USTRING type in Sierra, create an uppercase version of all aliases...

Parameters
[in]db_nameThe original name.
[in]aliasthe alias
[in]typethe entity type
Returns
True if successful

◆ add_alias_nl() [1/2]

bool Ioss::Region::add_alias_nl ( const GroupingEntity * ge)
private

◆ add_alias_nl() [2/2]

bool Ioss::Region::add_alias_nl ( const std::string & db_name,
const std::string & alias,
EntityType type )
private

◆ add_information_record()

void Ioss::Region::add_information_record ( const std::string & info)
inline

Add an information record (an informative string) to the region's database.

Parameters
[in]infoThe string to add.

◆ add_information_records()

void Ioss::Region::add_information_records ( const std::vector< std::string > & info)
inline

Add multiple information records (informative strings) to the region's database.

Parameters
[in]infoThe strings to add.

◆ add_qa_record()

void Ioss::Region::add_qa_record ( const std::string & code,
const std::string & code_qa,
const std::string & date = "",
const std::string & time = "" )
inline

Add a QA record, which consists of 4 strings, to the region's database.

The 4 function parameters correspond to the 4 QA record strings.

Parameters
[in]codeA descriptive code name, such as the application that modified the database.
[in]code_qaA descriptive string, such as the version of the application that modified the database.
[in]dateA relevant date, such as the date the database was modified.
[in]timeA relevant time, such as the time the database was modified.

◆ add_state()

virtual int Ioss::Region::add_state ( double time)
inlinevirtual

◆ add_state_nl()

int Ioss::Region::add_state_nl ( double time)
virtual

Add a state for a specified time.

The states in the region will be 1-based.

Parameters
[in]timeThe time at the new state.
Returns
The state index (1-based).

◆ begin_mode()

bool Ioss::Region::begin_mode ( State new_state)

Set the Region and the associated DatabaseIO 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.)

Parameters
[in]new_stateThe new State to which the Region and DatabaseIO should be set.
Returns
True if successful.

◆ begin_mode_nl()

bool Ioss::Region::begin_mode_nl ( State new_state)
private

◆ begin_state()

double Ioss::Region::begin_state ( int state)

Begin a state (moment in time).

Parameters
[in]stateThe state index (1-based).
Returns
The time of this state.

◆ check_for_duplicate_names()

void Ioss::Region::check_for_duplicate_names ( const Ioss::GroupingEntity * entity) const

◆ contains_string()

IOSS_NODISCARD std::string Ioss::Region::contains_string ( ) const
inlineoverridevirtual

What does this entity contain.

Returns
The name of the thing this entity contains.

Implements Ioss::GroupingEntity.

◆ delete_database()

void Ioss::Region::delete_database ( )
overrideprivatevirtual

Reimplemented from Ioss::GroupingEntity.

◆ end_mode()

bool Ioss::Region::end_mode ( State current_state)

Return the Region and the associated DatabaseIO to STATE_CLOSED.

Parameters
[in]current_stateThe State to end.
Returns
True if successful.

◆ end_mode_nl()

bool Ioss::Region::end_mode_nl ( State current_state)
private

◆ end_state()

double Ioss::Region::end_state ( int state)

End a state (moment in time).

Parameters
[in]stateThe state index (1-based).
Returns
The time of this state.

◆ erase_fields()

void Ioss::Region::erase_fields ( Field::RoleType role)

Remove all fields of the specified role from all entities in the region.

◆ get_alias()

std::string Ioss::Region::get_alias ( const std::string & alias,
EntityType type ) const

Get the original name for an alias.

Parameters
[in]aliasThe alias name.
[in]typethe entity type
Returns
The original name.

◆ get_alias_map()

const AliasMap & Ioss::Region::get_alias_map ( EntityType type) const

Get all original name / alias pairs for the region.

Returns
All original name / alias pairs for the region.

◆ get_alias_nl()

std::string Ioss::Region::get_alias_nl ( const std::string & alias,
EntityType type ) const

◆ get_aliases()

int Ioss::Region::get_aliases ( const std::string & my_name,
EntityType type,
std::vector< std::string > & aliases ) const

Get a map containing all aliases defined for the entity with basename 'my_name'.

Get all aliases for a name in the region.

Parameters
[in]my_nameThe original name.
[in]typethe entity type
[in,out]aliasesOn input, any vector of strings. On output, all aliases for my_name are appended.
Returns
The number of aliases that were appended.

◆ get_assemblies()

const AssemblyContainer & Ioss::Region::get_assemblies ( ) const

Get all the region's Assembly objects.

Returns
A vector of all the region's Assembly objects.

◆ get_assembly()

Assembly * Ioss::Region::get_assembly ( const std::string & my_name) const

Get the assembly with the given name.

Parameters
[in]my_nameThe name of the assembly to get.
Returns
The assembly, or nullptr if not found.

◆ get_blob()

Blob * Ioss::Region::get_blob ( const std::string & my_name) const

Get the blob with the given name.

Parameters
[in]my_nameThe name of the blob to get.
Returns
The blob, or nullptr if not found.

◆ get_blobs()

const BlobContainer & Ioss::Region::get_blobs ( ) const

Get all the region's Blob objects.

Returns
A vector of all the region's Blob objects.

◆ get_commset()

CommSet * Ioss::Region::get_commset ( const std::string & my_name) const

Get the comm set with the given name.

Parameters
[in]my_nameThe name of the comm set to get.
Returns
The comm set, or nullptr if not found.

◆ get_commsets()

const CommSetContainer & Ioss::Region::get_commsets ( ) const

Get all the region's CommSet objects.

Returns
A vector of all the region's CommSet objects.

◆ get_coordinate_frame()

const CoordinateFrame & Ioss::Region::get_coordinate_frame ( int64_t id) const

Get the coordinate frame with the given id.

Parameters
[in]idThe id of the coordinate frame to get.
Returns
The coordinate frame, or nullptr if not found.

◆ get_coordinate_frames()

const CoordinateFrameContainer & Ioss::Region::get_coordinate_frames ( ) const

Get all the region's CoordinateFrame objects.

Returns
A vector of all the region's CoordinateFrame objects.

◆ get_current_state()

int Ioss::Region::get_current_state ( ) const
inline

Get the index (1-based) of the currently-active state.

Returns
The index.

◆ get_edge_block()

EdgeBlock * Ioss::Region::get_edge_block ( const std::string & my_name) const

Get the edge block with the given name.

Parameters
[in]my_nameThe name of the edge block to get.
Returns
The edge block, or nullptr if not found.

◆ get_edge_blocks()

const EdgeBlockContainer & Ioss::Region::get_edge_blocks ( ) const

Get all the region's EdgeBlock objects.

Returns
A vector of all the region's EdgeBlock objects.

◆ get_edgeset()

EdgeSet * Ioss::Region::get_edgeset ( const std::string & my_name) const

Get the edge set with the given name.

Parameters
[in]my_nameThe name of the edge set to get.
Returns
The edge set, or nullptr if not found.

◆ get_edgesets()

const EdgeSetContainer & Ioss::Region::get_edgesets ( ) const

Get all the region's EdgeSet objects.

Returns
A vector of all the region's EdgeSet objects.

◆ get_element_block() [1/2]

ElementBlock * Ioss::Region::get_element_block ( const std::string & my_name) const

Get the element block with the given name.

Parameters
[in]my_nameThe name of the element block to get.
Returns
The element block, or nullptr if not found.

◆ get_element_block() [2/2]

ElementBlock * Ioss::Region::get_element_block ( size_t local_id) const

Get the element block containing a specified element.

Parameters
[in]local_idThe local database id (1-based), not the global id.
Returns
The element block, or nullptr if no element block contains this element (local_id <= 0 or greater than number of elements in database)

◆ get_element_blocks()

const ElementBlockContainer & Ioss::Region::get_element_blocks ( ) const

Get all the region's ElementBlock objects.

Returns
A vector of all the region's ElementBlock objects.

◆ get_elementset()

ElementSet * Ioss::Region::get_elementset ( const std::string & my_name) const

Get the element set with the given name.

Parameters
[in]my_nameThe name of the element set to get.
Returns
The element set, or nullptr if not found.

◆ get_elementsets()

const ElementSetContainer & Ioss::Region::get_elementsets ( ) const

Get all the region's ElementSet objects.

Returns
A vector of all the region's ElementSet objects.

◆ get_entity() [1/3]

GroupingEntity * Ioss::Region::get_entity ( const std::string & my_name) const

Get an entity of a unknown EntityType.

Searches for an entity with the given name in a fixed order of entity types. First NODEBLOCK entities are searched. Then ELEMENTBLOCK entities, etc.

Parameters
[in]my_nameThe name of the entity to get
Returns
The entity with the given name, or nullptr if not found.

◆ get_entity() [2/3]

GroupingEntity * Ioss::Region::get_entity ( const std::string & my_name,
EntityType io_type ) const

Get an entity of a known EntityType.

Parameters
[in]my_nameThe name of the entity to get
[in]io_typeThe known type of the entity.
Returns
The entity with the given name of the given type, or nullptr if not found.

◆ get_entity() [3/3]

GroupingEntity * Ioss::Region::get_entity ( int64_t id,
EntityType io_type ) const

Get an entity of a known EntityType and specified id.

Parameters
[in]idThe id of the entity to get
[in]io_typeThe known type of the entity.
Returns
The entity with the given id of the given type, or nullptr if not found or if ids not supported.

◆ get_entity_field_data()

template<typename T , typename U >
std::vector< size_t > Ioss::Region::get_entity_field_data ( const std::string & field_name,
const std::vector< T * > & entity_container,
std::vector< U > & field_data ) const

◆ get_face_block()

FaceBlock * Ioss::Region::get_face_block ( const std::string & my_name) const

Get the face block with the given name.

Parameters
[in]my_nameThe name of the face block to get.
Returns
The face block, or nullptr if not found.

◆ get_face_blocks()

const FaceBlockContainer & Ioss::Region::get_face_blocks ( ) const

Get all the region's FaceBlock objects.

Returns
A vector of all the region's FaceBlock objects.

◆ get_faceset()

FaceSet * Ioss::Region::get_faceset ( const std::string & my_name) const

Get the face set with the given name.

Parameters
[in]my_nameThe name of the face set to get.
Returns
The face set, or nullptr if not found.

◆ get_facesets()

const FaceSetContainer & Ioss::Region::get_facesets ( ) const

Get all the region's FaceSet objects.

Returns
A vector of all the region's FaceSet objects.

◆ get_implicit_property()

Property Ioss::Region::get_implicit_property ( const std::string & my_name) const
overridevirtual

Get an implicit property – These are calculated from data stored in the grouping entity instead of having an explicit value assigned.

An example would be 'element_block_count' for a region.

Parameters
[in]my_nameThe property name.
Returns
The property.

Implements Ioss::GroupingEntity.

◆ get_information_records()

const std::vector< std::string > & Ioss::Region::get_information_records ( ) const
inline

Get all information records (informative strings) for the region's database.

Returns
The informative strings.

◆ get_max_time()

std::pair< int, double > Ioss::Region::get_max_time ( ) const

Get the maximum time step index (1-based) and time for the region.

Returns
A pair consisting of the step (1-based) corresponding to the maximum time on the database and the corresponding maximum time value. Note that this may not necessarily be the last step on the database if cycle and overlay are being used.

◆ get_min_time()

std::pair< int, double > Ioss::Region::get_min_time ( ) const

Get the minimum time step index (1-based) and time for the region.

Returns
A pair consisting of the step (1-based) corresponding to the minimum time on the database and the corresponding minimum time value. Note that this may not necessarily be the first step on the database if cycle and overlay are being used.

◆ get_node_block()

NodeBlock * Ioss::Region::get_node_block ( const std::string & my_name) const

Get the node block with the given name.

Parameters
[in]my_nameThe name of the node block to get.
Returns
The node block, or nullptr if not found.

◆ get_node_blocks()

const NodeBlockContainer & Ioss::Region::get_node_blocks ( ) const

Get all the region's NodeBlock objects.

Returns
A vector of all the region's NodeBlock objects.

◆ get_nodeset()

NodeSet * Ioss::Region::get_nodeset ( const std::string & my_name) const

Get the node set with the given name.

Parameters
[in]my_nameThe name of the node set to get.
Returns
The node set, or nullptr if not found.

◆ get_nodesets()

const NodeSetContainer & Ioss::Region::get_nodesets ( ) const

Get all the region's NodeSet objects.

Returns
A vector of all the region's NodeSet objects.

◆ get_qa_records()

const std::vector< std::string > & Ioss::Region::get_qa_records ( ) const
inline

Get all QA records, each of which consists of 4 strings, from the region's database.

The 4 strings that make up a database QA record are:

  1. A descriptive code name, such as the application that modified the database.
  2. A descriptive string, such as the version of the application that modified the database.
  3. A relevant date, such as the date the database was modified.
  4. A relevant time, such as the time the database was modified.
Returns
All QA records in a single vector. Every 4 consecutive elements of the vector make up a single QA record.

◆ get_sideblock()

SideBlock * Ioss::Region::get_sideblock ( const std::string & my_name) const

Get the side block with the given name.

Parameters
[in]my_nameThe name of the side block to get.
Returns
The side block, or nullptr if not found.

◆ get_sideset()

SideSet * Ioss::Region::get_sideset ( const std::string & my_name) const

Get the side set with the given name.

Parameters
[in]my_nameThe name of the side set to get.
Returns
The side set, or nullptr if not found.

◆ get_sidesets()

const SideSetContainer & Ioss::Region::get_sidesets ( ) const

Get all the region's SideSet objects.

Returns
A vector of all the region's SideSet objects.

◆ get_state_time()

double Ioss::Region::get_state_time ( int state = -1) const
virtual

Get the time corresponding to the specified state or the currently active state.

Parameters
[in]stateThe state index (1-based) or -1 for the currently active state.
Returns
The time at the specified state or the currently active state.

◆ get_structured_block() [1/2]

StructuredBlock * Ioss::Region::get_structured_block ( const std::string & my_name) const

Get the structured block with the given name.

Parameters
[in]my_nameThe name of the structured block to get.
Returns
The structured block, or nullptr if not found.

◆ get_structured_block() [2/2]

StructuredBlock * Ioss::Region::get_structured_block ( size_t global_offset) const

Get the structured block containing a specified global-offset-node.

Parameters
[in]global_offsetThe offset of cell-nodes for all blocks; 0-based.
Returns
The structured block, or nullptr if no structured block contains this node (local_id <= 0 or greater than number of cell-nodes in database)

◆ get_structured_blocks()

const StructuredBlockContainer & Ioss::Region::get_structured_blocks ( ) const

Get all the region's StructuredBlock objects.

Returns
A vector of all the region's StructuredBlock objects.

◆ internal_get_entity_field_data()

template<typename T >
std::vector< size_t > Ioss::Region::internal_get_entity_field_data ( const std::string & field_name,
const std::vector< T * > & entity_container,
void * data,
size_t data_size = 0 ) const
private

◆ internal_get_field_data()

int64_t Ioss::Region::internal_get_field_data ( const Field & field,
void * data,
size_t data_size = 0 ) const
overrideprotectedvirtual

Implements Ioss::GroupingEntity.

◆ internal_get_zc_field_data()

int64_t Ioss::Region::internal_get_zc_field_data ( const Field & field,
void ** data,
size_t * data_size ) const
overrideprotectedvirtual

Implements Ioss::GroupingEntity.

◆ internal_put_field_data()

int64_t Ioss::Region::internal_put_field_data ( const Field & field,
void * data,
size_t data_size = 0 ) const
overrideprotectedvirtual

Implements Ioss::GroupingEntity.

◆ is_valid_io_entity()

bool Ioss::Region::is_valid_io_entity ( const std::string & my_name,
unsigned int io_type,
std::string * my_type = nullptr ) const

Determine whether the entity with the given name and type exists.

Parameters
[in]my_nameThe name of the entity to search for.
[in]io_typeThe type of the entity.
[out]my_typeA string representing the type if the entity is found. "INVALID" if the entity is not found or the type is invalid.
Returns
True if the type is valid and the entity is found.

◆ mesh_type()

MeshType Ioss::Region::mesh_type ( ) const

◆ mesh_type_string()

std::string Ioss::Region::mesh_type_string ( ) const

◆ model_defined()

IOSS_NODISCARD bool Ioss::Region::model_defined ( ) const
inline

Determine whether the metadata defining the model (nontransient, geometry, and toploloty) has been set.

Returns
True if the metadata defining the model has been set.

◆ node_global_to_local()

int64_t Ioss::Region::node_global_to_local ( int64_t global,
bool must_exist = true ) const
inline

◆ node_major()

bool Ioss::Region::node_major ( ) const

◆ output_summary()

void Ioss::Region::output_summary ( std::ostream & strm,
bool do_transient = true ) const

Print a summary of entities in the region.

Parameters
[in,out]strmThe output stream to use for printing.
[in]do_transientdeprecated and ignored

◆ remove()

bool Ioss::Region::remove ( Assembly * removal)

Remove an assembly to the region.

Parameters
[in]removalThe assembly to remove
Returns
True if successful.

Checks other assemblies for uses of this assembly and removes if from their member lists.

◆ short_type_string()

IOSS_NODISCARD std::string Ioss::Region::short_type_string ( ) const
inlineoverridevirtual

Get a short name of the particular type of entity.

Returns
The short name of the particular type of entity.

Implements Ioss::GroupingEntity.

◆ supports_field_type()

bool Ioss::Region::supports_field_type ( Ioss::EntityType fld_type) const
inline

◆ synchronize_id_and_name()

void Ioss::Region::synchronize_id_and_name ( const Region * from,
bool sync_attribute_field_names = false )

Ensure that the restart and results files have the same ids.

There is very little connection between an input (mesh) database and an output (results/restart) database. Basically, the entity names are the same between the two files. This works fine in the case that an input database has 'generated' entity names of the form 'block_10' or 'surface_32' since then the output database can de-generate or decode the name and infer that the block should have an id of 10 and the surface an id of 32.

However, if alias or other renaming happens, then the output block may have a name of the form 'fireset' and the underlying database cannot infer that the id of the block should be 10. Instead, it sets the id to an arbitrary number (1,2,...). This is annoying in the case of the results file since there is no correspondence between the mesh numbering and the results numbering. In the case of the restart output file, it can be disastrous since when the file is used to restart the analysis, there is no match between the mesh blocks and those found on the restart file and the restart fails.

So... We need to somehow ensure that the restart (and results) files have the same ids. To do this, we do the following:

  1. The mesh database will set the property 'id' on input.
  2. The results/restart files will have a 'name' based on either the true name or an alias name. Whichever, that alias will appear on the mesh database also, so we can query the mesh database aliases to get the entity.
  3. Once we have the entity, we can query the 'id' property and add the same 'id' property to the results/restart database.
  4. Also set the 'name' property to the base 'name' on the output file.
  5. Note that a property may already exist and must be removed before the 'correct' value is set.

◆ transfer_mesh_aliases()

void Ioss::Region::transfer_mesh_aliases ( Region * to) const

Transfer all relevant aliases from this region to another region.

Parameters
[in]toThe region to which the aliases are to be transferred.

◆ transient_defined()

IOSS_NODISCARD bool Ioss::Region::transient_defined ( ) const
inline

Determine whether the metadata related to the transient data has been set.

Returns
True if the metadata related to the transient data has been set.

◆ type()

IOSS_NODISCARD EntityType Ioss::Region::type ( ) const
inlineoverridevirtual

Get the EntityType, which indicates the particular type of GroupingEntity this is.

Returns
The particular EntityType of this GroupingEntity.

Implements Ioss::GroupingEntity.

◆ type_string()

IOSS_NODISCARD std::string Ioss::Region::type_string ( ) const
inlineoverridevirtual

Get the name of the particular type of entity.

Returns
The name of the particular type of entity.

Implements Ioss::GroupingEntity.

Member Data Documentation

◆ aliases_

std::map<EntityType, AliasMap> Ioss::Region::aliases_
mutableprivate

Stores alias mappings.

◆ assemblies

AssemblyContainer Ioss::Region::assemblies
private

◆ blobs

BlobContainer Ioss::Region::blobs
private

◆ commSets

CommSetContainer Ioss::Region::commSets
private

◆ coordinateFrames

CoordinateFrameContainer Ioss::Region::coordinateFrames
private

◆ currentState

int Ioss::Region::currentState {-1}
private

◆ edgeBlocks

EdgeBlockContainer Ioss::Region::edgeBlocks
private

◆ edgeSets

EdgeSetContainer Ioss::Region::edgeSets
private

◆ elementBlocks

ElementBlockContainer Ioss::Region::elementBlocks
private

◆ elementSets

ElementSetContainer Ioss::Region::elementSets
private

◆ faceBlocks

FaceBlockContainer Ioss::Region::faceBlocks
private

◆ faceSets

FaceSetContainer Ioss::Region::faceSets
private

◆ modelDefined

bool Ioss::Region::modelDefined {false}
private

◆ nodeBlocks

NodeBlockContainer Ioss::Region::nodeBlocks
private

◆ nodeSets

NodeSetContainer Ioss::Region::nodeSets
private

◆ sideSets

SideSetContainer Ioss::Region::sideSets
private

◆ stateCount

int Ioss::Region::stateCount {0}
mutableprivate

◆ stateTimes

StateTimeContainer Ioss::Region::stateTimes
mutableprivate

◆ structuredBlocks

StructuredBlockContainer Ioss::Region::structuredBlocks
private

◆ transientDefined

bool Ioss::Region::transientDefined {false}
private

The documentation for this class was generated from the following files: