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

Adding get cylindrical mesh index at specified coordinates #2782

Merged
merged 12 commits into from
Dec 12, 2023

Conversation

shimwell
Copy link
Member

Description

This PR attempts to add the ability to get the cylindrical mesh index of a x,y,z coordinate. This is useful when users are trying to find the mesh value at a specific location.

usage is ...

openmc.CylindricalMesh(r_grid=(0, 5, 10), z_grid=(0, 5, 10))
r, phi, z = mesh.get_indices_at_coords(1, 0, 1)

Fixes # (issue)

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 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)

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.

Looks like a nice addition, thanks @shimwell! A few comments below:

openmc/mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
tests/unit_tests/test_mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
@shimwell
Copy link
Member Author

Thanks for the review @paulromano

I have gone through and I believe I've addressed all the review comments and adopted all suggestions.

@paulromano paulromano merged commit a833c17 into openmc-dev:develop Dec 12, 2023
18 checks passed
church89 pushed a commit to openmsr/openmc that referenced this pull request Jul 18, 2024
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