|
IOSS
2.0
|
Base class for all 'grouping' entities. The following derived classes are typical: More...
#include <Ioss_GroupingEntity.h>
Public Member Functions | |
| 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. More... | |
| GroupingEntity (const GroupingEntity &)=delete | |
| GroupingEntity & | operator= (const GroupingEntity &)=delete |
| virtual | ~GroupingEntity () |
| State | get_state () const |
| Get the current Ioss::State of the entity. More... | |
| DatabaseIO * | get_database () const |
| void | set_database (DatabaseIO *io_database) |
| virtual void | delete_database () |
| virtual const GroupingEntity * | contained_in () const |
| const std::string & | name () const |
| Get name of entity. More... | |
| void | set_name (const std::string &new_name) |
| Set the name of the entity. More... | |
| std::string | generic_name () const |
| Get a generated name based on the type of the entity and the id. More... | |
| 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". More... | |
| std::string | get_filename () const |
| Get the file name associated with the database containing this entity. More... | |
| virtual std::string | type_string () const =0 |
| Get the name of the particular type of entity. More... | |
| virtual std::string | short_type_string () const =0 |
| Get a short name of the particular type of entity. More... | |
| virtual std::string | contains_string () const =0 |
| What does this entity contain. More... | |
| virtual EntityType | type () const =0 |
| Get the EntityType, which indicates the particular type of GroupingEntity this is. More... | |
| void | property_add (const Property &new_prop) |
| Add a property to the entity's property manager. More... | |
| void | property_erase (const std::string &property_name) |
| Remove a property from the entity's property manager. More... | |
| bool | property_exists (const std::string &property_name) const |
| Checks if a property exists in the entity's property manager. More... | |
| Property | get_property (const std::string &property_name) const |
| Get the Property from the property manager associated with the entity. More... | |
| int | property_describe (NameList *names) const |
| Get the names of all properties in the property manager for this entity. More... | |
| size_t | property_count () const |
| Get the number of properties defined in the property manager for this entity. More... | |
| 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 (const Field &new_field) |
| Add a field to the entity's field manager. More... | |
| void | field_erase (const std::string &field_name) |
| Remove a field from the entity's field manager. More... | |
| bool | field_exists (const std::string &field_name) const |
| Checks if a field with a given name exists in the entity's field manager. More... | |
| Field | get_field (const std::string &field_name) const |
| Get a field from the entity's field manager. More... | |
| const Field & | get_fieldref (const std::string &field_name) const |
| Get a reference to a field from the entity's field manager. More... | |
| int | field_describe (NameList *names) const |
| Get the names of all fields in the entity's field manager. More... | |
| 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. More... | |
| size_t | field_count () const |
| Get the number of fields in the entity's field manager. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| template<typename T > | |
| int64_t | put_field_data (const std::string &field_name, std::vector< T > &data) const |
| Ioss::Field::BasicType | field_int_type () const |
| unsigned int | hash () const |
| int64_t | entity_count () const |
Protected Member Functions | |
| void | count_attributes () const |
| bool | set_state (State new_state) |
| void | really_delete_database () |
| virtual Property | get_implicit_property (const std::string &my_name) const =0 |
| Calculate and get an implicit property. More... | |
| virtual int64_t | internal_get_field_data (const Field &field, void *data, size_t data_size=0) const =0 |
| virtual int64_t | internal_put_field_data (const Field &field, void *data, size_t data_size=0) const =0 |
Protected Attributes | |
| PropertyManager | properties |
| FieldManager | fields |
| int64_t | entityCount = 0 |
Private Member Functions | |
| void | verify_field_exists (const std::string &field_name, const std::string &inout) const |
Private Attributes | |
| std::string | entityName |
| DatabaseIO * | database_ = nullptr |
| int64_t | attributeCount = 0 |
| State | entityState = STATE_CLOSED |
| unsigned int | hash_ = 0 |
Friends | |
| class | Property |
Base class for all 'grouping' entities. The following derived classes are typical:
– NodeSet – grouping of nodes (0d topology)
– EdgeSet – grouping of edges (1d topology)
– FaceSet – grouping of faces (2d topology) [Surface]
Similarly, there is:
– NodeBlock – grouping of 'similar' nodes (same degree of freedom, ...)
– ElementBlock – grouping of 'similar' elements (same element topology, attributes, ...) 0d, 1d, 2d, 3d topology possible – e.g., sphere, bar, quad, hex
A Region is also a grouping entity, except that its list of subentites are other GroupingEntities. That is, it maintains a list of NodeBlocks, ElementBlocks, NodeLists, CommLists and Surfaces. [Similar to the "Composite Patter" 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).
Each GroupingEntity contains:
– name
– MeshEntities of the specified topological dimension
– Optional attributes, either global (applied to the groupingentity), or unique value(s) to be applied to each subentity.
– Data items
|
default |
| Ioss::GroupingEntity::GroupingEntity | ( | Ioss::DatabaseIO * | io_database, |
| const std::string & | my_name, | ||
| int64_t | entity_cnt | ||
| ) |
Base class constructor adds "name" and "entity_count" properties to the entity.
| [in] | io_database | The database associated with the entity. |
| [in] | my_name | The entity name. |
| [in] | entity_cnt | The number of subentities in the entity. |
|
delete |
|
virtual |
|
inlinevirtual |
Get list of blocks that the entities in this GroupingEntity "touch".
For a SideSet, returns a list of the element blocks that the elements in the set belong to. For others, it returns an empty vector. Entries are pushed onto the "block_members" vector, so it will be appended to if it is not empty at entry to the function.
Reimplemented in Ioss::EdgeSet, Ioss::ElementSet, Ioss::FaceSet, Ioss::SideBlock, and Ioss::SideSet.
|
virtual |
Return the GroupingEntity pointer of the "object" that this entity is contained in. For example, a SideBlock would return the SideSet that "owns" the SideBlock. Most GroupingEntities would return the containing Region A region would return itself(?) A NodeBlock containing the subset of nodes in a StructuredBlock would return that StructuredBlock.
Reimplemented in Ioss::SideBlock, and Ioss::NodeBlock.
|
pure virtual |
What does this entity contain.
Implemented in Ioss::StructuredBlock, Ioss::Region, Ioss::SideBlock, Ioss::EdgeBlock, Ioss::FaceBlock, Ioss::NodeBlock, Ioss::EdgeSet, Ioss::ElementSet, Ioss::FaceSet, Ioss::NodeSet, Ioss::SideSet, Ioss::CommSet, Ioex::SuperElement, Ioss::ElementBlock, and Ioss::NullEntity.
|
protected |
|
virtual |
Reimplemented in Ioss::Region.
|
inline |
| void Ioss::GroupingEntity::field_add | ( | const Field & | new_field | ) |
Add a field to the entity's field manager.
Assumes that a field with the same name does not already exist.
| [in] | new_field | The field to add |
|
inline |
Get the number of fields in the entity's field manager.
| size_t Ioss::GroupingEntity::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.
|
inline |
Get the names of all fields of a specified RoleType in the entity's field manager.
| [in] | role | The role type (MESH, ATTRIBUTE, TRANSIENT, REDUCTION, etc.) |
| [out] | names | All field names of the specified RoleType in the entity's field manager. |
|
inline |
Get the names of all fields in the entity's field manager.
| [out] | names | All field names in the entity's field manager. |
|
inline |
Remove a field from the entity's field manager.
Assumes that a field with the given name exists in the field manager.
| [in] | field_name | The name of the field to remove. |
|
inline |
Checks if a field with a given name exists in the entity's field manager.
| [in] | field_name | The name of the field to check for. |
|
inline |
Get the number of bytes used to store the INT data type
| std::string Ioss::GroupingEntity::generic_name | ( | ) | const |
Get a generated name based on the type of the entity and the id.
For example, element block 10 would return "block_10" This is the default name if no name is assigned in the mesh database.
| Ioss::DatabaseIO * Ioss::GroupingEntity::get_database | ( | ) | const |
|
inline |
Get a field from the entity's field manager.
| [in] | field_name | The name of the field to get. |
| int64_t Ioss::GroupingEntity::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.
| [in] | field_name | The name of the field to read. |
| [out] | data | The data. |
| int64_t Ioss::GroupingEntity::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.
| [in] | field_name | The name of the field to read. |
| [out] | data | The data. |
| [in] | data_size | The number of bytes of data to be read. |
|
inline |
Get a reference to a field from the entity's field manager.
| [in] | field_name | The name of the field to get. |
| std::string Ioss::GroupingEntity::get_filename | ( | ) | const |
Get the file name associated with the database containing this entity.
|
protectedpure virtual |
Calculate and get an implicit property.
These are calcuated from data stored in the EntityBlock instead of having an explicit value assigned. An example would be 'element_block_count' for a region. Note that even though this is a pure virtual function, an implementation is provided to return properties that are common to all 'block'-type grouping entities. Derived classes should call 'GroupingEntity::get_implicit_property' if the requested property is not specific to their type.
Implemented in Ioex::SuperElement, Ioss::EntityBlock, Ioss::EntitySet, Ioss::Region, Ioss::StructuredBlock, Ioss::NodeBlock, Ioss::SideBlock, Ioss::SideSet, Ioss::EdgeBlock, Ioss::FaceBlock, Ioss::EdgeSet, Ioss::ElementSet, Ioss::FaceSet, Ioss::NodeSet, Ioss::CommSet, Ioss::ElementBlock, and Ioss::NullEntity.
|
inline |
Get the Property from the property manager associated with the entity.
| [in] | property_name | The name of the property to get |
| Ioss::State Ioss::GroupingEntity::get_state | ( | ) | const |
Get the current Ioss::State of the entity.
|
inline |
|
protectedpure virtual |
|
protectedpure virtual |
| bool Ioss::GroupingEntity::is_alias | ( | const std::string & | my_name | ) | const |
Determine whether a name is an alias for this entity.
| [in] | my_name | Determine whether this name is an alias for this entity. |
|
inline |
Get name of entity.
This short-circuits the process of getting the name via the property.
|
delete |
|
inline |
Add a property to the entity's property manager.
| [in] | new_prop | The property to add. |
|
inline |
Get the number of properties defined in the property manager for this entity.
|
inline |
Get the names of all properties in the property manager for this entity.
| [out] | names | All the property names in the property manager. |
|
inline |
Remove a property from the entity's property manager.
Assumes that the property with the given name already exists in the property manager.
| [in] | property_name | The name of the property to remove. |
|
inline |
Checks if a property exists in the entity's property manager.
| [in] | property_name | The property to check |
| void Ioss::GroupingEntity::property_update | ( | const std::string & | property, |
| const std::string & | value | ||
| ) | const |
| void Ioss::GroupingEntity::property_update | ( | const std::string & | property, |
| int64_t | value | ||
| ) | const |
Add a property, or change its value if it already exists with a different value
| int64_t Ioss::GroupingEntity::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.
| [in] | field_name | The name of the field to write. |
| [in] | data | The data. |
| int64_t Ioss::GroupingEntity::put_field_data | ( | const std::string & | field_name, |
| std::vector< T > & | data | ||
| ) | const |
| int64_t Ioss::GroupingEntity::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.
| [in] | field_name | The name of the field to write. |
| [in] | data | The data. |
| [in] | data_size | The number of bytes of data to be written. |
|
protected |
| void Ioss::GroupingEntity::set_database | ( | Ioss::DatabaseIO * | io_database | ) |
|
inline |
Set the name of the entity.
| [in] | new_name | The new name of the entity. |
|
inlineprotected |
|
pure virtual |
Get a short name of the particular type of entity.
Implemented in Ioss::StructuredBlock, Ioss::Region, Ioss::SideBlock, Ioss::EdgeBlock, Ioss::FaceBlock, Ioss::NodeBlock, Ioss::EdgeSet, Ioss::ElementSet, Ioss::FaceSet, Ioss::NodeSet, Ioss::SideSet, Ioss::CommSet, Ioex::SuperElement, Ioss::ElementBlock, and Ioss::NullEntity.
|
pure virtual |
Get the EntityType, which indicates the particular type of GroupingEntity this is.
Implemented in Ioss::StructuredBlock, Ioss::Region, Ioss::SideBlock, Ioss::EdgeBlock, Ioss::FaceBlock, Ioss::NodeBlock, Ioss::EdgeSet, Ioss::ElementSet, Ioss::FaceSet, Ioss::NodeSet, Ioss::SideSet, Ioss::CommSet, Ioex::SuperElement, Ioss::ElementBlock, and Ioss::NullEntity.
|
pure virtual |
Get the name of the particular type of entity.
Implemented in Ioss::StructuredBlock, Ioss::Region, Ioss::SideBlock, Ioss::EdgeBlock, Ioss::FaceBlock, Ioss::NodeBlock, Ioss::EdgeSet, Ioss::ElementSet, Ioss::FaceSet, Ioss::NodeSet, Ioss::SideSet, Ioss::CommSet, Ioex::SuperElement, Ioss::ElementBlock, and Ioss::NullEntity.
|
private |
|
friend |
|
mutableprivate |
|
private |
|
protected |
|
private |
|
private |
|
protected |
|
private |
|
protected |