summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor Moore <connor.moore@psi.ch>2026-07-23 08:05:44 +0200
committerConnor Moore <connor.moore@psi.ch>2026-07-23 08:05:44 +0200
commite447cfccfddbd67f44307e6ab527f0fb4ce48976 (patch)
treecf8fac388ef23606ca6bbc1986e40221b9f939d9
parent52dd1c6a6808d8f0ea17a656f829bb63a714ef57 (diff)
Added support for reading saved packing data
-rwxr-xr-xhpmr.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/hpmr.py b/hpmr.py
index 02ace64..770a8ba 100755
--- a/hpmr.py
+++ b/hpmr.py
@@ -470,13 +470,16 @@ geo_triso_compact_region = -openmc.ZCylinder(r=geo_const_triso_radius,x0=0.0,y0=
geo_triso_compact_domain = (4,4,int(4*geo_const_height))
# Generate packing
-geo_triso_compact_packing = openmc.model.pack_spheres(
- radius=geo_triso_spheres[-1].r,
- region=-openmc.ZCylinder(r=geo_const_triso_radius-geo_triso_spheres[-1].r,x0=0.0,y0=0.0) & \
- +openmc.ZPlane(z0=-geo_const_height+geo_triso_spheres[-1].r) & \
- -openmc.ZPlane(z0=+geo_const_height-geo_triso_spheres[-1].r),
- pf=geo_const_triso_packing
- )
+if cli_args.packing:
+ geo_triso_compact_packing = np.loadtxt("positions.out",delimiter=",")
+else:
+ geo_triso_compact_packing = openmc.model.pack_spheres(
+ radius=geo_triso_spheres[-1].r,
+ region=-openmc.ZCylinder(r=geo_const_triso_radius-geo_triso_spheres[-1].r,x0=0.0,y0=0.0) & \
+ +openmc.ZPlane(z0=-geo_const_height+geo_triso_spheres[-1].r) & \
+ -openmc.ZPlane(z0=+geo_const_height-geo_triso_spheres[-1].r),
+ pf=geo_const_triso_packing
+ )
# Export positions to file for backup
np.savetxt("positions.out",geo_triso_compact_packing,delimiter=",")