mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Get rid of try/except block for lib.Material.get_density
This commit is contained in:
parent
731f2975bb
commit
ab80feb65a
1 changed files with 1 additions and 4 deletions
|
|
@ -233,10 +233,7 @@ class Material(_FortranObjectWithID):
|
|||
return self.densities.sum()
|
||||
elif units == 'g/cm3':
|
||||
density = c_double()
|
||||
try:
|
||||
_dll.openmc_material_get_density(self._index, density)
|
||||
except OpenMCError:
|
||||
return None
|
||||
_dll.openmc_material_get_density(self._index, density)
|
||||
return density.value
|
||||
else:
|
||||
raise ValueError("Units must be 'atom/b-cm' or 'g/cm3'")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue