Use surface type names consistently in XML input and Python API.

This commit is contained in:
Paul Romano 2015-09-25 20:38:50 +07:00
parent 3d2fe2a0ef
commit 47abbed148
3 changed files with 25 additions and 25 deletions

View file

@ -131,8 +131,8 @@ The current revision of the summary file format is 1.
**/geometry/surfaces/surface <uid>/type** (*char[]*)
Type of the surface. Can be 'X Plane', 'Y Plane', 'Z Plane', 'Plane', 'X
Cylinder', 'Y Cylinder', 'Sphere', 'X Cone', 'Y Cone', or 'Z Cone'.
Type of the surface. Can be 'x-plane', 'y-plane', 'z-plane', 'plane',
'x-cylinder', 'y-cylinder', 'sphere', 'x-cone', 'y-cone', or 'z-cone'.
**/geometry/surfaces/surface <uid>/coefficients** (*double[]*)

View file

@ -120,61 +120,61 @@ class Summary(object):
coeffs = self._f['geometry/surfaces'][key]['coefficients'][...]
# Create the Surface based on its type
if surf_type == 'X Plane':
if surf_type == 'x-plane':
x0 = coeffs[0]
surface = openmc.XPlane(surface_id, bc, x0, name)
elif surf_type == 'Y Plane':
elif surf_type == 'y-plane':
y0 = coeffs[0]
surface = openmc.YPlane(surface_id, bc, y0, name)
elif surf_type == 'Z Plane':
elif surf_type == 'z-plane':
z0 = coeffs[0]
surface = openmc.ZPlane(surface_id, bc, z0, name)
elif surf_type == 'Plane':
elif surf_type == 'plane':
A = coeffs[0]
B = coeffs[1]
C = coeffs[2]
D = coeffs[3]
surface = openmc.Plane(surface_id, bc, A, B, C, D, name)
elif surf_type == 'X Cylinder':
elif surf_type == 'x-cylinder':
y0 = coeffs[0]
z0 = coeffs[1]
R = coeffs[2]
surface = openmc.XCylinder(surface_id, bc, y0, z0, R, name)
elif surf_type == 'Y Cylinder':
elif surf_type == 'y-cylinder':
x0 = coeffs[0]
z0 = coeffs[1]
R = coeffs[2]
surface = openmc.YCylinder(surface_id, bc, x0, z0, R, name)
elif surf_type == 'Z Cylinder':
elif surf_type == 'z-cylinder':
x0 = coeffs[0]
y0 = coeffs[1]
R = coeffs[2]
surface = openmc.ZCylinder(surface_id, bc, x0, y0, R, name)
elif surf_type == 'Sphere':
elif surf_type == 'sphere':
x0 = coeffs[0]
y0 = coeffs[1]
z0 = coeffs[2]
R = coeffs[3]
surface = openmc.Sphere(surface_id, bc, x0, y0, z0, R, name)
elif surf_type in ['X Cone', 'Y Cone', 'Z Cone']:
elif surf_type in ['x-cone', 'y-cone', 'z-cone']:
x0 = coeffs[0]
y0 = coeffs[1]
z0 = coeffs[2]
R2 = coeffs[3]
if surf_type == 'X Cone':
if surf_type == 'x-cone':
surface = openmc.XCone(surface_id, bc, x0, y0, z0, R2, name)
if surf_type == 'Y Cone':
if surf_type == 'y-cone':
surface = openmc.YCone(surface_id, bc, x0, y0, z0, R2, name)
if surf_type == 'Z Cone':
if surf_type == 'z-cone':
surface = openmc.ZCone(surface_id, bc, x0, y0, z0, R2, name)
# Add Surface to global dictionary of all Surfaces

View file

@ -210,27 +210,27 @@ contains
! Write surface type
select case (s%type)
case (SURF_PX)
call write_dataset(surface_group, "type", "X Plane")
call write_dataset(surface_group, "type", "x-plane")
case (SURF_PY)
call write_dataset(surface_group, "type", "Y Plane")
call write_dataset(surface_group, "type", "y-plane")
case (SURF_PZ)
call write_dataset(surface_group, "type", "Z Plane")
call write_dataset(surface_group, "type", "z-plane")
case (SURF_PLANE)
call write_dataset(surface_group, "type", "Plane")
call write_dataset(surface_group, "type", "plane")
case (SURF_CYL_X)
call write_dataset(surface_group, "type", "X Cylinder")
call write_dataset(surface_group, "type", "x-cylinder")
case (SURF_CYL_Y)
call write_dataset(surface_group, "type", "Y Cylinder")
call write_dataset(surface_group, "type", "y-cylinder")
case (SURF_CYL_Z)
call write_dataset(surface_group, "type", "Z Cylinder")
call write_dataset(surface_group, "type", "z-cylinder")
case (SURF_SPHERE)
call write_dataset(surface_group, "type", "Sphere")
call write_dataset(surface_group, "type", "sphere")
case (SURF_CONE_X)
call write_dataset(surface_group, "type", "X Cone")
call write_dataset(surface_group, "type", "x-cone")
case (SURF_CONE_Y)
call write_dataset(surface_group, "type", "Y Cone")
call write_dataset(surface_group, "type", "y-cone")
case (SURF_CONE_Z)
call write_dataset(surface_group, "type", "Z Cone")
call write_dataset(surface_group, "type", "z-cone")
end select
! Write coefficients for surface