Merge pull request #634 from smharper/physor_fixes2

Minor input improvements
This commit is contained in:
Paul Romano 2016-04-27 22:22:48 -05:00
commit ae083cf5d4
2 changed files with 15 additions and 11 deletions

View file

@ -281,7 +281,7 @@ class Material(object):
'macroscopic data-set has already been added'.format(self._id)
raise ValueError(msg)
if not isinstance(nuclide, (openmc.Nuclide, str)):
if not isinstance(nuclide, (openmc.Nuclide, basestring)):
msg = 'Unable to add a Nuclide to Material ID="{0}" with a ' \
'non-Nuclide value "{1}"'.format(self._id, nuclide)
raise ValueError(msg)
@ -387,7 +387,7 @@ class Material(object):
Parameters
----------
element : openmc.Element
element : openmc.Element or str
Element to add
percent : float
Atom or weight percent
@ -401,7 +401,7 @@ class Material(object):
'macroscopic data-set has already been added'.format(self._id)
raise ValueError(msg)
if not isinstance(element, openmc.Element):
if not isinstance(element, (openmc.Element, basestring)):
msg = 'Unable to add an Element to Material ID="{0}" with a ' \
'non-Element value "{1}"'.format(self._id, element)
raise ValueError(msg)

View file

@ -92,18 +92,22 @@ contains
type(NodeList), pointer :: node_scat_list => null()
type(NodeList), pointer :: node_source_list => null()
! Display output message
call write_message("Reading settings XML file...", 5)
! Check if settings.xml exists
filename = trim(path_input) // "settings.xml"
inquire(FILE=filename, EXIST=file_exists)
if (.not. file_exists) then
call fatal_error("Settings XML file '" // trim(filename) // "' does not &
&exist! In order to run OpenMC, you first need a set of input files;&
& at a minimum, this includes settings.xml, geometry.xml, and &
&materials.xml. Please consult the user's guide at &
&http://mit-crpg.github.io/openmc for further information.")
if (run_mode /= MODE_PLOTTING) then
call fatal_error("Settings XML file '" // trim(filename) // "' does &
&not exist! In order to run OpenMC, you first need a set of input &
&files; at a minimum, this includes settings.xml, geometry.xml, &
&and materials.xml. Please consult the user's guide at &
&http://mit-crpg.github.io/openmc for further information.")
else
! The settings.xml file is optional if we just want to make a plot.
return
end if
else
call write_message("Reading settings XML file...", 5)
end if
! Parse settings.xml file