From e447cfccfddbd67f44307e6ab527f0fb4ce48976 Mon Sep 17 00:00:00 2001 From: Connor Moore Date: Thu, 23 Jul 2026 08:05:44 +0200 Subject: Added support for reading saved packing data --- hpmr.py | 17 ++++++++++------- 1 file 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=",") -- cgit v1.2.3