Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cylindrical mesh lower left Z value corrected #2684

Merged

Conversation

shimwell
Copy link
Member

@shimwell shimwell commented Sep 5, 2023

Description

I think the CylindricalMesh.bounding_box.lower_left Z value might not be correct.

Steps to reproduce

import oenmc
mesh = openmc.CylindricalMesh(
    r_grid=[1,2,3],
    z_grid=[0,10,20,30]
)
print(mesh.bounding_box)
BoundingBox(lower_left=(-3.0, -3.0, -30.0), upper_right=(3.0, 3.0, 30.0))

I was expecting the result to be
BoundingBox(lower_left=(-3.0, -3.0, 0.0), upper_right=(3.0, 3.0, 30.0)) but it currently returns -30 instead of 0 for the lower left z value. As the mesh.origin is 0,0,0 and the z_grid goes from the origin upwards in steps of 0,10,20,30. There is no negative value in the z grid so I think the lower left value is not calculated correctly at the moment

Checklist

  • I have performed a self-review of my own code
  • I have followed the style guidelines for Python source files (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

Copy link
Contributor

@paulromano paulromano left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@paulromano paulromano merged commit be7a9c3 into openmc-dev:develop Sep 6, 2023
stchaker pushed a commit to stchaker/openmc that referenced this pull request Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants