Skip to content

Consistent ID to index conversion #185

@pshriwise

Description

@pshriwise

When performing tallies in OpenMC and writing mesh information to statepoints, it's necessary to determine from an element's ID the tally bin it corresponds to.

LibMesh IDs start at zero; MOAB IDs start at one. So, there isn't a consistent offset (like index = id - 1) to rely on b/c it differs depending on the mesh backend being used for the openmc::XDGMesh instance. Ideally whatever conversion approach we come up with will account for gaps in the element ID space as well.

For meshes in MOAB, we can handle discontiguities in the ID spaces the same way we handle gaps in the EntityHandle spaces.

In the context of writing meshes to statepoint files, the same ID<-->index mapping applies to mesh vertices as well.

Some possible solutions

  • require an ID to index conversion for each concrete implementation of the MeshManager.
  • store an ID to index map (or interval mapping) on the application side
  • rather than compute indices, manage element IDs/indices in XDG itself s.t. element IDs start a 1 or zero via internal mapping.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions