mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
Separate transport data from comments in parseTransportData
This commit is contained in:
committed by
Ray Speth
parent
3f382e2590
commit
d1df40af87
@@ -1933,21 +1933,23 @@ class Parser(object):
|
||||
|
||||
if '!' in line:
|
||||
line, comment = line.split('!', 1)
|
||||
data = line.split() + [comment]
|
||||
else:
|
||||
data = line.split()
|
||||
comment = None
|
||||
|
||||
data = line.split()
|
||||
|
||||
if len(data) < 7:
|
||||
raise InputParseError('Unable to parse transport data: not'
|
||||
' enough parameters on line {0} of "{1}".'.format(
|
||||
line_offset + i, filename))
|
||||
if len(data) > 8:
|
||||
if len(data) > 7:
|
||||
raise InputParseError('Extra parameters found in transport entry'
|
||||
' for species {0} in file {1}'.format(data[0], filename))
|
||||
|
||||
speciesName = data[0]
|
||||
if speciesName in self.speciesDict:
|
||||
if self.speciesDict[speciesName].transport is None:
|
||||
self.speciesDict[speciesName].transport = TransportData(*data)
|
||||
self.speciesDict[speciesName].transport = TransportData(*data, comment=comment)
|
||||
else:
|
||||
self.warn('Ignoring duplicate transport data'
|
||||
' for species "{0} on line {1} of "{2}".'.format(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
AR 0 136.500 3.330 0.000 0.000 0.000
|
||||
H 0 145.000 2.050 0.000 0.000 0.000
|
||||
H2 1 38.000 2.920 0.000 0.790 280.000
|
||||
H2O 2 572.400 2.605 1.8 0. 0.000 4.000 ! bad entry
|
||||
H2O 2 572.400 2.605 1.8 0. 0.000 4.000
|
||||
H2O2 2 107.400 3.458 0.000 0.000 3.800
|
||||
HO2 2 107.400 3.458 0.000 0.000 1.000 ! *
|
||||
O 0 80.000 2.750 0.000 0.000 0.000
|
||||
|
||||
Reference in New Issue
Block a user