Task 3: CSG Geometry #215
Unanswered
eitan-weinstein
asked this question in
Q&A
Replies: 2 comments 1 reply
-
This works over here when I run in the docker image. Are you using the Docker image? Perhaps try saving the images instead universe.plot(basis='xz', color_by='material', colors=color_assignment)
plt.savefig('xz.png') |
Beta Was this translation helpful? Give feedback.
1 reply
-
I've just come across the same issue as @eitan-weinstein when giving task 3 a go. I believe the issue is that, for the first three examples, "color_by='material'" is used as opposed to "color_by='cell'" when plotting. This is not an issue for the fourth example, shown above, as colouring by the material is desired here. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi again,
Thanks for all the help getting things initialized. Tasks one and two went by smoothly. For task three, though, I'm having trouble getting the geometry to actually be plotted in task one. In the first code block of part 1, the universe plots are only showing up us empty white plots, without any of the actual geometry. Here's what I'm working with:
`import openmc
import matplotlib.pyplot as plt
example surfaces
inner_sphere_surface = openmc.Sphere(r=500)
outer_sphere_surface = openmc.Sphere(r=600)
above (+) inner_sphere_surface and below (-) outer_sphere_surface
blanket_region = +inner_sphere_surface & -outer_sphere_surface
example cell
blanket_cell = openmc.Cell(region=blanket_region)
makes a universe to cotain all the cells
universe = openmc.Universe(cells=[blanket_cell])
shows the plots, as the geometry is symmetrical the plots look the same
color_assignment = {blanket_cell: 'blue'}
plt.show(universe.plot(basis='xz', color_by='material', colors=color_assignment))
plt.show(universe.plot(basis='xy', color_by='material', colors=color_assignment))
plt.show(universe.plot(basis='yz', color_by='material', colors=color_assignment))`
Is there any syntax that needs to be modified to make this work properly or is there some other software dependency that I should know about to be able to generate this?
Beta Was this translation helpful? Give feedback.
All reactions