Skip to content

Commit

Permalink
Add sphere to capabilities. Correct error message formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
pshriwise committed Sep 30, 2024
1 parent 0ddf087 commit 2315239
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/openmc_cad_adapter/to_cubit_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
from .geom_util import rotate, move

from .surfaces import (CADPlane, CADXPlane, CADYPlane, CADZPlane,
CADCylinder, CADXCylinder, CADYCylinder, CADZCylinder)
CADCylinder, CADXCylinder, CADYCylinder, CADZCylinder,
CADSphere)


_SURFACE_DICTIONARY = { 'plane': CADPlane,
Expand All @@ -33,6 +34,7 @@
'x-cylinder': CADXCylinder,
'y-cylinder': CADYCylinder,
'z-cylinder': CADZCylinder,
'sphere': CADSphere
}

def flatten(S):
Expand Down Expand Up @@ -91,7 +93,7 @@ def to_cubit_journal(geometry : openmc.Geometry, world : Iterable[Real] = None,
bbox = geometry.bounding_box
if not all(np.isfinite(bbox[0])) or not all(np.isfinite(bbox[1])):
raise RuntimeError('Model bounds were not provided and the bounding box determined by OpenMC is not finite.'
'Please provide a world size argument to proceed')
' Please provide a world size argument to proceed')
# to ensure that the box
box_max = np.max(np.abs(bbox[0], bbox[1]).T)
world_size = (2 * box_max, 2 * box_max, 2 * box_max)
Expand Down

0 comments on commit 2315239

Please sign in to comment.