IOSS 2.0

Classes | Functions
anonymous_namespace{Iocgns_DatabaseIO.C} Namespace Reference

## Classes
struct | SBlock

## Functions
template<typename T >
void | pack (int &idx, std::vector< int > &pack, T *from, int count)
template<typename T >
void | unpack (int &idx, T *pack, T *to, int count)
std::pair< std::string, int > | decompose_name (const std::string &name, bool is_parallel)
size_t | handle_block_ids (const Ioss::EntityBlock *eb, Ioss::Map &entity_map, void *ids, size_t num_to_get, const Ioss::Field::BasicType &size)

## Function Documentation

## ◆ decompose_name()

std::pair<std::string, int> anonymous_namespace{Iocgns_DatabaseIO.C}::decompose_name | ( | const std::string & | name,
|  | bool | is_parallel
| ) |  |

## ◆ handle_block_ids()

size_t anonymous_namespace{Iocgns_DatabaseIO.C}::handle_block_ids | ( | const Ioss::EntityBlock * | eb,
|  | Ioss::Map & | entity_map,
|  | void * | ids,
|  | size_t | num_to_get,
|  | const Ioss::Field::BasicType & | size
| ) |  |

CGNS doesn't support element global ids, so the only use of this routine is the case where we may be translating from a mesh that does support global ids and we will then need to map those global ids back to local ids in, for example, the sideset element list.

There will be two maps the 'entity_map.map' map is a 'direct lookup' map which maps current local position to global id and the 'entity_map.reverse' is an associative lookup which maps the global id to 'original local'. There is also a 'entity_map.reorder' which is direct lookup and maps current local position to original local.

The ids coming in are the global ids; their position is the local id -1 (That is, data[0] contains the global id of local element 1 in this element block). The 'model-local' id is given by eb_offset + 1 + position:

int local_position = entity_map.reverseElementMap[i+1]

But, this assumes 1..numel elements are being output at the same time; we are actually outputting a blocks worth of elements at a time, so we need to consider the block offsets. So... local-in-block position 'i' is index 'eb_offset+i' in 'entity_map.map' and the 'local_position' within the element blocks data arrays is 'local_position-eb_offset'. With this, the position within the data array of this element block is:

int eb_position = entity_map.reverse[entity_map.map[eb_offset+i+1]]-eb_offset-1

NOTE: the maps are built an element block at a time...

## ◆ pack()

template<typename T >

void anonymous_namespace{Iocgns_DatabaseIO.C}::pack | ( | int & | idx,
|  | std::vector< int > & | pack,
|  | T * | from,
|  | int | count
| ) |  |

## ◆ unpack()

template<typename T >

void anonymous_namespace{Iocgns_DatabaseIO.C}::unpack | ( | int & | idx,
|  | T * | pack,
|  | T * | to,
|  | int | count
| ) |  |