Skip to content

Adding nascent source site plot capability. - #131

Merged
paulromano merged 7 commits into
openmc-dev:developfrom
pshriwise:plot_ext_source
Oct 1, 2024
Merged

paulromano merged 7 commits into
openmc-dev:developfrom
pshriwise:plot_ext_source

Conversation

@pshriwise

@pshriwise pshriwise commented Jan 23, 2024 •

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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
Copy Markdown
Member

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

@pshriwise

pshriwise commented Jun 6, 2024 •

Copy link
Copy Markdown
Collaborator Author

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
Copy Markdown
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
Copy Markdown
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!

Comment thread openmc_plotter/plotgui.py Outdated
@pshriwise

Copy link
Copy Markdown
Collaborator Author

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

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

Plot source sites using opnemc.lib.sample_exeternal_source

3 participants