summaryrefslogtreecommitdiff
path: root/hpmr.py
diff options
context:
space:
mode:
Diffstat (limited to 'hpmr.py')
-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=",")