Skip to content

Add length_multiplier to scale DAGMCUniverse - #4033

Merged
pshriwise merged 14 commits into
openmc-dev:developfrom
ssgudala-bwxt:dagmc-length-multiplier
Jul 31, 2026
Merged

Add length_multiplier to scale DAGMCUniverse#4033
pshriwise merged 14 commits into
openmc-dev:developfrom
ssgudala-bwxt:dagmc-length-multiplier

Conversation

@ssgudala-bwxt

@ssgudala-bwxt ssgudala-bwxt commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description

Adds support for a length_multiplier argument on openmc.DAGMCUniverse so DAGMC geometry can be uniformly scaled at load time.

This change wires the new parameter through the Python API, XML/HDF5 serialization, and the C++ DAGMC initialization path. When provided, OpenMC scales DAGMC vertex coordinates before building.
Python-side bounding-box helpers are also updated to reflect the scaled geometry.

Fixes # 3200

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 18) on any C++ source files (if applicable)
  • I have followed the style guidelines for Python source files (if applicable)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

@ssgudala-bwxt
ssgudala-bwxt requested a review from pshriwise as a code owner July 28, 2026 17:18

@GuySten GuySten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added some small suggestions.

Comment thread include/openmc/dagmc.h Outdated
Comment thread include/openmc/dagmc.h Outdated
Comment thread include/openmc/dagmc.h Outdated
Comment thread docs/source/io_formats/geometry.rst Outdated
Comment thread openmc/dagmc.py Outdated
Comment thread openmc/dagmc.py Outdated
Comment thread openmc/dagmc.py
Comment thread src/dagmc.cpp Outdated
Comment thread src/dagmc.cpp Outdated
Comment thread src/dagmc.cpp Outdated
Have a check that length_multiplier > 0. Make default=1.0 instead of -1.0.

Co-authored-by: GuySten <62616591+GuySten@users.noreply.github.com>
@ssgudala-bwxt

Copy link
Copy Markdown
Contributor Author

Added your changes @GuySten

@GuySten GuySten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me except for two things.

  1. I want to make sure that this PR does not affect performance of very large dagmc models.
    @shimwell, can you check if using this PR with length_multiplier for a complicated dagmc model does not affect loading time too harshly.

  2. I think we should test this feature directly. For example by using stochastic volume calculation of a dagmc model of a ball with length_multiplier and checking it against the expected analytical result.

@ssgudala-bwxt

ssgudala-bwxt commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Sure I can do #(2) @GuySten, what would be the best way for me to share that here? Just show the input and results?

@GuySten

GuySten commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@ssgudala-bwxt, I meant adding a unit test.

@pshriwise

Copy link
Copy Markdown
Contributor

Great idea @ssgudala-bwxt! I'll have a look at this in the next day or so.

@pshriwise pshriwise left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small ask for an HDF5 roundtrip unit test as well but then I think this is good to go.

Thank you @ssgudala-bwxt!

@ssgudala-bwxt

Copy link
Copy Markdown
Contributor Author

I added two hdf5 unit tests. Let me know if one or both of them are what you had in mind @pshriwise

@pshriwise pshriwise left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ssgudala-bwxt!

@pshriwise
pshriwise merged commit 798b39d into openmc-dev:develop Jul 31, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scale geometry when making DAGMCUniverse

3 participants