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

A structured zone – i,j,k. More...

#include <Ioss_StructuredBlock.h>

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

Public Member Functions

 StructuredBlock (DatabaseIO *io_database, const std::string &my_name, int index_dim, int ni, int nj, int nk, int off_i, int off_j, int off_k, int glo_ni, int glo_nj, int glo_nk)
 
 StructuredBlock (DatabaseIO *io_database, const std::string &my_name, int index_dim, const Ioss::IJK_t &ordinal, const Ioss::IJK_t &offset, const Ioss::IJK_t &global_ordinal)
 
 StructuredBlock (DatabaseIO *io_database, const std::string &my_name, int index_dim, int ni, int nj, int nk)
 Create a structured block.
 
 StructuredBlock (DatabaseIO *io_database, const std::string &my_name, int index_dim, Ioss::IJK_t &ordinal)
 
StructuredBlockclone (DatabaseIO *database) const
 
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 const Ioss::NodeBlockget_node_block () const
 
IOSS_NODISCARD Ioss::NodeBlockget_node_block ()
 
IOSS_NODISCARD bool is_active () const
 Does block contain any cells.
 
IOSS_NODISCARD Property get_implicit_property (const std::string &my_name) const override
 Calculate and get an implicit property.
 
IOSS_NODISCARD AxisAlignedBoundingBox get_bounding_box () const
 
void set_node_offset (size_t offset)
 Set the 'offset' for the block.
 
void set_cell_offset (size_t offset)
 
void set_node_global_offset (size_t offset)
 
void set_cell_global_offset (size_t offset)
 
IOSS_NODISCARD size_t get_node_offset () const
 
IOSS_NODISCARD size_t get_cell_offset () const
 
IOSS_NODISCARD size_t get_node_global_offset () const
 
IOSS_NODISCARD size_t get_cell_global_offset () const
 
void set_ijk_offset (int axis, size_t offset)
 
void set_ijk_global (int axis, size_t global)
 
void set_ijk_offset (const IJK_t &offset)
 
void set_ijk_global (const IJK_t &global)
 
IOSS_NODISCARD IJK_t get_ijk_offset () const
 
IOSS_NODISCARD IJK_t get_ijk_local () const
 
IOSS_NODISCARD IJK_t get_ijk_global () const
 
IOSS_NODISCARD size_t get_global_cell_id (int i, int j, int k) const
 
IOSS_NODISCARD size_t get_global_cell_id (IJK_t index) const
 
IOSS_NODISCARD size_t get_global_node_offset (int i, int j, int k) const
 
IOSS_NODISCARD size_t get_global_node_offset (IJK_t index) const
 
IOSS_NODISCARD size_t get_block_local_node_offset (int ii, int jj, int kk) const
 
IOSS_NODISCARD size_t get_block_local_node_offset (IJK_t index) const
 
IOSS_NODISCARD size_t get_local_node_offset (int i, int j, int k) const
 
IOSS_NODISCARD size_t get_local_node_offset (IJK_t index) const
 
IOSS_NODISCARD std::vector< IOSS_SB_INTget_cell_node_ids (bool add_offset) const
 
template<typename INT_t >
size_t get_cell_node_ids (INT_t *idata, bool add_offset) const
 
template<typename INT_t >
size_t get_cell_ids (INT_t *idata, bool add_offset) const
 
IOSS_NODISCARD bool contains_node (size_t global_offset) const
 
IOSS_NODISCARD bool operator== (const Ioss::StructuredBlock &rhs) const
 
IOSS_NODISCARD bool operator!= (const Ioss::StructuredBlock &rhs) const
 
IOSS_NODISCARD bool equal (const Ioss::StructuredBlock &rhs) const
 
template<class Archive >
void serialize (Archive &archive)
 
- Public Member Functions inherited from Ioss::EntityBlock
EntityBlockoperator= (const EntityBlock &)=delete
 
IOSS_NODISCARD const ElementTopologytopology () const
 Get the topology of the entities in the block.
 
IOSS_NODISCARD bool contains (size_t local_id) const
 Determine whether the block contains the entity with a given id.
 
void set_offset (size_t offset)
 Set the 'offset' for the block.
 
IOSS_NODISCARD size_t get_offset () const
 Get the 'offset' for the block.
 
IOSS_NODISCARD bool operator== (const Ioss::EntityBlock &rhs) const
 
IOSS_NODISCARD bool operator!= (const Ioss::EntityBlock &rhs) const
 
IOSS_NODISCARD bool equal (const Ioss::EntityBlock &rhs) 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 void delete_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
 

Public Attributes

std::vector< ZoneConnectivitym_zoneConnectivity
 
std::vector< BoundaryConditionm_boundaryConditions
 
std::vector< size_t > m_blockLocalNodeIndex
 
std::vector< std::pair< size_t, size_t > > m_globalIdMap
 

Protected Member Functions

int64_t internal_get_field_data (const Field &field, void *data, size_t data_size) const override
 
int64_t internal_put_field_data (const Field &field, void *data, size_t data_size) 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::EntityBlock
 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.
 
 EntityBlock (const EntityBlock &)=default
 
bool equal_ (const Ioss::EntityBlock &rhs, bool quiet) const
 
- 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

bool equal_ (const Ioss::StructuredBlock &rhs, bool quiet) const
 

Private Attributes

IJK_t m_ijk
 
IJK_t m_offset
 
IJK_t m_ijkGlobal
 
size_t m_nodeOffset {}
 
size_t m_cellOffset {}
 
size_t m_nodeGlobalOffset {}
 
size_t m_cellGlobalOffset {}
 
Ioss::NodeBlock m_nodeBlock
 

Additional Inherited Members

- Protected Attributes inherited from Ioss::EntityBlock
ElementTopologytopology_ {nullptr}
 
size_t idOffset {0}
 
- Protected Attributes inherited from Ioss::GroupingEntity
PropertyManager properties
 
FieldManager fields
 
int64_t entityCount = 0
 

Detailed Description

A structured zone – i,j,k.

Constructor & Destructor Documentation

◆ StructuredBlock() [1/4]

Ioss::StructuredBlock::StructuredBlock ( DatabaseIO * io_database,
const std::string & my_name,
int index_dim,
int ni,
int nj,
int nk,
int off_i,
int off_j,
int off_k,
int glo_ni,
int glo_nj,
int glo_nk )

◆ StructuredBlock() [2/4]

Ioss::StructuredBlock::StructuredBlock ( DatabaseIO * io_database,
const std::string & my_name,
int index_dim,
const Ioss::IJK_t & ordinal,
const Ioss::IJK_t & offset,
const Ioss::IJK_t & global_ordinal )

◆ StructuredBlock() [3/4]

Ioss::StructuredBlock::StructuredBlock ( DatabaseIO * io_database,
const std::string & my_name,
int index_dim,
int ni,
int nj,
int nk )

Create a structured block.

Parameters
[in]io_databaseThe database associated with the region containing the structured block.
[in]my_nameThe structured block's name.
[in]index_dimThe dimensionality of the block – 1D, 2D, 3D
[in]niThe number of intervals in the (i) direction.
[in]njThe number of intervals in the (j) direction. Zero if 1D
[in]nkThe number of intervals in the (k) direction. Zero if 2D

◆ StructuredBlock() [4/4]

Ioss::StructuredBlock::StructuredBlock ( DatabaseIO * io_database,
const std::string & my_name,
int index_dim,
Ioss::IJK_t & ordinal )

Member Function Documentation

◆ clone()

StructuredBlock * Ioss::StructuredBlock::clone ( DatabaseIO * database) const

◆ contains_node()

IOSS_NODISCARD bool Ioss::StructuredBlock::contains_node ( size_t global_offset) const
inline

◆ contains_string()

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

What does this entity contain.

Returns
The name of the thing this entity contains.

Implements Ioss::GroupingEntity.

◆ equal()

bool Ioss::StructuredBlock::equal ( const Ioss::StructuredBlock & rhs) const

◆ equal_()

bool Ioss::StructuredBlock::equal_ ( const Ioss::StructuredBlock & rhs,
bool quiet ) const
private

◆ get_block_local_node_offset() [1/2]

IOSS_NODISCARD size_t Ioss::StructuredBlock::get_block_local_node_offset ( IJK_t index) const
inline

◆ get_block_local_node_offset() [2/2]

IOSS_NODISCARD size_t Ioss::StructuredBlock::get_block_local_node_offset ( int ii,
int jj,
int kk ) const
inline

◆ get_bounding_box()

AxisAlignedBoundingBox Ioss::StructuredBlock::get_bounding_box ( ) const

◆ get_cell_global_offset()

IOSS_NODISCARD size_t Ioss::StructuredBlock::get_cell_global_offset ( ) const
inline

◆ get_cell_ids()

template<typename INT_t >
size_t Ioss::StructuredBlock::get_cell_ids ( INT_t * idata,
bool add_offset ) const
inline

◆ get_cell_node_ids() [1/2]

IOSS_NODISCARD std::vector< IOSS_SB_INT > Ioss::StructuredBlock::get_cell_node_ids ( bool add_offset) const
inline

◆ get_cell_node_ids() [2/2]

template<typename INT_t >
size_t Ioss::StructuredBlock::get_cell_node_ids ( INT_t * idata,
bool add_offset ) const
inline

◆ get_cell_offset()

IOSS_NODISCARD size_t Ioss::StructuredBlock::get_cell_offset ( ) const
inline

◆ get_global_cell_id() [1/2]

IOSS_NODISCARD size_t Ioss::StructuredBlock::get_global_cell_id ( IJK_t index) const
inline

◆ get_global_cell_id() [2/2]

IOSS_NODISCARD size_t Ioss::StructuredBlock::get_global_cell_id ( int i,
int j,
int k ) const
inline

◆ get_global_node_offset() [1/2]

IOSS_NODISCARD size_t Ioss::StructuredBlock::get_global_node_offset ( IJK_t index) const
inline

◆ get_global_node_offset() [2/2]

IOSS_NODISCARD size_t Ioss::StructuredBlock::get_global_node_offset ( int i,
int j,
int k ) const
inline

◆ get_ijk_global()

IOSS_NODISCARD IJK_t Ioss::StructuredBlock::get_ijk_global ( ) const
inline

◆ get_ijk_local()

IOSS_NODISCARD IJK_t Ioss::StructuredBlock::get_ijk_local ( ) const
inline

◆ get_ijk_offset()

IOSS_NODISCARD IJK_t Ioss::StructuredBlock::get_ijk_offset ( ) const
inline

◆ get_implicit_property()

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

Calculate and get an implicit property.

These are calculated 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::EntityBlock.

◆ get_local_node_offset() [1/2]

IOSS_NODISCARD size_t Ioss::StructuredBlock::get_local_node_offset ( IJK_t index) const
inline

◆ get_local_node_offset() [2/2]

IOSS_NODISCARD size_t Ioss::StructuredBlock::get_local_node_offset ( int i,
int j,
int k ) const
inline

◆ get_node_block() [1/2]

IOSS_NODISCARD Ioss::NodeBlock & Ioss::StructuredBlock::get_node_block ( )
inline

◆ get_node_block() [2/2]

IOSS_NODISCARD const Ioss::NodeBlock & Ioss::StructuredBlock::get_node_block ( ) const
inline

◆ get_node_global_offset()

IOSS_NODISCARD size_t Ioss::StructuredBlock::get_node_global_offset ( ) const
inline

◆ get_node_offset()

IOSS_NODISCARD size_t Ioss::StructuredBlock::get_node_offset ( ) const
inline

◆ internal_get_field_data()

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

Implements Ioss::GroupingEntity.

◆ internal_get_zc_field_data()

int64_t Ioss::StructuredBlock::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::StructuredBlock::internal_put_field_data ( const Field & field,
void * data,
size_t data_size ) const
overrideprotectedvirtual

Implements Ioss::GroupingEntity.

◆ is_active()

IOSS_NODISCARD bool Ioss::StructuredBlock::is_active ( ) const
inline

Does block contain any cells.

◆ operator!=()

bool Ioss::StructuredBlock::operator!= ( const Ioss::StructuredBlock & rhs) const

◆ operator==()

bool Ioss::StructuredBlock::operator== ( const Ioss::StructuredBlock & rhs) const

◆ serialize()

template<class Archive >
void Ioss::StructuredBlock::serialize ( Archive & archive)
inline

◆ set_cell_global_offset()

void Ioss::StructuredBlock::set_cell_global_offset ( size_t offset)
inline

◆ set_cell_offset()

void Ioss::StructuredBlock::set_cell_offset ( size_t offset)
inline

◆ set_ijk_global() [1/2]

void Ioss::StructuredBlock::set_ijk_global ( const IJK_t & global)

◆ set_ijk_global() [2/2]

void Ioss::StructuredBlock::set_ijk_global ( int axis,
size_t global )

◆ set_ijk_offset() [1/2]

void Ioss::StructuredBlock::set_ijk_offset ( const IJK_t & offset)

◆ set_ijk_offset() [2/2]

void Ioss::StructuredBlock::set_ijk_offset ( int axis,
size_t offset )

◆ set_node_global_offset()

void Ioss::StructuredBlock::set_node_global_offset ( size_t offset)
inline

◆ set_node_offset()

void Ioss::StructuredBlock::set_node_offset ( size_t offset)
inline

Set the 'offset' for the block.

The 'offset' is used to map a cell or node location within a structured block to the model implicit cell or node location on a single processor. zero-based.

The 'global' offsets do the same except for they apply over the entire model on all processors. zero-based.

For example, the file descriptor (1-based) of the 37th cell in the 4th block is calculated by:

file_descriptor = offset of block 4 + 37

This can also be used to determine which structured block a cell with a file_descriptor maps into. An particular structured block contains all cells in the range:

offset < file_descriptor <= offset+number_cells_per_block

Note that for nodes, the nodeOffset does not take into account the nodes that are shared between blocks.

◆ short_type_string()

IOSS_NODISCARD std::string Ioss::StructuredBlock::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.

◆ type()

IOSS_NODISCARD EntityType Ioss::StructuredBlock::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::StructuredBlock::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

◆ m_blockLocalNodeIndex

std::vector<size_t> Ioss::StructuredBlock::m_blockLocalNodeIndex

◆ m_boundaryConditions

std::vector<BoundaryCondition> Ioss::StructuredBlock::m_boundaryConditions

◆ m_cellGlobalOffset

size_t Ioss::StructuredBlock::m_cellGlobalOffset {}
private

◆ m_cellOffset

size_t Ioss::StructuredBlock::m_cellOffset {}
private

◆ m_globalIdMap

std::vector<std::pair<size_t, size_t> > Ioss::StructuredBlock::m_globalIdMap

◆ m_ijk

IJK_t Ioss::StructuredBlock::m_ijk
private

◆ m_ijkGlobal

IJK_t Ioss::StructuredBlock::m_ijkGlobal
private

◆ m_nodeBlock

Ioss::NodeBlock Ioss::StructuredBlock::m_nodeBlock
private

◆ m_nodeGlobalOffset

size_t Ioss::StructuredBlock::m_nodeGlobalOffset {}
private

◆ m_nodeOffset

size_t Ioss::StructuredBlock::m_nodeOffset {}
private

◆ m_offset

IJK_t Ioss::StructuredBlock::m_offset
private

◆ m_zoneConnectivity

std::vector<ZoneConnectivity> Ioss::StructuredBlock::m_zoneConnectivity

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