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 nascent source site plot capability. #131

Merged
merged 7 commits into from
Oct 1, 2024

Conversation

pshriwise
Copy link
Collaborator

@pshriwise pshriwise commented Jan 23, 2024

This feature is a little rough still but it adds the ability to plot source sites on top of the current view. All sites are plotted whether they're on the slice plane or not. There are a number of things I'd want to add (see below) before incorporating this, but it has a significant amount in place so I thought I'd create a draft PR at least.

See utilization in openmc-dev/openmc#2857

TODO:

  • Toggle for source site visibility in the main dock
  • Toggle filter of visible souce sites based on coincidence with slice plane
  • Arrows for source locations
  • Colormap bar for particle energy

@shimwell
Copy link
Member

Nice to see this PR, I remember a few people where asking for this on the slack channel a while back.

I'm keen to mirror this functionality on the python api if that is ok

@shimwell
Copy link
Member

Perhaps a variable could be added for number of source samples (n_samples)

@pshriwise
Copy link
Collaborator Author

pshriwise commented Jun 6, 2024

I built this out a little bit today and I'm pretty happy with it now. The animation below shows an annular CylindricalIndependent source with R=1 and Z=[0,10]. Main additions include the ability to toggle visibility, change the color, and filter source particles out that are too far from the slice plane.

Recording

@pshriwise pshriwise marked this pull request as ready for review June 6, 2024 19:56
@pshriwise
Copy link
Collaborator Author

A couple of features to be added yet I suppose, but I'd call this a good base for the feature and wouldn't mind seeing it merged as-is

@paulromano
Copy link
Contributor

@pshriwise I ended up just forging ahead and implementing the changes we talked about today. Let me know if you're happy with how it looks/functions and if so, we can go ahead and merge. Thanks for adding this feature!

openmc_plotter/plotgui.py Outdated Show resolved Hide resolved
@pshriwise
Copy link
Collaborator Author

@bohmt so you can use this once it's merged.

@paulromano paulromano merged commit b5a1fd9 into openmc-dev:develop Oct 1, 2024
1 check passed
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.

Plot source sites using opnemc.lib.sample_exeternal_source
3 participants