mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
fixed optional xml reading
This commit is contained in:
parent
b63ec9cdc3
commit
f51f181761
1 changed files with 2 additions and 4 deletions
|
|
@ -1269,8 +1269,7 @@ class CylindricalMesh(StructuredMesh):
|
|||
mesh.r_grid = [float(x) for x in get_text(elem, "r_grid").split()]
|
||||
mesh.phi_grid = [float(x) for x in get_text(elem, "phi_grid").split()]
|
||||
mesh.z_grid = [float(x) for x in get_text(elem, "z_grid").split()]
|
||||
if "origin" in elem.attrib:
|
||||
mesh.origin = [float(x) for x in get_text(elem, "origin").split()]
|
||||
mesh.origin = [float(x) for x in get_text(elem, "origin", default=[0., 0., 0.]).split()]
|
||||
|
||||
return mesh
|
||||
|
||||
|
|
@ -1526,8 +1525,7 @@ class SphericalMesh(StructuredMesh):
|
|||
mesh.r_grid = [float(x) for x in get_text(elem, "r_grid").split()]
|
||||
mesh.theta_grid = [float(x) for x in get_text(elem, "theta_grid").split()]
|
||||
mesh.phi_grid = [float(x) for x in get_text(elem, "phi_grid").split()]
|
||||
if "origin" in elem.attrib:
|
||||
mesh.origin = [float(x) for x in get_text(elem, "origin").split()]
|
||||
mesh.origin = [float(x) for x in get_text(elem, "origin", default=[0., 0., 0.]).split()]
|
||||
|
||||
return mesh
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue