Skip to content

Avoid copying the mesh when block restriction is applied in a MeshTally #1275

@nuclearkevin

Description

@nuclearkevin

Reason

When block restrictions are specified in a MeshTally, a copy of the mesh is created and passed to OpenMC for tallying. This results in substantial memory usage when the block restriction includes large subdomains of the mesh.

Design

Block restriction must be specified in the point locators used by OpenMC for tallying, along with the equivalent bin->element and element-> bin mapping data structures. This was merged into OpenMC in openmc-dev/openmc#3694. The Cardinal component of this implementation is quite simple - the std::set of blocks just needs to be passed to an openmc::AdaptiveLibMesh.

Impact

Large reduction in memory usage when providing block restrictions to a MeshTally. Not requiring a mesh copy also fixes a bug with on-the-fly element amalgamation that @magnoxemo found (extra element IDs were not being preserved during the copying process).

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