IOSS 2.0
|
A namespace for the visualization database format. More...
Classes | |
class | CatalystExodusMesh |
class | CatalystExodusMeshBase |
class | DatabaseIO |
class | IOFactory |
Typedefs | |
typedef std::set< std::pair< int64_t, int64_t > > | EntityIdSet |
Functions | |
int | field_warning (const Ioss::GroupingEntity *ge, const Ioss::Field &field, const std::string &inout) |
size_t | handle_block_ids (const Ioss::EntityBlock *eb, Ioss::State db_state, Ioss::Map &entity_map, void *ids, size_t int_byte_size, size_t num_to_get, int) |
A namespace for the visualization database format.
typedef std::set<std::pair<int64_t, int64_t> > Iovs_exodus::EntityIdSet |
int Iovs_exodus::field_warning | ( | const Ioss::GroupingEntity * | ge, |
const Ioss::Field & | field, | ||
const std::string & | inout ) |
size_t Iovs_exodus::handle_block_ids | ( | const Ioss::EntityBlock * | eb, |
Ioss::State | db_state, | ||
Ioss::Map & | entity_map, | ||
void * | ids, | ||
size_t | int_byte_size, | ||
size_t | num_to_get, | ||
int | ) |
NOTE: "element" is generic for "element", "face", or "edge"
There are two modes we need to support in this routine:
So, there will be two maps the 'elementMap' map is a 'direct lookup' map which maps current local position to global id and the 'reverseElementMap' is an associative lookup which maps the global id to 'original local'. There is also a 'reorderElementMap' 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 = reverseElementMap[ElementMap[i+1]] (the elementMap and reverseElementMap are 1-based)
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 'elementMap' 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 = reverseElementMap[elementMap[eb_offset+i+1]]-eb_offset-1
To determine which map to update on a call to this function, we use the following hueristics: – If the database state is 'Ioss::STATE_MODEL:', then update the 'reverseElementMap'. – If the database state is not Ioss::STATE_MODEL, then leave the 'reverseElementMap' alone since it corresponds to the information already written to the database. [May want to add a Ioss::STATE_REDEFINE_MODEL] – Always update elementMap to match the passed in 'ids' array.
NOTE: the maps are built an element block at a time... NOTE: The mapping is done on TRANSIENT fields only; MODEL fields should be in the original order...