[CTI/Doc] Species and element names must be separated by spaces

Documentation claimed commas could be used as well, but this did not actually
work.

Resolves #341.
This commit is contained in:
Ray Speth 2016-06-29 18:13:41 -04:00
parent b26b8c4bab
commit e12738a5c4
2 changed files with 8 additions and 20 deletions

View file

@ -73,10 +73,10 @@ Declaring the Elements
^^^^^^^^^^^^^^^^^^^^^^
The elements that may be present in the phase are declared in the elements
field. This must be a string of element symbols separated by spaces and/or
commas. Each symbol must either match one listed in the database file
``elements.xml``, or else match the symbol of an element entry defined elsewhere
in the input file (See :ref:`sec-elements`).
field. This must be a string of element symbols separated by spaces. Each symbol
must either match one listed in the database file ``elements.xml``, or else
match the symbol of an element entry defined elsewhere in the input file (See
:ref:`sec-elements`).
The ``elements.xml`` database contains most elements of the periodic table, with
their natural-abundance atomic masses. It also contains a few isotopes (D, Tr),
@ -124,9 +124,7 @@ are locally defined. For each one, a corresponding species entry must be present
somewhere in the file, either preceding or following the phase entry. Note that
the string may extend over multiple lines by delimiting it with triple quotes::
# commas are optional
species = 'AR SI Si2 SiH SiH2 SiH3 SiH4'
species = 'H, O, OH, H2O, HO2, H2O2, H2, O2'
# include all species defined in this file
species = 'all'

View file

@ -1752,20 +1752,10 @@ class phase(object):
spnames = sp
self._sp.append(('', spnames))
# strip the commas, and make the list of species names
# 10/31/03: commented out the next line, so that species names may contain commas
#sptoks = spnames.replace(',',' ').split()
sptoks = spnames.split()
for s in sptoks:
# check for stray commas
if s != ',':
if s[0] == ',': s = s[1:]
if s[-1] == ',': s = s[:-1]
if s != 'all' and s in self._spmap:
raise CTI_Error('Multiply-declared species '+s+' in phase '+self._name)
self._spmap[s] = self._dim
for s in spnames.split():
if s != 'all' and s in self._spmap:
raise CTI_Error('Multiply-declared species '+s+' in phase '+self._name)
self._spmap[s] = self._dim
self._rxns = reactions