IOSS 2.0

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Ioss::EntityBlock Class Referenceabstract

Base class for all 'block'-type grouping entities, which means all members of the block are similar or have the same topology. More...

`#include <Ioss_EntityBlock.h>`

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

## Public Member Functions
Property | get_implicit_property (const std::string &my_name) const override=0
| Calculate and get an implicit property. More...
const ElementTopology * | topology () const
| Get the topology of the entities in the block. More...
bool | contains (size_t local_id) const
| Determine whether the block contains the entity with a given id. More...
void | set_offset (size_t offset)
| Set the 'offset' for the block. More...
size_t | get_offset () const
| Get the 'offset' for the block. More...
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. 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 ()
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...
int | 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...
int | 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 >
int | 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 >
int | 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 >
int | 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
| EntityBlock (DatabaseIO *io_database, const std::string &my_name, const std::string &entity_type, size_t entity_cnt)
| Constructor adds "name" and "entity_count" properties to the entity and specifies the topology type for the entity block. More...
| EntityBlock (const EntityBlock &)=delete
EntityBlock & | operator= (const EntityBlock &)=delete
Protected Member Functions inherited from Ioss::GroupingEntity
void | count_attributes () const
bool | set_state (State new_state)
void | really_delete_database ()
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
ElementTopology * | topology_
size_t | idOffset
Protected Attributes inherited from Ioss::GroupingEntity
PropertyManager | properties
FieldManager | fields
int64_t | entityCount = 0

## Detailed Description

Base class for all 'block'-type grouping entities, which means all members of the block are similar or have the same topology.

The following derived classes are typical:

– 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

## Constructor & Destructor Documentation

## ◆ EntityBlock() [1/2]

Ioss::EntityBlock::EntityBlock | ( | Ioss::DatabaseIO * | io_database,
|  | const std::string & | my_name,
|  | const std::string & | entity_type,
|  | size_t | entity_cnt
| ) |  |
| protected

Constructor adds "name" and "entity_count" properties to the entity and specifies the topology type for the entity block.

Parameters

  [in] | io_database | The database associated with the block.
  [in] | my_name | The block name.
  [in] | entity_type | The topology type for the block.
  [in] | entity_cnt | The number of subentities in the block.

## ◆ EntityBlock() [2/2]

Ioss::EntityBlock::EntityBlock | ( | const EntityBlock & |  | ) |
| protected delete

## Member Function Documentation

## ◆ contains()

bool Ioss::EntityBlock::contains | ( | size_t | local_id | ) | const
| inline

Determine whether the block contains the entity with a given id.

Parameters

  [in] | local_id | The id to check.

Returns
  True if the block contains the entity.

## ◆ get_implicit_property()

Ioss::Property Ioss::EntityBlock::get_implicit_property | ( | const std::string & | my_name | ) | const
| override pure 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 'topology_node_count' for an ElementBlock. 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 'EntityBlock::get_implicit_property' if the requested property is not specific to their type.

Implements Ioss::GroupingEntity.

Implemented in Ioss::StructuredBlock, Ioss::SideBlock, Ioss::EdgeBlock, Ioss::FaceBlock, Ioss::NodeBlock, and Ioss::ElementBlock.

## ◆ get_offset()

size_t Ioss::EntityBlock::get_offset | ( |  | ) | const
| inline

Get the 'offset' for the block.

The 'offset' is used to map an element location within an element block to the element 'file descriptor'. For example, the file descriptor of the 37th element in the 4th block is calculated by:

file_descriptor = offset of block 4 + 37

This can also be used to determine which element block an element with a file_descriptor maps into. An particular element block contains all elements in the range:

offset < file_descriptor <= offset+number_elements_per_block

## ◆ operator=()

EntityBlock& Ioss::EntityBlock::operator= | ( | const EntityBlock & |  | ) |
| protected delete

## ◆ set_offset()

void Ioss::EntityBlock::set_offset | ( | size_t | offset | ) |
| inline

Set the 'offset' for the block.

The 'offset' is used to map an element location within an element block to the element 'file descriptor'. For example, the file descriptor of the 37th element in the 4th block is calculated by:

file_descriptor = offset of block 4 + 37

This can also be used to determine which element block an element with a file_descriptor maps into. An particular element block contains all elements in the range:

offset < file_descriptor <= offset+number_elements_per_block

## ◆ topology()

const ElementTopology* Ioss::EntityBlock::topology | ( |  | ) | const
| inline

Get the topology of the entities in the block.

Returns
  The topology.

## Member Data Documentation

## ◆ idOffset

size_t Ioss::EntityBlock::idOffset
| protected

## ◆ topology_

ElementTopology* Ioss::EntityBlock::topology_
| protected

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

- src/Ioss_EntityBlock.h
- src/Ioss_EntityBlock.C