diff --git a/SConstruct b/SConstruct index 3af7445a6..ae4ac26a6 100644 --- a/SConstruct +++ b/SConstruct @@ -1044,7 +1044,7 @@ if addInstallActions: # Converter scripts pyExt = '.py' if env['OS'] == 'Windows' else '' install(env.InstallAs, - pjoin('$inst_bindir','ck2cti2%s' % pyExt), + pjoin('$inst_bindir','ck2cti%s' % pyExt), 'interfaces/python/ck2cti.py') install(env.InstallAs, pjoin('$inst_bindir','ctml_writer%s' % pyExt), diff --git a/cantera.pc.in b/cantera.pc.in index 869e3e3ef..0b143a424 100644 --- a/cantera.pc.in +++ b/cantera.pc.in @@ -14,7 +14,7 @@ URL: http://code.google.com/p/cantera/ Requires: Version: 2.0.0 -LINK = -lctcxx -luser -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode -lctlapack -lctblas -lctf2c -lm -lstdc++ +LINK = -lctcxx -luser -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode -lctlapack -lctblas -lctf2c -lm -lstdc++ #Libs: -L${libdir} ${LINK} #Cflags: -I${includedir} diff --git a/configure.ac b/configure.ac index 9573708da..14d19e2e9 100644 --- a/configure.ac +++ b/configure.ac @@ -155,7 +155,6 @@ AC_OUTPUT(Makefile \ src/Makefile \ src/fortran/Makefile \ src/base/Makefile \ - src/converters/Makefile \ src/kinetics/Makefile \ src/numerics/Makefile src/oneD/Makefile \ src/thermo/Makefile \ @@ -166,8 +165,6 @@ AC_OUTPUT(Makefile \ cantera.pc) # skipped tests -# test_problems/ck2cti/Makefile -# test_problems/nasa9_reader/Makefile # test_problems/rankine_democxx/Makefile # test_problems/VCSnonideal/NaCl_equil/Makefile diff --git a/doc/doxygen/Doxyfile b/doc/doxygen/Doxyfile index ef9ea4f25..727fd809c 100644 --- a/doc/doxygen/Doxyfile +++ b/doc/doxygen/Doxyfile @@ -595,7 +595,6 @@ WARN_LOGFILE = INPUT = src/apps \ src/base \ - src/converters \ src/equil \ src/kinetics \ src/numerics \ diff --git a/platform/posix/man/ck2cti.1 b/platform/posix/man/ck2cti.1 index 74452514a..f6550e4de 100644 --- a/platform/posix/man/ck2cti.1 +++ b/platform/posix/man/ck2cti.1 @@ -1,65 +1,55 @@ -.TH "ck2cti" 1 "16 Nov 2003" "ck2cti" \" -*- nroff -*- +.TH "ck2cti2" 1 "4 Jun 2012" "ck2cti2" \" -*- nroff -*- .ad l .nh .SH NAME -ck2cti \- convert a Chemkin-II-format reaction mechanism file to Cantera input format. +ck2cti2 \- convert Chemkin-II-format mechanisms to Cantera input files (.cti) .SH SYNOPSIS -.br -ck2cti \fB-i \fIinput \fR[\fB-t \fIthermo\fR] \fR[\fB-tr\fI transport\fR] -\fR[\fB-id\fI idtag\fR] +.B ck2cti2 +--input=\fImech-file\fR +[--thermo=\fIthermo-file\fR] +[--transport=\fItransport-file\fR] +[--id=\fIphase-id\fR] +[--output=\fIout-file\fR] +[-d | --debug] .SH DESCRIPTION -.I ck2cti +.I ck2cti2 converts a Chemkin-II-format reaction mechanism file to Cantera input format. The resulting Cantera input file contains a definition of one .B ideal_gas entry that represents an ideal gas mixture corresponding to the Chemkin-II reaction mechanism. The file also contains Cantera-format definitions for each species and each reaction in the input reaction -mechanism file. The Cantera-format text is written to the standard -output. +mechanism file. The Cantera-format mechanism is written to +.I out-file The parameters are as follows: .TP -.I input -Chemkin-II reaction mechanism file to be converted. Required. +.B --input=\fImech-file\fR +Chemkin-II reaction mechanism file to be converted. Required. This +file must contain the declarations of the elements and species, as +well as the reactions (if any). It may also contain the thermodyamic +and transport data. .TP -.I thermo +.B --thermo=\fIthermo-file\fR Thermodynamic property database. If the THERMO section of the input file is missing or does not have entries for one or more species, this -file will be searched for the required thermo data. This file may be -another reaction mechanism file containing a THERMO section, or a -Chemkin-II-compatible thermodynamic database file. +file will be searched for the required thermo data. .TP -.I transport +.B --transport=\fItransport-file\fR Transport property database. If this file name is supplied, transport property parameters will be taken from this file and included in the -output Cantera-format file. If this parameter is omitted, no transport +output Cantera-format file. If this parameter is omitted, and no +TRANSPORT section was included in the main input file, no transport property parameters will be included in the output. .TP -.I id -Identification string. The \fBideal_gas\fR entry in the Cantera-format -output has name \fIid\fR. If this parameter is omitted, it will be set -to the input file name without the extension. Since only one phase -definition is present in the \fIck2cti\fR output, this parameter is -not required. +.B --id=\fIphase-id\fR +Optional identification string, used to set the \fIid\fR field of the +\fBideal_gas\fR entry in the Cantera-format output. If this parameter +is omitted, it will be set to +.B gas -.SH EXAMPLES - -Create a Cantera input file from a self-contained Chemkin-format file -without transport parameters: -.TP -ck2cti -i mech.inp > mech.cti -.TP -Create a Cantera input file from a Chemkin-format file that requires a -separate thermodynamic database -without transport parameters: -.TP -ck2cti -i mech.inp -t therm.dat > mech.cti -.TP -Create a Cantera input file from a Chemkin-format file that requires a -separate thermodynamic database and include transport parameters: -.TP -ck2cti -i mech.inp -t therm.dat -tr tran.dat > mech.cti +.SH EXAMPLE +ck2cti2 --input=chem.inp --thermo=therm.dat --transport=tran.dat diff --git a/platform/posix/man/ck2cti2.1 b/platform/posix/man/ck2cti2.1 deleted file mode 100644 index f6550e4de..000000000 --- a/platform/posix/man/ck2cti2.1 +++ /dev/null @@ -1,55 +0,0 @@ -.TH "ck2cti2" 1 "4 Jun 2012" "ck2cti2" \" -*- nroff -*- -.ad l -.nh -.SH NAME -ck2cti2 \- convert Chemkin-II-format mechanisms to Cantera input files (.cti) - -.SH SYNOPSIS -.B ck2cti2 ---input=\fImech-file\fR -[--thermo=\fIthermo-file\fR] -[--transport=\fItransport-file\fR] -[--id=\fIphase-id\fR] -[--output=\fIout-file\fR] -[-d | --debug] - -.SH DESCRIPTION - -.I ck2cti2 -converts a Chemkin-II-format reaction mechanism file to Cantera input -format. The resulting Cantera input file contains a definition of one -.B ideal_gas -entry that represents an ideal gas mixture corresponding to the -Chemkin-II reaction mechanism. The file also contains Cantera-format -definitions for each species and each reaction in the input reaction -mechanism file. The Cantera-format mechanism is written to -.I out-file - -The parameters are as follows: -.TP -.B --input=\fImech-file\fR -Chemkin-II reaction mechanism file to be converted. Required. This -file must contain the declarations of the elements and species, as -well as the reactions (if any). It may also contain the thermodyamic -and transport data. -.TP -.B --thermo=\fIthermo-file\fR -Thermodynamic property database. If the THERMO section of the input -file is missing or does not have entries for one or more species, this -file will be searched for the required thermo data. -.TP -.B --transport=\fItransport-file\fR -Transport property database. If this file name is supplied, transport -property parameters will be taken from this file and included in the -output Cantera-format file. If this parameter is omitted, and no -TRANSPORT section was included in the main input file, no transport -property parameters will be included in the output. -.TP -.B --id=\fIphase-id\fR -Optional identification string, used to set the \fIid\fR field of the -\fBideal_gas\fR entry in the Cantera-format output. If this parameter -is omitted, it will be set to -.B gas - -.SH EXAMPLE -ck2cti2 --input=chem.inp --thermo=therm.dat --transport=tran.dat diff --git a/samples/cxx/Makefile.am b/samples/cxx/Makefile.am index 57263ec09..1e961e7a7 100644 --- a/samples/cxx/Makefile.am +++ b/samples/cxx/Makefile.am @@ -6,7 +6,7 @@ cc_sources = examples.cpp kinetics_example1.cpp kinetics_example2.cpp \ rxnpath_example1.cpp LINK = -lctcxx -luser -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ LIBS = -L$(top_builddir)/build/lib/ $(LINK) diff --git a/src/Makefile.am b/src/Makefile.am index 9b01e381c..c62e8a5bf 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,5 @@ # will need to add python and matlab -SUBDIRS = base numerics converters thermo transport oneD zeroD kinetics spectra equil fortran tpx +SUBDIRS = base numerics thermo transport oneD zeroD kinetics spectra equil fortran tpx diff --git a/src/SConscript b/src/SConscript index 3072f5853..7f97567de 100644 --- a/src/SConscript +++ b/src/SConscript @@ -27,7 +27,6 @@ libs = [('base', ['cpp'], baseSetup), ('thermo', ['cpp'], defaultSetup), ('tpx', ['cpp'], defaultSetup), ('equil', ['cpp','c'], equilSetup), - ('converters', ['cpp'], defaultSetup), ('numerics', ['cpp'], numericsSetup), ('kinetics', ['cpp'], defaultSetup), ('transport', ['cpp'], defaultSetup), diff --git a/src/apps/SConscript b/src/apps/SConscript index 9b7f3034d..0a9752080 100644 --- a/src/apps/SConscript +++ b/src/apps/SConscript @@ -11,7 +11,6 @@ def buildProgram(name, src): install('$inst_bindir', prog) buildProgram('cti2ctml', ['cti2ctml.cpp']) -buildProgram('ck2cti', ['ck2cti.cpp']) if env['layout'] != 'debian': buildProgram('csvdiff', ['csvdiff.cpp', 'tok_input_util.cpp', 'mdp_allo.cpp']) diff --git a/src/apps/ck2cti.cpp b/src/apps/ck2cti.cpp deleted file mode 100644 index f8e23d4b7..000000000 --- a/src/apps/ck2cti.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/** - * @file ck2cti.cpp - * - * Program to convert Chemkin-II-format reaction mechanism files to - * Cantera input format. The resulting Cantera input file contains a - * definition of one ideal_gas entry that represents an ideal gas - * mixture corresponding to the Chemkin-II reaction mechanism. The - * file also contains Cantera-format definitions for each species and - * each reaction in the input reaction mechanism file. - * - * Usage: ck2cti -i input -t thermo -tr transport -id idtag - * - * The Cantera-format text is written to the standard output. - * - * @param input Chemkin-II reaction mechanism file to be converted. Required. - * - * @param thermo Thermodynamic property database. If the THERMO section of the - * input file is missing or does not have entries for one or more species, - * this file will be searched for the required thermo data. This file may - * be another reaction mechanism file containing a THERMO section, or - * a Chemkin-II-compatible thermodynamic database file. - * - * @param transport Transport property database. If this file name is supplied, - * transport property parameters will be taken from this file and - * included in the output Cantera-format file. If this parameter is omitted, - * no transport property parameters will be included in the output. - * - * @param id idtag. The ideal_gas entry in the Cantera-format output - * has name \i idtag. If this parameter is omitted, it will be set to the - * input file name without the extension. Since only one phase definition - * is present in the ck2cti output, this parameter is not required. - */ -#include -#include -using namespace std; - -#include "cantera/base/ct_defs.h" -#include "cantera/base/global.h" -#include "converters/ck2ct.h" - -using namespace Cantera; - -int showHelp() -{ - cout << "\nck2cti: convert a CK-format reaction mechanism file to Cantera input format.\n" - << "\n D. G. Goodwin, Caltech \n" - << " Version 1.0, August 2003.\n\n" - << endl; - cout << "options:" << endl; - cout << " -i \n" - << " -t \n" - << " -tr \n" - << " -id \n" - << " -d print debugging output \n\n" - << " -v validate the input file \n\n" - << "The results are written to the standard output.\n"; - return 0; -} - -string getp(int& i, int argc, char** args) -{ - string a="--"; - if (i < argc-1) { - a = string(args[i+1]); - } - if (a[0] == '-') { - a = ""; - } else { - i += 1; - } - return a; -} - - -int main(int argc, char** argv) -{ -#ifdef _MSC_VER - _set_output_format(_TWO_DIGIT_EXPONENT); -#endif - string infile="chem.inp", dbfile="", trfile="", logfile; - string idtag = "gas"; - bool debug = false; - bool validate = false; - int i=1; - if (argc == 1) { - return showHelp(); - } - - while (i < argc) { - string arg = string(argv[i]); - if (arg == "-i") { - infile = getp(i,argc,argv); - } else if (arg == "-t") { - dbfile = getp(i,argc,argv); - } else if (arg == "-tr") { - trfile = getp(i,argc,argv); - } else if (arg == "-id") { - idtag = getp(i,argc,argv); - } else if (arg == "-d") { - debug = true; - cout << "### DEBUG MODE ###" << endl; - } else if (arg == "-v") { - validate = true; - cout << "### VALIDATION ENABLED ###" << endl; - } else if (arg == "-h" || argc < 3) { - return showHelp(); - } else { - cout << "unknown option:" << arg << endl; - exit(-1); - } - ++i; - } - - int ierr = pip::convert_ck(infile.c_str(), dbfile.c_str(), trfile.c_str(), - idtag.c_str(), debug, validate); - - if (ierr < 0) { - showErrors(std::cerr); - } - return ierr; -} diff --git a/src/converters/CKParser.cpp b/src/converters/CKParser.cpp deleted file mode 100644 index e7e2f7b06..000000000 --- a/src/converters/CKParser.cpp +++ /dev/null @@ -1,1573 +0,0 @@ -/** - * @file CKParser.cpp - * - */ - -// Copyright 2001 California Institute of Technology - -#include -#include -#include -#include -#include - -#include "CKParser.h" -#include "ckr_utils.h" -#include "writelog.h" -#include -#include - -using namespace std; - -namespace ckr -{ - - -static string int2s(int n, std::string fmt="%d") -{ - char buf[30]; - sprintf(buf, fmt.c_str(), n); - return string(buf); -} - -/// Exception class for syntax errors. -CK_SyntaxError::CK_SyntaxError(std::ostream& f, - const std::string& s, int linenum) - : m_out(f) -{ - m_msg += "Syntax error: " + s; - if (linenum > 0) { - m_msg += " (line " + int2s(linenum) + ")\n"; - } -} - - -static int parseGroupString(std::string str, std::vector& esyms, - vector_int& result); - -/** - * Throw an exception if one of the four lines that must have - * 1, 2, 3, or 4 in column 80 do not. - */ -static void illegalThermoLine(std::ostream& f, - char n, int linenum = -1) -{ - throw CK_SyntaxError(f, "column 80 must " - "contain an integer", linenum); -}; - - -/** - * Throw an exception if number string is bad - */ -static void illegalNumber(std::ostream& f, - std::string s, int linenum = -1) -{ - string msg = "illegal number: "+s; - throw CK_SyntaxError(f, msg, linenum); -}; - - -extern void getDefaultAtomicWeights(std::map& weights); - -static string d2e(string s) -{ - size_t n; - size_t sz = s.size(); - string r = s; - char ch; - for (n = 0; n < sz; n++) { - ch = s[n]; - if (ch == 'D') { - r[n] = 'E'; - } else if (ch == 'd') { - r[n] = 'e'; - } - } - return r; -} - -static double de_atof(std::string s) -{ - string r = d2e(s); - //double rval = Cantera::atofCheck(r.c_str()); - double rval = atof(r.c_str()); - return rval; -} - -/** - * Check validity of the temperatures defining the - * temperature ranges for the NASA9 polynomial species thermodynamic - * property fits. - * @param log log file output stream - * @param temp Vector of temperatures - */ -static void checkNASA9Temps(std::ostream& log, vector_fp& temp) -{ - int i; - for (i = 1; i < (int) temp.size(); i++) { - double tlow = temp[i-1]; - double thigh = temp[i]; - if (thigh <= tlow) { - string sss = "error reading temperature"; - throw CK_SyntaxError(log, sss); - } - } -} - - -static double getNumberFromString(std::string s) -{ - bool inexp = false; - removeWhiteSpace(s); - int sz = static_cast(s.size()); - char ch; - for (int n = 0; n < sz; n++) { - ch = s[n]; - if (!inexp && (ch == 'E' || ch == 'e' || ch == 'D' || ch == 'd')) { - inexp = true; - } else if (ch == '+' || ch == '-') { - if (n > 0 && (s[n-1] != 'E' && s[n-1] - != 'e' && s[n-1] != 'd' && s[n-1] != 'D')) { - return UNDEF; - } - } else if (ch != '.' && (ch < '0' || ch > '9')) { - return UNDEF; - } - } - return de_atof(s); -} - -/** - * Add an element to a species. - * @param symbol element symbol - * @param atoms number of atoms of this element in the - * species (may be non-integral) - * @param sp Species object to add element to - * @param log log file output stream - */ -static void addElement(std::string symbol, double atoms, - Species& sp, std::ostream& log) -{ - - if (atoms != 0.0) { - Constituent e; - e.name = symbol; - e.number = atoms; - sp.elements.push_back(e); - sp.comp[symbol] = atoms; - } -} - - -/** - * Check validity of the three temperatures defining the two - * temperature ranges for the NASA polynomial species thermodynamic - * property fits. - * @param log log file output stream - * @param tmin minimum temperature - * @param tmid intermediate temperature - * @param tmax maximum temperature - */ -static void checkTemps(std::ostream& log, double tmin, - double tmid, double tmax) -{ - if (tmin == 0.0 || tmid == 0.0 || tmax == 0.0) { - throw CK_SyntaxError(log, - "error reading Tmin, Tmid, or Tmax"); - } -} - -static void getSpecies(std::string s, - int n, vector& species, bool debug, - std::ostream& log) -{ - removeWhiteSpace(s); - // break string into substrings at the '+' characters separating - // species symbols - - bool inplus = true; - vector pluses; - vector sp; - for (int i = n-1; i >= 0; i--) { - if (!inplus && s[i] == '+') { - pluses.push_back(i); - inplus = true; - } else if (inplus && s[i] != '+') { - inplus = false; - } - } - pluses.push_back(-1); - size_t np = pluses.size(); - size_t loc, nxt; - for (size_t nn = 0; nn < np; nn++) { - loc = pluses.back(); - pluses.pop_back(); - if (nn == np-1) { - nxt = s.size(); - } else { - nxt = pluses.back(); - } - sp.push_back(s.substr(loc+1,nxt-loc-1)); - } - - string r, num; - size_t sz, j, strt=0; - RxnSpecies ss; - for (size_t nn = 0; nn < sp.size(); nn++) { - r = sp[nn]; - sz = r.size(); - for (j = 0; j < sz; j++) { - if (!((r[j] >= '0' && r[j] <= '9') || r[j] == '.')) { - strt = j; - break; - } - } - ss.name = r.substr(strt,sz); - if (strt == 0) { - ss.number = 1.0; - } else { - ss.number = atof(r.substr(0,strt).c_str()); - } - species.push_back(ss); - if (debug) { - log << ss.number << " " << ss.name << endl; - } - } -} - - -/** - * given a string specifying either the reactant or product side of a - * reaction equation, construct a list of Constituent objects - * containing the species symbols and stoichiometric coefficients. - * @todo allow non-integral stoichiometric coefficients - */ -int getGroups(std::string::const_iterator begin, - std::string::const_iterator end, std::vector& esyms, - std::vector& rxngroups) -{ - bool ingroup = false; - rxngroups.clear(); - string g = ""; - group_t igrp; - grouplist_t groups; - - for (; begin != end; ++begin) { - if (*begin == '(') { - ingroup = true; - g = ""; - } else if (*begin == ')') { - ingroup = false; - igrp.clear(); - if (parseGroupString(g, esyms, igrp) >= 0) { - groups.push_back(igrp); - } else { - return -1; - } - } else if (*begin == '+') { - rxngroups.push_back(groups); - groups.clear(); - } else if (ingroup && *begin != ' ') { - g += *begin; - } - } - rxngroups.push_back(groups); - return 1; -} - - -/** - * Constructor. Construct a parser for the specified input file. - */ -CKParser::CKParser(std::istream* infile, const std::string& fname, - std::ostream* log) : - verbose(true), - debug(false), - m_line(0), - m_nasafmt(false), - m_nasa9fmt(false) -{ - m_ckfile = infile; - m_ckfilename = fname; - m_log = log; - m_last_eol = '\n'; -} - - - -// Get a line from the input file, and return it in string s. -/* - * If the line contains a comment character (!), then return only the - * portion preceding it. Non-printing characters are replaced by - * spaces. - * - * The input file is m_ckfile, an istream. - * - * @param s On return, s contains the line read from the - * input file. - * @param comment On return, comment contains the text following the - * comment character on the line, if any. - */ -void CKParser::getCKLine(std::string& s, std::string& comment) -{ - - // Chemkin comment character - const char commentChar = '!'; - - // Cantera anti-comment character - const char undoCommentChar = '%'; - - // carriage return - const char char13 = char(13); - - // linefeed - const char char10 = char(10); - - istream& f = *m_ckfile; - - // if putCKLine was called to 'put back' a line, then return this - // line, instead of reading a new one - - if (!m_buf.empty()) { - s = m_buf; - m_buf = ""; - comment = m_comment; - m_comment = ""; - return; - } - - // read a line, convert non-printing characters to ' ', - // and remove comments - - comment = ""; - string line; - - line = ""; - char ch = ' '; - while (1 > 0) { - f.get(ch); - if (!f || f.eof()) { - break; - } - - // convert tabs to spaces - if (ch == '\t') { - ch = ' '; - } - - // if an end-of-line character is seen, then break. - // Check for all common end-of-line characters. - if (ch == char13 || (ch == char10 && (m_last_eol != char13))) { - m_last_eol = ch; - break; - } - if (isprint(ch)) { - line += ch; - } - } - - string::size_type icom = line.find(commentChar); - - // lines that begin with !% are not comments for Cantera - if (icom == 0 && line.size() > 1 && line[1] == undoCommentChar) { - line[0] = '%'; - line[1] = ' '; - icom = line.find(commentChar); - } - int len = static_cast(line.size()); - - for (int i = 0; i < len; i++) if (!isprint(line[i])) { - line[i] = ' '; - } - if (icom != string::npos) { - s = line.substr(0, icom); - comment = line.substr(icom+1,len-icom-1); - } else { - s = line; - } - - if (!f || f.eof()) { - s = ""; - comment = ""; - return; - } - m_line++; -} - - -/** - * - * Put back a line read from the input file. The next call to - * getCKLine will return this line. - * - */ - -void CKParser::putCKLine(std::string& s, std::string& comment) -{ - m_buf = s; - m_comment = comment; -} - - -bool CKParser::advanceToKeyword(const std::string& kw, const std::string& stop) -{ - string s, c; - do { - getCKLine(s,c); - if (match(s,"")) { - return false; - } - if (match(s,kw)) { - putCKLine(s,c); - return true; - } - } while (!match(s,stop)); - putCKLine(s,c); - return false; -} - - - -/** - * - * Read the element section of the input file, and return - * a list of the elements found. - * - */ - -bool CKParser::readElementSection(elementList& elements) -{ - string s, comment; - int firsttok; - vector toks; - - map defaultWeights; - //ct::ctmap_sd defaultWeights; - getDefaultAtomicWeights(defaultWeights); - - //istream& f = m_ckfile; - int ntok; - - elements.clear(); - while (1 > 0) { - -next: - if (advanceToKeyword("ELEM", "SPEC")) { - firsttok = 1; - while (1 > 0) { - do { - getCKLine(s, comment); - getTokens(s, static_cast(s.size()), toks); - ntok = static_cast(toks.size()); - } while (ntok == 0); - - if (firsttok == 0 && isKeyword(toks[0])) { - putCKLine(s,comment); - goto next; - } - for (int i = firsttok; i < ntok; i++) { - if (match(toks[i],"END")) { - goto next; - } else { - Element el; - string wtstr; - el.comment = comment; - el.index = static_cast(elements.size()); - if (extractSlashData(toks[i], el.name, wtstr)) { - el.atomicWeight = de_atof(wtstr); - el.weightFromDB = false; - } else { - el.atomicWeight = defaultWeights[capitalize(el.name)]; - el.weightFromDB = true; - } - if (el.atomicWeight > 0.0) { - el.valid = 1; - } else { - el.valid = 0; - } - if (find(elements.begin(), - elements.end(), el) < elements.end()) { - if (m_log) - *m_log << "warning... duplicate element " - << el.name << " (ignored)." << endl; - } else { - elements.push_back(el); - } - } - } - firsttok = 0; - } - } else { - if (elements.size() == 0) { - *m_log << "no elements found." << endl; - return false; - } else { - return valid(elements); - } - } - } - return false; -} - - - -/** - * - * Read the SPECIES section of the input file, and return - * a list of species names. - * - */ -bool CKParser::readSpeciesSection(speciesList& species) -{ - string s, comment; - int firsttok; - vector toks; - - int ntok; - int nsp = 0; - - while (1 > 0) { - -next: - if (advanceToKeyword("SPEC", "THER")) { - firsttok = 1; - while (1 > 0) { - do { - getCKLine(s, comment); - getTokens(s, static_cast(s.size()), toks); - ntok = static_cast(toks.size()); - } while (ntok == 0); - - if (firsttok == 0 && isKeyword(toks[0])) { - putCKLine(s,comment); - goto next; - } - for (int i = firsttok; i < ntok; i++) { - if (match(toks[i],"END")) { - goto next; - } else { - Species sp; - sp.name = toks[i]; - if (find(species.begin(), species.end(), sp) - < species.end()) { - if (m_log) - *m_log << "warning... duplicate species " - << sp.name << " (ignored)." << endl; - } else { - nsp++; - sp.index = nsp; - species.push_back(sp); - } - } - } - firsttok = 0; - } - } else { - if (species.size() == 0) { - return false; - } else { - return true; - } - } - } - return false; -} - - - -/** - * - * Read species data from THERMO section records. - * - * @param names List of species names (input). - * @param species Table of species objects holding data from records - * in THERMO section (output). - */ - -bool CKParser::readThermoSection(std::vector& names, - speciesTable& species, vector_fp& temp, - int& optionFlag, std::ostream& log) -{ - string s; - vector toks; - - double tmin = -1.0, tmid = -1.0, tmax = -1.0; - if (temp.size() == 3) { - tmin = temp[0]; - tmid = temp[1]; - tmax = temp[2]; - } - - int nsp = static_cast(names.size()); - - string comment; - - // read lines until THERMO section is found. But if EOF reached or - // start of REACTIONS section, then there is no THERMO section. - do { - getCKLine(s,comment); - if (match(s,"")) { - return false; - } - if (match(s,"REAC")) { - putCKLine(s,comment); - return false; - } - } while (!match(s,"THER")); - - // read the tokens on the THERMO line - getTokens(s, static_cast(s.size()), toks); - m_nasafmt = false; - if (toks.size() >= 2) { - unsigned int itt; - for (itt = 1; itt < toks.size(); itt++) { - if (match(toks[itt],"ALL")) { - optionFlag = NoThermoDatabase; - } else if (match(toks[itt],"NO_TMID")) { - m_nasafmt = true; - log << "\nOption 'NO_TMID' specified. Default " - "midpoint temperature\n"; - log << "will be used for all species.\n\n"; - } else if (match(toks[itt], "NASA9")) { - m_nasa9fmt = true; - log << "Option NASA9 specified: Use new " - "nasa input file format\n\n"; - } else if (match(toks[itt], "NASA")) { - m_nasa9fmt = false; - log << "Option NASA specified: Use old " - "nasa input file format\n\n"; - } else throw CK_SyntaxError(log, - "unrecognized THERMO option.", m_line); - } - } - - // if "THERMO ALL" specified, or if optionFlag is set to HasTempRange, - // then the next line must contain the default temperatures - // for the database. - - if (optionFlag == NoThermoDatabase || optionFlag == HasTempRange) { - getCKLine(s, comment); - getTokens(s, static_cast(s.size()), toks); - if (m_nasa9fmt) { - // - // For NASA9 polynomials, the format is - // t1 t2 t3 t4 date - // when there are 3 temperature regions - // - size_t nreg = toks.size() - 2; - if (nreg >= 1) { - temp.resize(nreg+1); - for (size_t i = 0; i <= nreg; i++) { - temp[i] = de_atof(toks[i]); - } - string defaultDate = toks[nreg+1]; - } else { - throw CK_SyntaxError(log, "Default temp region card is bad", m_line); - } - if (verbose) { - log.flags(ios::showpoint | ios::fixed); - log.precision(2); - log << endl << " Default # of temperature regions: " - << nreg << endl; - log << " "; - for (size_t i = 0; i <= nreg; i++) { - log << temp[i] << " "; - } - log << endl; - } - checkNASA9Temps(log, temp); - } else { - // - // For NASA polynomials, the format is - // tlow tmid thigh - // There are always 2 temperature regions - // - if (toks.size() >= 3) { - tmin = de_atof(toks[0]); - tmid = de_atof(toks[1]); - tmax = de_atof(toks[2]); - } - - if (verbose) { - log.flags(ios::showpoint | ios::fixed); - log.precision(2); - log << endl << " default Tlow, Tmid, Thigh: " << tmin << " " - << tmid << " " << tmax << endl; - } - checkTemps(log, tmin, tmid, tmax); - temp.clear(); - temp.push_back(tmin); - temp.push_back(tmid); - temp.push_back(tmax); - } - } - - /// XXXX BRANCH TO THE DIFFERENT THERMO READERS HERE - - // Check to see that we expect to be reading a NASA formatted file - if (m_nasa9fmt) { - bool ok = readNASA9ThermoSection(names, species, temp, - optionFlag, log); - if (!ok) { - throw CK_SyntaxError(log, - "In NASA parser. However, we expect a NASA9 file format", - -1); - } - return ok; - } - - // now read in all species records that have names in list 'names' - - bool getAllSpecies = (nsp > 0 && match(names[0],"")); - if (getAllSpecies) { - names.clear(); - } - - map dup; // used to check for duplicate THERMO records - bool already_read; - - while (1 > 0) { - if (nsp == 0) { - break; - } - already_read = false; - - Species spec; - readThermoRecord(spec); - - if (spec.name == "") { - break; - } - - // check for duplicate thermo data - if (dup[spec.name] == 2) { - log << "Warning: more than one THERMO record for " - << "species " << spec.name << endl; - log << "Record at line " << m_line - << " of " << m_ckfilename << " ignored." << endl; - already_read = true; - } - dup[spec.name] = 2; - - if (!already_read && (getAllSpecies - || (find(names.begin(), names.end(), spec.name) - < names.end()))) { - - if (spec.tmid == 0.0) { - spec.tmid = tmid; - log << "Warning: default Tmid used for species " - << spec.name << endl; - if (spec.tmid < 0.0) { - log << "Error: no default Tmid has been entered!" - << endl; - } - } - species[spec.name] = spec; - - if (verbose) { - log << endl << "found species " << spec.name; - log << " at line " << m_line - << " of " << m_ckfilename; - writeSpeciesData(log, spec); - } - checkTemps(log, spec.tlow, spec.tmid, spec.thigh); - if (getAllSpecies) { - names.push_back(spec.name); - nsp = static_cast(names.size()); - } else { - nsp--; - } - } - } - return true; -} - - -/** - * - * Read one 4-line species definition record in NASA format. - * - */ - -void CKParser::readThermoRecord(Species& sp) -{ - string s; - string numstr; - double cf; - - // look for line 1, but if a keyword is found first or the end of - // the file is reached, return "" as the species name - string comment; - do { - getCKLine(s, comment); - if (isKeyword(s) || match(s, "")) { - sp.name = ""; - putCKLine(s, comment); - return; - } - } while ((s.size() < 80) || (s[79] != '1')); - - // next 4 lines must be the NASA-format lines without intervening - // comments. - - //------------- line 1 --------------------------- - - if (s[79] != '1') { - illegalThermoLine(*m_log, s[79], m_line); - } - - // extract the species name and the id string (date) - string nameid = s.substr(0,24); - vector toks; - getTokens(nameid, static_cast(nameid.size()), toks); - sp.name = toks[0]; - sp.id = ""; - unsigned int j; - for (j = 1; j < toks.size(); j++) { - if (j > 1) { - sp.id += ' '; - } - sp.id += toks[j]; - } - int iloc; - string elementSym; - double atoms; - int i; - - // elemental composition (first 4 elements) - for (i = 0; i < 4; i++) { - elementSym = ""; - iloc = 24 + 5*i; - if (s[iloc] != ' ') { - if (s[iloc+1] != ' ') { - elementSym = s.substr(iloc,2); - } else { - elementSym = s.substr(iloc,1); - } - } else if (s[iloc+1] != ' ') { - elementSym = s.substr(iloc+1,1); - } - atoms = de_atof(s.substr(iloc+2,3)); - addElement(elementSym, atoms, sp, *m_log); - } - - // single-character phase descriptor - sp.phase = s[44]; - - // low, high, and mid temperatures - sp.tlow = de_atof(s.substr(45,10)); - sp.thigh = de_atof(s.substr(55,10)); - - if (!m_nasafmt) { - sp.tmid = de_atof(s.substr(65,8)); - - // fifth element, if any - elementSym = ""; - if (s[73] != ' ') { - elementSym += s[73]; - } - if (s[74] != ' ') { - elementSym += s[74]; - } - atoms = de_atof(s.substr(75,3)); - addElement(elementSym, atoms, sp, *m_log); - - // additional elements, if any - elementSym = ""; - int loc = 80; - while (loc < (int)(s.size()-9)) { - elementSym = ""; - if (s[loc] != ' ') { - elementSym += s[loc]; - } - if (s[loc+1] != ' ') { - elementSym += s[loc+1]; - } - atoms = de_atof(s.substr(loc+2,8)); - addElement(elementSym, atoms, sp, *m_log); - loc += 10; - } - } - - //-------------- line 2 ---------------------------- - - getCKLine(s, comment); - if (s[79] != '2') { - illegalThermoLine(*m_log, s[79], m_line); - } - for (i = 0; i < 5; i++) { - numstr = s.substr(i*15, 15); - cf = getNumberFromString(numstr); - if (cf == UNDEF) { - illegalNumber(*m_log, numstr, m_line); - } - sp.highCoeffs.push_back(cf); - } - - //-------------- line 3 ---------------------------- - - getCKLine(s, comment); - if (s[79] != '3') { - illegalThermoLine(*m_log, s[79], m_line); - } - for (i = 0; i < 2; i++) { - numstr = s.substr(i*15, 15); - cf = getNumberFromString(numstr); - if (cf == UNDEF) { - illegalNumber(*m_log, numstr, m_line); - } - sp.highCoeffs.push_back(cf); - } - for (i = 2; i < 5; i++) { - numstr = s.substr(i*15, 15); - cf = getNumberFromString(numstr); - if (cf == UNDEF) { - illegalNumber(*m_log, numstr, m_line); - } - sp.lowCoeffs.push_back(cf); - } - - //--------------- line 4 ---------------------------- - - getCKLine(s, comment); - if (s[79] != '4') { - illegalThermoLine(*m_log, s[79], m_line); - } - for (i = 0; i < 4; i++) { - numstr = s.substr(i*15, 15); - cf = getNumberFromString(numstr); - if (cf == UNDEF) { - illegalNumber(*m_log, numstr, m_line); - } - sp.lowCoeffs.push_back(cf); - } - sp.valid = 1; -} - - - -void CKParser::missingAuxData(const std::string& kw) -{ - throw CK_SyntaxError(*m_log, kw + - " keyword must be followed by slash-delimited data.", m_line); -} - - -/** - * Parse the REACTION section of the input file, and return - * a list of Reaction objects and the units. - */ -bool CKParser::readReactionSection(const std::vector& speciesNames, - vector& elementNames, reactionList& reactions, - ReactionUnits& units) -{ - string s, comment; - vector toks; - int nRxns = 0; - - vector rc, pr; - vector_int c; - - // advance to the beginning of the REACTION section - do { - getCKLine(s, comment); - if (match(s, "")) { - return false; - } - } while (!match(s,"REAC")); - - - // look for units specifications - - getTokens(s, static_cast(s.size()), toks); - string tok; - units.ActEnergy = Cal_per_Mole; - units.Quantity = Moles; - unsigned int ir; - for (ir = 1; ir < toks.size(); ir++) { - tok = toks[ir]; - if (match(tok,"CAL/MOLE")) { - units.ActEnergy = Cal_per_Mole; - } else if (match(tok,"KCAL/MOLE")) { - units.ActEnergy = Kcal_per_Mole; - } else if (match(tok,"JOULES/MOLE")) { - units.ActEnergy = Joules_per_Mole; - } else if (match(tok,"KJOULES/MOLE")) { - units.ActEnergy = Kjoules_per_Mole; - } else if (match(tok,"KELVINS")) { - units.ActEnergy = Kelvin; - } else if (match(tok,"EVOLTS")) { - units.ActEnergy = Electron_Volts; - } else if (match(tok,"MOLES")) { - units.Quantity = Moles; - } else if (match(tok,"MOLECULES")) { - units.Quantity = Molecules; - } - } - - Reaction rxn; - - vector cm; - bool ok = true; - - if (debug) { - *m_log << "CKParser::readReactions ---> DEBUG MODE" << endl; - } - - while (1 > 0) { - - // skip blank or comment lines - do { - getCKLine(s, comment); - cm.push_back(comment); - } while (s == "" && comment[0] != '%'); - -#undef DEBUG_LINE -#ifdef DEBUG_LINE - *m_log << "Line: " << s << endl; -#endif - // end of REACTION section or EOF - /// @todo does this handle case of 1 reaction correctly? - if (isKeyword(s) || s == "") { - if (nRxns > 0) { - rxn.number = nRxns; - reactions.push_back(rxn); - //rxn.comment.clear(); - } - if (nRxns > 0) { - return ok; - } - return false; - } - - // rxn line - //string::size_type eqloc; - string sleft, sright; - bool auxDataLine, metaDataLine; - - - // if the line contains an '=', it is the start of a new reaction. - // In this case, add the previous reaction to the output list, - // increment the number of reactions, and start processing the - // new reaction. - - size_t eqloc = s.find_first_of("="); - metaDataLine = false; - auxDataLine = false; - - // look for a metadata line - if (s[0] == '%') { - metaDataLine = true; - if (eqloc > 0 && eqloc < s.size()) { - int ierr, ierp; - vector rg, pg; - s[eqloc] = ' '; - ierr = getGroups(s.begin(), s.begin() + eqloc, - elementNames, rg); - ierp = getGroups(s.begin() + eqloc, s.end(), - elementNames, pg); - unsigned int nr = - static_cast(rxn.reactants.size()); - unsigned int nratoms = 0; - for (unsigned int ij = 0; ij < nr; ij++) { - nratoms += int(rxn.reactants[ij].number); - } - if (rg.size() != nratoms) - throw CK_SyntaxError(*m_log, - " groups not specified for all reactants", m_line); - else if (ierr < 0) - throw CK_SyntaxError(*m_log, - " error in reactant group specification", m_line); - for (unsigned int ir = 0; ir < nr; ir++) { - rxn.reactants[ir].groups = rg[ir]; - } - unsigned int np = - static_cast(rxn.products.size()); - unsigned int npatoms = 0; - for (unsigned int ik = 0; ik < np; ik++) { - npatoms += int(rxn.products[ik].number); - } - if (pg.size() != npatoms) - throw CK_SyntaxError(*m_log, - " groups not specified for all products", m_line); - else if (ierp < 0) - throw CK_SyntaxError(*m_log, - " error in product group specification", m_line); - for (unsigned int ip = 0; ip < np; ip++) { - rxn.products[ip].groups = pg[ip]; - } - } - } - - else if (eqloc != string::npos && eqloc < s.size()) { - if (nRxns > 0) { - rxn.number = nRxns; - reactions.push_back(rxn); - } - nRxns++; - rxn = Reaction(); - rxn.comment = cm; - cm.clear(); - if (debug) { - *m_log << "Parsing reaction " << nRxns << endl; - } - } else { - auxDataLine = true; - } - if (comment != "") { - rxn.lines.push_back(s+'!'+comment); - } else { - rxn.lines.push_back(s); - } - - if (!auxDataLine && !metaDataLine) { - - // depending on the form of the 'equals' symbol, - // determine whether the reaction is reversible or - // irreversible, and separate it into strings for - // each side. - - if (eqloc = s.find("<=>"), eqloc != string::npos) { - rxn.isReversible = true; - sleft = s.substr(0, eqloc); - sright = s.substr(eqloc+3,1000); - } else if (eqloc = s.find("=>"), eqloc != string::npos) { - rxn.isReversible = false; - sleft = s.substr(0, eqloc); - sright = s.substr(eqloc+2,1000); - } else if (eqloc = s.find("="), eqloc != string::npos) { - rxn.isReversible = true; - sleft = s.substr(0, eqloc); - sright = s.substr(eqloc+1,1000); - } else throw CK_SyntaxError(*m_log, - "expected <=>, =>, or =", m_line); - - if (debug) { - *m_log << s << endl; - if (rxn.isReversible) { - *m_log << "Reaction is reversible." << endl; - } else { - *m_log << "Reaction is irreversible." << endl; - } - } - - string::size_type mloc, mloc2; - - // process reactants - if (debug) { - *m_log << "Processing reactants..." << sleft << endl; - } - removeWhiteSpace(sleft); - if (debug) *m_log << "After removing white space: " - << sleft << endl; - rxn.isFalloffRxn = false; - - string sm, mspecies; - - mloc = sleft.find("(+"); - if (mloc != string::npos) { - sm = sleft.substr(mloc+2, 1000); - mloc2 = sm.find(")"); - if (mloc2 != string::npos) { - mspecies = sm.substr(0,mloc2); - rxn.isFalloffRxn = true; - rxn.type = Falloff; - sleft = sleft.substr(0, mloc); - if (mspecies == "M" || mspecies == "m") { - rxn.thirdBody = "M"; - } else { - rxn.thirdBody = mspecies; - } - if (debug) { - *m_log << "Falloff reaction. Third body = " - << rxn.thirdBody << endl; - } - } else throw CK_SyntaxError(*m_log, - "missing )", m_line); - } - - else if ((mloc = sleft.find("+M"), mloc != string::npos) || - (mloc = sleft.find("+m"), mloc != string::npos)) { - - if (static_cast(mloc) == - static_cast(sleft.size()) - 2) { - rxn.isThreeBodyRxn = true; - rxn.type = ThreeBody; - sleft = sleft.substr(0, mloc); - rxn.thirdBody = "M"; - if (debug) { - *m_log << "Three-body reaction." << endl; - } - } else if (debug) { - *m_log << "Reactant string contains +M or +m, but \n" - << "not last two characters of string: " - << "\"" << sleft << "\"\n" - << "NOT a three-body reaction." << endl; - } - } - - getSpecies(sleft.c_str(),static_cast(sleft.size()), - rxn.reactants, debug, *m_log); - int ir = static_cast(rxn.reactants.size()); - for (int iir = 0; iir < ir; iir++) { - if (find(speciesNames.begin(), speciesNames.end(), - rxn.reactants[iir].name) >= speciesNames.end()) - throw CK_SyntaxError(*m_log, - "undeclared reactant species " - +rxn.reactants[iir].name, m_line); - } - - - // process Arrhenius coefficients - getTokens(sright, static_cast(sright.size()), toks); - int ntoks = static_cast(toks.size()); - if (ntoks < 3) { - throw CK_SyntaxError(*m_log, - "expected 3 Arrhenius parameters", m_line); - } - rxn.kf.A = de_atof(toks[ntoks - 3]); - rxn.kf.n = de_atof(toks[ntoks - 2]); - rxn.kf.E = de_atof(toks[ntoks - 1]); - - // 2/10/03: allow negative prefactor but print a warning - if (rxn.kf.A < 0.0) - *m_log << "Warning: negative prefactor at line " - << m_line << endl; - //throw CK_SyntaxError(*m_log, "negative prefactor", m_line); - - if (debug) { - *m_log << "Processing products..." << sright << endl; - } - sright = sright.substr(0, sright.find(toks[ntoks - 3]) - 1); - if (debug) *m_log << "After removing Arrhenius parameters, " - << "\nproduct string = " << sright << endl; - - removeWhiteSpace(sright); - if (debug) *m_log << "After removing white space: " - << sright << endl; - mloc = sright.find("(+"); - if (mloc != string::npos) { - sm = sright.substr(mloc+2, 1000); - mloc2 = sm.find(")"); - if (mloc2 != string::npos) { - mspecies = sm.substr(0,mloc2); - - if (rxn.type == ThreeBody) - throw CK_SyntaxError(*m_log, - "mismatched +M or (+M)", m_line); - - rxn.isFalloffRxn = true; - rxn.type = Falloff; - if (debug) { - *m_log << "Falloff reaction. Third body = " - << rxn.thirdBody << endl; - } - } else throw CK_SyntaxError(*m_log, - "missing )", m_line); - - sright = sright.substr(0, mloc); - - if (mspecies == "M" || mspecies == "m") { - rxn.thirdBody = "M"; - } else { - if (rxn.thirdBody != mspecies) - throw CK_SyntaxError(*m_log, - "mismatched third body", m_line); - rxn.thirdBody = mspecies; - } - } - - else if ((mloc = sright.find("+M"), mloc != string::npos) || - (mloc = sright.find("+m"), mloc != string::npos)) { - - if (static_cast(mloc) == - static_cast(sright.size()) - 2) { - - if (rxn.type == Falloff) - throw CK_SyntaxError(*m_log, - "mismatched +M or (+M)", m_line); - rxn.isThreeBodyRxn = true; - rxn.thirdBody = "M"; - sright = sright.substr(0, mloc); - if (debug) { - *m_log << "Three-body reaction." << endl; - } - } else if (debug) { - *m_log << "Product string contains +M or +m, but \n" - << "not last two characters of string: " - << "\"" << sright << "\"\n" - << "NOT a three-body reaction." << endl; - } - } - getSpecies(sright.c_str(),static_cast(sright.size()), - rxn.products, debug, *m_log); - int ip = static_cast(rxn.products.size()); - for (int iip = 0; iip < ip; iip++) { - if (find(speciesNames.begin(), speciesNames.end(), - rxn.products[iip].name) >= speciesNames.end()) - throw CK_SyntaxError(*m_log, - "undeclared product species "+rxn.products[iip].name, m_line); - } - } - - // auxiliary data line - else if (auxDataLine) { - - bool hasAuxData; - string name, data; - map kwindex; - while (1 > 0) { - - hasAuxData = extractSlashData(s, name, data); - if (!hasAuxData && name == "") { - break; - } - - // check for duplicate keyword - if (kwindex[name]) { - throw CK_SyntaxError(*m_log, - "duplicate auxiliary data keyword " - + name, m_line); - } else { - kwindex[name] = 1; - } - - - // low-pressure rate coefficient for falloff rxn - - if (match(name,"LOW")) { - vector klow; - rxn.type = Falloff; - if (hasAuxData) { - getTokens(data, static_cast(data.size()), klow); - if (klow.size() != 3) { - throw CK_SyntaxError(*m_log, - "expected 3 low-pressure Arrhenius parameters", m_line); - } - rxn.kf_aux.A = de_atof(klow[0]); - rxn.kf_aux.n = de_atof(klow[1]); - rxn.kf_aux.E = de_atof(klow[2]); - } else { - missingAuxData("LOW"); - } - } - - - // falloff parameters - - else if (match(name,"TROE")) { - vector falloff; - if (kwindex["SRI"] > 0) { - throw CK_SyntaxError(*m_log, - "cannot specify both SRI and TROE", m_line); - } - - if (hasAuxData) { - getTokens(data, static_cast(data.size()), falloff); - int nf = static_cast(falloff.size()); - double ff; - rxn.falloffType = Troe; - for (int jf = 0; jf < nf; jf++) { - ff = de_atof(falloff[jf]); - rxn.falloffParameters.push_back(ff); - } - } else { - missingAuxData("TROE"); - } - } - - else if (match(name,"SRI")) { - vector falloff; - if (kwindex["TROE"] > 0) { - throw CK_SyntaxError(*m_log, - "cannot specify both SRI and TROE", m_line); - } - if (hasAuxData) { - getTokens(data, static_cast(data.size()), falloff); - int nf = static_cast(falloff.size()); - rxn.falloffType = SRI; - double ff; - for (int jf = 0; jf < nf; jf++) { - ff = de_atof(falloff[jf]); - rxn.falloffParameters.push_back(ff); - } - } else { - missingAuxData("SRI"); - } - } - - - - // reverse rate coefficient - - else if (match(name,"REV")) { - vector krev; - if (!rxn.isReversible) { - throw CK_SyntaxError(*m_log, - "reverse rate parameters can only be " - "specified for reversible reactions", m_line); - } - if (hasAuxData) { - getTokens(data, static_cast(data.size()), krev); - if (krev.size() != 3) { - throw CK_SyntaxError(*m_log, - "expected 3 Arrhenius parameters", m_line); - } - rxn.krev.A = de_atof(krev[0]); - rxn.krev.n = de_atof(krev[1]); - rxn.krev.E = de_atof(krev[2]); - } else { - missingAuxData("REV"); - } - } - - - else if (match(name,"DUP")) { - rxn.isDuplicate = true; - } - - else if (match(name,"END")) { - string c = ""; - putCKLine(name,c); - break; - } - - - // Landau-Teller reaction rate parameters - - else if (match(name,"LT")) { - vector bc; - rxn.kf.type = LandauTeller; - if (hasAuxData) { - getTokens(data, static_cast(data.size()), bc); - rxn.kf.B = de_atof(bc[0]); - rxn.kf.C = de_atof(bc[1]); - } else { - missingAuxData("LT"); - } - } - - else if (match(name,"RLT")) { - vector bc; - rxn.krev.type = LandauTeller; - if (hasAuxData) { - getTokens(data, static_cast(data.size()), bc); - rxn.krev.B = de_atof(bc[0]); - rxn.krev.C = de_atof(bc[1]); - } else { - missingAuxData("RLT"); - } - } - - - // chem activation reactions - else if (match(name,"HIGH")) { - vector khigh; - rxn.type = ChemAct; - if (hasAuxData) { - getTokens(data, static_cast(data.size()), khigh); - rxn.kf_aux.A = de_atof(khigh[0]); - rxn.kf_aux.n = de_atof(khigh[1]); - rxn.kf_aux.E = de_atof(khigh[2]); - } else { - missingAuxData("HIGH"); - } - } - - else if (match(name,"FORD")) { - vector nmord; - if (hasAuxData) { - getTokens(data, static_cast(data.size()), - nmord); - rxn.fwdOrder[nmord[0]] = de_atof(nmord[1]); - } else { - missingAuxData("FORD"); - } - } - - else if (find(speciesNames.begin(), speciesNames.end(), name) - < speciesNames.end()) { - if (hasAuxData) { - if (rxn.thirdBody == name || rxn.thirdBody == "M") { - rxn.e3b[name] = de_atof(data); - } else if (rxn.thirdBody == "") { - *m_log << "Error in reaction " << nRxns - << ": third-body collision efficiencies cannot be specified" - << " for this reaction type." << endl; - throw CK_SyntaxError(*m_log, - "third-body efficiency error", m_line); - } else { - *m_log << "Reaction " << nRxns << ": illegal species in enhanced " - << "efficiency specification. Species = " - << name << " rxn.thirdBody = " - << rxn.thirdBody << endl; - throw CK_SyntaxError(*m_log, - "third-body efficiency error", m_line); - } - } else { - missingAuxData(name); - } - } else { - Reaction::auxdata vals; - vector toks; - getTokens(data, static_cast(data.size()), toks); - int ntoks = static_cast(toks.size()); - for (int itok = 0; itok < ntoks; itok++) { - vals.push_back(de_atof(toks[itok])); - } - rxn.otherAuxData[name] = vals; - } - } - } - } - return false; -} - - - -int parseGroupString(std::string str, std::vector& esyms, group_t& result) -{ - bool inSymbol=true; - string s = str + '-'; - int i; - string num, sym; - int eindx; - string::const_iterator begin = s.begin(); - string::const_iterator end = s.end(); - vector::iterator e; - result.resize(static_cast(esyms.size()),0); - for (; begin != end; ++begin) { - - // new element - if (*begin == '-') { - e = find(esyms.begin(), esyms.end(), sym); - if (e == esyms.end()) { - return -1; - } - eindx = static_cast(e - esyms.begin()); - if (num != "") { - i = atoi(num.c_str()); - } else { - i = 1; - } - result[eindx] = i; - sym = ""; - num = ""; - inSymbol = true; - } else if (isdigit(*begin)) { - inSymbol = false; - num += *begin; - } else if (isalpha(*begin) && inSymbol) { - sym += *begin; - } - } - return 1; -} - -} // ckr namespace - - - - - diff --git a/src/converters/CKParser.h b/src/converters/CKParser.h deleted file mode 100644 index ed9fa5abf..000000000 --- a/src/converters/CKParser.h +++ /dev/null @@ -1,131 +0,0 @@ -/** - * @file CKParser.h - * - */ - -// Copyright 2001 California Institute of Technology - -#ifndef CKR_CKPARSER_H -#define CKR_CKPARSER_H - -#include -#include -#include - -#include "ckr_defs.h" -#include "Element.h" -#include "Species.h" -#include "Reaction.h" - -namespace ckr -{ - - -// typedefs - -/// readability constants -//@{ -const int NoThermoDatabase = 10; -const int HasTempRange = 11; -//@} - - -/// Exception class for syntax errors. -class CK_SyntaxError : public CK_Exception -{ -public: - CK_SyntaxError(std::ostream& f, const std::string& s, int linenum = -1); - std::ostream& m_out; -}; - -/** - * Chemkin mechanism file parser. For internal use by class CKReader. - */ -class CKParser -{ - -public: - - CKParser(std::string ckfile, std::ostream* log); - CKParser(std::istream* infile, const std::string& fname, - std::ostream* log); - - /// Destructor. - ~CKParser() {} - - bool readElementSection(elementList& elements); - bool readSpeciesSection(speciesList& species); - bool readThermoSection(std::vector& names, - speciesTable& speciesData, vector_fp& temp, - int& optionFlag, std::ostream& log); - bool readReactionSection(const std::vector& speciesNames, - std::vector& elementNames, - reactionList& reactions, ReactionUnits& units); - bool advanceToKeyword(const std::string& kw, const std::string& stop); - bool verbose; - bool debug; - - bool readNASA9ThermoSection(std::vector& names, - speciesTable& species, vector_fp& temp, - int& optionFlag, std::ostream& log); - - void readNASA9ThermoRecord(Species& sp); - -private: - - //! Local value of the line number being read - /*! - * This is used for debug IO printout purposes - */ - int m_line; - - std::string m_buf; - std::string m_comment; - - //! This is the input file that is read - /*! - * It's an istream - */ - std::istream* m_ckfile; - - std::string m_ckfilename; - - //! Pointer to the ostream for writing debugging output log info - std::ostream* m_log; - - bool m_nasafmt; - - //! Boolean indicating new NASA input file format - /*! - * If this is true, a completely different input file parser is - * used. - */ - bool m_nasa9fmt; - - char m_last_eol; - void readThermoRecord(Species& sp); - - //! Get a line from the input file, and return it in string s. - /*! - * If the line contains a comment character (!), then return only the - * portion preceding it. Non-printing characters are replaced by - * spaces. - * - * The input file is m_ckfile, an istream. - * - * @param s On return, s contains the line read from the - * input file. - * @param comment On return, comment contains the text following the - * comment character on the line, if any. - */ - void getCKLine(std::string& s, std::string& comment); - - void putCKLine(std::string& s, std::string& comment); - void missingAuxData(const std::string& kw); - - void checkSpeciesName(std::string spname); -}; -} - - -#endif diff --git a/src/converters/CKReader.cpp b/src/converters/CKReader.cpp deleted file mode 100644 index 0982a4d3d..000000000 --- a/src/converters/CKReader.cpp +++ /dev/null @@ -1,738 +0,0 @@ -/** - * @file CKReader.cpp - * - */ - -// Copyright 2001 California Institute of Technology - -#include -#include -using namespace std; - -#include "CKParser.h" -#include "CKReader.h" -#include "thermoFunctions.h" - -#include -#include -#include -#include - -#include "writelog.h" -#include -#include "ckr_defs.h" - -//#include "cantera/base/global.h" -//#define APP Cantera::Application - -namespace ckr -{ - -/** - * read and optionally validate an input file in Chemkin format. - * @param inputFile path to the input file - * @param thermoDatabase path to the species database file - * @param logfile path to the file where log messages should be written - * @return true if no errors were encountered, false otherwise - */ -bool CKReader::read(const std::string& inputFile, const std::string& thermoDatabase, - const std::string& logfile) -{ - - clock_t t0, t1; - - t0 = clock(); - - ifstream ckinfile(inputFile.c_str()); - ofstream log(logfile.c_str()); - try { - // construct a parser for the input file - CKParser parser(&ckinfile, inputFile, &log); - parser.verbose = verbose; - parser.debug = debug; - - // write header information to the log file - struct tm* newtime; - time_t aclock; - time(&aclock); /* Get time in seconds */ - newtime = localtime(&aclock); /* Convert time to struct tm form */ - - - log << "CKReader version 1.0" << endl - << "http://www.cantera.org" << endl << endl - << asctime(newtime) << endl - << setw(20) << "input file: " - << setw(30) << inputFile << endl; - - if (thermoDatabase != "") - log << setw(20) << "species database: " - << setw(30) << thermoDatabase << endl; - - if (!validate) - log << endl << "*************** Warning ***************" << endl - << " mechanism validation disabled" << endl - << "*****************************************" << endl; - - if (debug) { - log << "*** DEBUG MODE ***" << endl; - } else { - log << "debugging disabled." << endl; - } - - //----------- process ELEMENT section ---------------------- - - bool elok = parser.readElementSection(elements); - int nel = static_cast(elements.size()); - vector elementSymbols; - for (int j = 0; j < nel; j++) { - elementSymbols.push_back(elements[j].name); - } - - if (verbose) { - log.flags(ios::showpoint); - log.precision(6); - log.width(0); - - log << endl << newTask("reading elements") << endl; - - // write summary to log file - for (int i = 0; i < nel; i++) { - log << i+1 << ". " << pad(elements[i].name,2) << " "; - double wt = elements[i].atomicWeight; - if (wt == 0.0) { - log << ""; - } else { - log << wt; - } - if (!elements[i].weightFromDB) { - log << " (specified)"; - } - if (elements[i].comment != "") { - log << " ! " << elements[i].comment; - } - log << endl; - } - } - log << "\nread " << nel << " elements." << endl; - - if (!elok) { - log << "\nerrors were encountered." << endl; - return false; - } - if (nel == 0) { - return false; - } - - - //------------ process SPECIES section ------------------------ - - vector speciesSymbols; - bool spok = parser.readSpeciesSection(species); - int nsp = static_cast(species.size()); - - if (verbose) { - log << newTask("reading species") << endl; - } - - for (int i = 0; i < nsp; i++) { - Species& s = species[i]; - if (verbose) { - log << i+1 << ". " << s.name << endl; - } - speciesSymbols.push_back(s.name); - } - log << "\nread " << nsp << " species." << endl; - - if (!spok) { - log << "\nerrors were encountered." << endl; - return false; - } - if (nsp == 0) { - return false; - } - - - //------------- process THERMO section ------------------------- - - if (verbose) { - log << newTask("looking up species definitions") << endl; - } - - // if a thermo database is specified, get the default Tmin, Tmid, Tmax - vector_fp temp; - - if (thermoDatabase != "") { - - if (verbose) log << "reading default temperature ranges from " - << thermoDatabase << endl; - - ifstream thermofile(thermoDatabase.c_str()); - CKParser thermReader(&thermofile, thermoDatabase, &log); - thermReader.verbose = verbose; - thermReader.debug = debug; - int dbflag = HasTempRange; - vector dummy; - thermReader.readThermoSection(dummy, speciesData, temp, dbflag, log); - } - - - bool hasthermo = parser.advanceToKeyword("THERM","REAC"); - - int k, optionFlag = 0; - int undefined = static_cast(species.size()); - string nm; - vector undef; - bool allsp = (speciesSymbols[0] == ""); - if (hasthermo && - parser.readThermoSection(speciesSymbols, - speciesData, temp, optionFlag, log)) { - if (allsp) { - nsp = static_cast(speciesData.size()); - for (k = 0; k < nsp; k++) { - Species s; - s.name = speciesSymbols[k]; - species.push_back(s); - } - } - undefined = 0; - for (k = 0; k < nsp; k++) { - nm = species[k].name; - species[k] = speciesData[species[k].name]; - if (species[k].name == "") { - undefined++; - undef.push_back(nm); - species[k].name = nm; - } - } - int localdefs = nsp - undefined; - if (localdefs > 0 && verbose) log << "found definitions for " - << localdefs - << " of " - << nsp - << " species in the input file. " - << endl; - } else { - undef = speciesSymbols; - if (verbose) { - log << "no THERMO section in input file." << endl; - } - } - - if (undefined > 0 && thermoDatabase != "" - && optionFlag != NoThermoDatabase) { - - if (verbose) log << "searching external database " - << thermoDatabase << " for species definitions..." - << endl; - - ifstream thermofile(thermoDatabase.c_str()); - CKParser thermoReader(&thermofile, thermoDatabase, &log); - thermoReader.verbose = verbose; - thermoReader.debug = debug; - int dbflag = HasTempRange; - thermoReader.readThermoSection(undef, speciesData, temp, dbflag, log); - undefined = 0; - if (allsp) { - species.clear(); - nsp = static_cast(speciesData.size()); - for (k = 0; k < nsp; k++) { - Species s; - s.name = undef[k]; - species.push_back(s); - } - } - for (int k = 0; k < nsp; k++) { - if (species[k].valid == 0) { - nm = species[k].name; - species[k] = speciesData[species[k].name]; - if (species[k].name == "") { - undefined++; - species[k].name = nm; - } - } - } - } - - if (validate && !validateSpecies(log)) { - //Cantera::setError("read","error in species"); - return false; - } - - - //------------- process REACTIONS section ------------------------- - - if (verbose) { - log << newTask("reading reactions") << endl; - } - - ckinfile.close(); - ifstream ckinfile2(inputFile.c_str()); - - // construct a new parser for the input file - CKParser parser2(&ckinfile2, inputFile, &log); - parser2.verbose = verbose; - parser2.debug = debug; - - parser2.readReactionSection(speciesSymbols, elementSymbols, reactions, units); - log << "\nread " << static_cast(reactions.size()) - << " reactions." << endl; - - bool rxnok = true; - if (validate) { - rxnok = rxnok && validateReactions(log); - } - bool writeok = true; - if (verbose || validate) { - writeok = writeReactions(log); - } - rxnok = rxnok && writeok; - if (!rxnok) { - return false; - } - - log << "\nSuccess... "; - t1 = clock(); - log << "elapsed CPU time = " - << double(t1 - t0)/CLOCKS_PER_SEC - << " s" << endl; - if (!validate) { - log << "*** no validation performed ***" << endl; - } - } - - catch (CK_Exception& e) { - log << e.errorMessage() << endl; - //Cantera::setError("CKReader::read",e.errorMessage()); - return false; - } catch (std::exception& e) { - log << "an exception was raised in CKReader:\n"; - log << e.what() << std::endl; - return false; - } - - return true; -} - - -/// print a summary of all reactions to the log file -bool CKReader::writeReactions(std::ostream& log) -{ - - bool ok = true; - // int ns = species.size(); - int nrxns = static_cast(reactions.size()); - log.flags(ios::unitbuf); - log.precision(6); - - log << endl; - for (int n = 0; n < nrxns; n++) { - Reaction& r = reactions[n]; - - log << "reaction " << r.number << endl; - log << " "; - printReactionEquation(log, r); - log << endl; - - // rate coefficient - if (r.isFalloffRxn) { - - log << " high P rate coeff: "; - ok = ok && writeRateCoeff(r.kf, log) ; - - log << " low P rate coeff: "; - ok = ok && writeRateCoeff(r.kf_aux, log); - - ok = ok && writeFalloff(r.falloffType, r.falloffParameters, log); - - } else { - log << " rate coeff: "; - ok = ok && writeRateCoeff(r.kf, log); - } - if (r.isReversible && r.krev.A > 0) { - log << " reverse rate coeff: "; - ok = ok && writeRateCoeff(r.krev, log); - } - int ne = static_cast(r.e3b.size()); - - if (ne > 0) { - vector enhSpecies; - getMapKeys(r.e3b, enhSpecies); - log << " enhanced collision efficiencies:" << endl; - log << " "; - for (int nn = 0; nn < ne; nn++) { - log << enhSpecies[nn] << " " - << r.e3b[enhSpecies[nn]]; - if (nn < ne-1) { - log << ", "; - } - } - log << endl; - } - if (r.isDuplicate) log - << " declared duplicate reaction. See reaction " - << r.duplicate << "." << endl; - log << endl; - } - return ok; -} - - - -/// validate the species -bool CKReader::validateSpecies(std::ostream& log) -{ - size_t nel = elements.size(); - size_t nsp = species.size(); - double tol; - - log << newTask("validating species"); - - // check for undeclared elements - vector esyms; - - log << " checking that all species have been defined... "; - for (size_t k = 0; k < nsp; k++) { - Species& s = species[k]; - if (s.valid == 0) { - log << endl << " species " << s.name << " undefined "; - s.valid = -1; - } - } - if (valid(species)) { - log << "OK" << endl; - } else { - log << endl; - return false; - } - - log << " checking that all species elements have been declared... "; - for (size_t k = 0; k < nsp; k++) { - Species& s = species[k]; - - getMapKeys(s.comp, esyms); - size_t nm = esyms.size(); - - for (size_t m = 0; m < nm; m++) { - size_t j; - for (j = 0; j < nel; j++) { - if (esyms[m] == elements[j].name) { - break; - } - } - if (j == nel) { - log << endl << " species " - << s.name << ": undeclared element " - << esyms[m]; - s.valid = -1; - } - } - } - if (valid(species)) { - log << "OK" << endl; - } else { - log << endl; - return false; - } - - log << " checking consistency of species thermo data... "; - tol = 0.01; - if (checkThermo(log, species, tol)) { - log << "OK" << endl; - } else { - log << endl; - return false; - } - return true; - -} - - -/// validate the reactions -bool CKReader::validateReactions(std::ostream& log) -{ - - bool ok = true; - // int ns = species.size(); - int nrxns = static_cast(reactions.size()); - - vector unbal; - log << "checking that all reactions balance..."; - if (checkBalance(log, speciesData, reactions, unbal)) { - log << " OK" << endl; - } else { - int nu = static_cast(unbal.size()); - for (int iu = 0; iu < nu; iu++) { - log << " error... reaction " << unbal[iu] - << " does not balance" << endl; - } - ok = false; - } - - log << "checking for duplicate reactions..."; - - for (int nn = 0; nn < nrxns; nn++) { - Reaction& r1 = reactions[nn]; - for (int mm = nn + 1; mm < nrxns; mm++) { - Reaction& r2 = reactions[mm]; - if (r1 == r2) { - r1.duplicate = mm + 1; - r2.duplicate = nn + 1; - if (!r1.isDuplicate || !r2.isDuplicate) { - log << endl << " error... undeclared duplicate reactions: " - << nn + 1 << " and " << mm + 1; - ok = false; - } else { - log << endl << " declared duplicate reactions: " - << nn + 1 - << " and " << mm + 1; - } - } - } - } - if (ok) { - log << "...OK" << endl; - } - - return ok; -} - - -/** - * Check the thermodynamic property parameterizations for all species. - * The following are verified: - * - The heat capacity is positive throughout the full temperature range; - * - The entropy at Tmin is positive; - * - The heat capacity, entropy, and enthalpy evaluated at Tmid using - * both the high and low polynomial coefficients are the same to within - * relative error tol - * - The heat capacity at Tmax is not greater than the equipartition limit - * for the number of atoms in the molecule - */ -bool checkThermo(std::ostream& log, speciesList& sp, double tol) -{ - const double dt = 0.0001; - double t, cp0, h0, s0, cp1, h1, s1; - int nsp = static_cast(sp.size()); - const int n_points = 20; - - int k; - bool ok = true; - for (k = 0; k < nsp; k++) { - Species& s = sp[k]; - - if (s.valid <= 0) { - ok = false; - log << endl << "species " << s.name - << " contains an error." << endl; - } - if (!ok) { - return false; - } - } - - log << endl << " Checking that cp/R is positive... "; - - for (k = 0; k < nsp; k++) { - Species& s = sp[k]; - - // check that cp is positive - - cp0 = 0.0; - for (int j = 0; j < n_points; j++) { - t = j*(s.thigh - s.tlow)/(n_points - 1) + s.tlow; - - cp0 = cp(t, s); - if (cp0 < 0.0) { - log << endl << " error... Cp/R < 0 at T = " << t - << " for species " << s.name << endl; - s.valid = -1; - ok = false; - } - } - } - if (ok) { - log << "ok" << endl; - } else { - return ok; - } - - - // check that S(tlow) > 0 - - log << " Checking that the species entropies are positive... "; - for (k = 0; k < nsp; k++) { - Species& s = sp[k]; - if (entropy(s.tlow, s) <= 0.0) { - log << endl << " error... negative entropy for species " - << s.name << endl; - s.valid = -1; - ok = false; - } - } - if (ok) { - log << "ok" << endl; - } else { - return ok; - } - - log << " Checking that properties are continuous at the midpoint temperature... "; - for (k = 0; k < nsp; k++) { - Species& s = sp[k]; - - // check continuity at Tmid - t = s.tmid - dt; - cp0 = cp(t, s); - h0 = enthalpy(t, s) + cp0*dt; - s0 = entropy(t, s) + dt*cp0/t; - - t = s.tmid + dt; - cp1 = cp(t, s); - h1 = enthalpy(t, s) - cp1*dt; - s1 = entropy(t, s) - cp1*dt/t; - - if (absval((cp0 - cp1)/cp0) > tol) { - log << endl << "Warning... species " << s.name - << ": discontinuity in Cp at Tmid = " - << s.tmid << endl; - log << "Cp/R (low, high) = " << cp0 - << ", " << cp1 << endl; - ok = false; - } - - if (absval((h0 - h1)/h0) > tol) { - log << endl << "Warning... species " << s.name - << ": discontinuity in enthalpy at Tmid = " - << s.tmid << endl; - log << "h/R (low, high) = " - << h0 << ", " << h1 << endl; - ok = false; - } - - if (absval((s0 - s1)/s0) > tol) { - log << endl << "Warning... species " << s.name - << ": discontinuity in entropy at Tmid = " - << s.tmid << endl; - log << "s/R (low, high) = " - << s0 << ", " << s1 << endl; - ok = false; - } - } - if (ok) { - log << "ok \n\n\n"; - } else { - log << "\n\n\n"; - } - - log << " Checking that cp is less that the high-temperature\n" - << " limiting value predicted by equipartition of energy.\n"; - log << " Note that this limit does not account for the electronic\n" - << " contribution to cp, and so may be violated in some cases." - << endl << endl; - - - for (k = 0; k < nsp; k++) { - Species& s = sp[k]; - - // check that cp at Tmax is less than the equipartion value - // This does not include any possible electronic contribution - - cp0 = cp(s.thigh, s); - int nel = static_cast(s.elements.size()); - int i; - double na = 0.0; - for (i = 0; i < nel; i++) - if (s.elements[i].name != "E") { - na += s.elements[i].number; - } - int natoms = int(floor(na)); - double cpmax; - switch (natoms) { - case 1: - cpmax = 2.5; - break; - case 2: - cpmax = 4.5; - break; - default: - cpmax = 3.0*natoms - 3.0; - } - - if (cp0 > cpmax) { - double over = 100.0*(cp0 - cpmax)/cpmax; - log << endl << "Warning... species " << s.name - << ": cp(Tmax) greater than equipartition value \nby " - << over << " percent."; - if ((natoms > 2) && (cp0 - cpmax < 0.5)) - log << endl << " (if molecule is linear, cp is ok)" - << endl; - } - } - - return valid(sp); -} - - - -/** - * Check that all reactions balance. - * @param speciesData species property dataset used to look up - * elemental compositions. - * @param r list of reactions to check - * @param unbalanced list of integers specifying reaction numbers of - * unbalanced reactions. - * @return true if all reactions balance - * @todo use reaction number stored in reaction object - */ -bool checkBalance(std::ostream& f, speciesTable& speciesData, - reactionList& r, std::vector& unbalanced, double tolerance) -{ - int nrxn = static_cast(r.size()); - string rname, pname; - vector elementSyms; - unsigned int m; - - unbalanced.clear(); - map atoms; - - for (int i = 0; i < nrxn; i++) { - atoms.clear(); - int nr = static_cast(r[i].reactants.size()); - int np = static_cast(r[i].products.size()); - int j; - double stoichCoeff; - for (j = 0; j < nr; j++) { - rname = r[i].reactants[j].name; - stoichCoeff = r[i].reactants[j].number; - vector& elements = speciesData[rname].elements; - for (m = 0; m < elements.size(); m++) { - atoms[elements[m].name] -= stoichCoeff * elements[m].number; - } - } - for (j = 0; j < np; j++) { - pname = r[i].products[j].name; - stoichCoeff = r[i].products[j].number; - vector& elements = speciesData[pname].elements; - for (m = 0; m < elements.size(); m++) { - atoms[elements[m].name] += stoichCoeff * elements[m].number; - } - } - double atms; - getMapKeys(atoms, elementSyms); - for (m = 0; m < elementSyms.size(); m++) { - atms = atoms[elementSyms[m]]; - if (fabs(atms) > tolerance) { - //if (atoms[elementSyms[m]] != 0.0) { - // cout << "Reaction " << i+1 << " has an unbalanced element: " - // << elementSyms[m] << " " - // << atoms[elementSyms[m]] << endl; - unbalanced.push_back(i+1); - break; - } - } - } - return (unbalanced.empty()); -} - -} - - diff --git a/src/converters/CKReader.h b/src/converters/CKReader.h deleted file mode 100644 index a9cca8e2f..000000000 --- a/src/converters/CKReader.h +++ /dev/null @@ -1,119 +0,0 @@ -/** - * @file CKReader.h - * - */ - -// Copyright 2001 California Institute of Technology - -#ifndef CKR_CKRREADER_H -#define CKR_CKRREADER_H - -#include -#include -#include -#include -#include - -#include "CKParser.h" - -#include -#include - -namespace ckr -{ - -class Group -{ -public: - - /// Construct a new empty Group object - Group() : name(""), index(-1) {} - - Group(const std::string& nm) : name(nm), index(-1) {} - - /// Destructor - ~Group() {} - - std::string name; //!< name - int index; //!< index number - std::map comp; //!< elemental composition - - bool operator==(const Group& g) const { - return (name == g.name); - } - bool operator!=(const Group& g) const { - return !(*this == g); - } -}; - -/// a list (vector) of Groups -typedef std::vector groupList; - - -/** - * Chemkin file reader class. Class CKReader parses and validates a file - * containing a description of a chemical reaction mechanism in Chemkin - * format. See the Examples section for examples of how CKReader is - * used in user programs. - */ - -class CKReader -{ -public: - - /** - * Constructor. Construct a new CKReader instance. By default, - * validation is enabled, as well as verbose output to the log file. - */ - CKReader() : verbose(true), validate(true), debug(false) {} - - /// Destructor. Does nothing. - ~CKReader() {} - - elementList elements; ///< a list of Element objects - speciesList species; ///< a list of Species objects - reactionList reactions; ///< a list of Reaction objects - groupList groups; ///< a list of Groups - speciesTable speciesData; ///< a map from species names to Species objects - ReactionUnits units; ///< reaction units - - /** - * Read and optionally validate a Chemkin input file. - * @param inputFile path to the input file. - * @param thermoDatabase path to the species thermodynamic property database. - * If no database is required, enter a null string. - * @param logFile file to write logging and error messages to. - * @return true if no errors encountered, false otherwise. - */ - bool read(const std::string& inputFile, - const std::string& thermoDatabase, const std::string& logFile); - - void write(string outputFile); ///< not implemented. - - bool verbose; ///< print detailed messages to log file - bool validate; ///< validate elements, species, and reaction - bool debug; ///< enable debugging output - -private: - - // void validateElements(ostream& log); - bool validateSpecies(ostream& log); ///< validate the species. - bool validateReactions(ostream& log); ///< validate the reactions. - bool writeReactions(ostream& log); -}; - - -bool checkBalance(ostream& f, speciesTable& speciesData, reactionList& r, - vector& unbalanced, double tolerance=1.0e-3); -bool checkThermo(ostream& f, speciesList& species, double tol); - -bool filter(const string& infile, const string& database, - const string& outfile, const vector& species, const vector& reactions); - -} - - -#endif - - - diff --git a/src/converters/Constituent.h b/src/converters/Constituent.h deleted file mode 100644 index 875d392d5..000000000 --- a/src/converters/Constituent.h +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @file Constituent.h - * - */ - -// Copyright 2001 California Institute of Technology - - -#ifndef CKR_CONSTITUENT_H -#define CKR_CONSTITUENT_H - -#include -#include - -namespace ckr -{ - -/** - * A class for components of a composite object. The only members are - * a string identifying the component, and a double specifying the - * amount. - */ -class Constituent -{ -public: - std::string name; //!< The name of the object. - double number; //!< The number of units (molecules, etc.). -}; - -} - -#endif diff --git a/src/converters/Element.h b/src/converters/Element.h deleted file mode 100644 index 9addf17eb..000000000 --- a/src/converters/Element.h +++ /dev/null @@ -1,98 +0,0 @@ -/** - * @file Element.h - * - */ - -// Copyright 2001 California Institute of Technology - - -#ifndef CKR_ELEMENT_H -#define CKR_ELEMENT_H - -#include -#include -#include - - -namespace ckr -{ - -/** - * A class for elements. - * Example usage: - * @code - * Element e; - * e.name = "He"; - * e.atomicWeight = 4.0026; - * e.comment = "helium"; - * @endcode - */ -class Element -{ -public: - - /// Construct a new empty Element object - Element() : - name(""), - atomicWeight(0.0), - valid(0), - index(-1), - weightFromDB(false), - comment("") - {} - - - /// Construct a new empty Element object - Element(const std::string& nm, double wt) : - name(nm), - atomicWeight(wt), - valid(0), - index(-1), - weightFromDB(false), - comment("") - {} - - - /// Destructor - ~Element() {} - - std::string name; //!< Element name - double atomicWeight; //!< Atomic weight in amu - int valid; //!< flag returned by validation routines - int index; //!< index number - bool weightFromDB; //!< true if atomic weight is not specified - std::string comment; //!< comment in input file - - - /** - * Compare two Element instances for equality based on name. - * Primarily for internal use. - */ - bool operator==(const Element& e) const { - return (name == e.name); - } - bool operator!=(const Element& e) const { - return !(*this == e); - } - friend std::ostream& operator<<(std::ostream& s, const Element& e) { - s << e.name; - if (!e.weightFromDB) { - s << "/" << e.atomicWeight << "/"; - } - if (e.comment != "") { - s << " !" << e.comment << std::endl; - } else { - s << " "; - } - return s; - } -}; - -/// a list (vector) of Elements -typedef std::vector elementList; - -} - - -#endif - diff --git a/src/converters/Makefile.am b/src/converters/Makefile.am deleted file mode 100644 index 03eb78106..000000000 --- a/src/converters/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ -h_sources = -cc_sources = atomicWeightDB.cpp CKReader.cpp \ - Reaction.cpp thermoFunctions.cpp ck2ct.cpp CKParser.cpp \ - ckr_utils.cpp NASA9Parser.cpp Species.cpp writelog.cpp - -AM_CPPFLAGS = -I$(top_builddir)/include -AM_CXXFLAGS = $(AM_CPPFLAGS) - -lib_LTLIBRARIES = $(top_builddir)/build/lib/libconverters.la -library_includedir = $(includedir) - -#----------------------- -# Cantera Converters C/C++ library -#----------------------- - -__top_builddir__build_lib_libconverters_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) -__top_builddir__build_lib_libconverters_la_SOURCES = $(cc_sources) $(h_sources) - -__top_builddir__build_lib_libconverters_include_HEADERS = $(h_sources) -__top_builddir__build_lib_libconverters_includedir = $(prefix)/include diff --git a/src/converters/NASA9Parser.cpp b/src/converters/NASA9Parser.cpp deleted file mode 100644 index d02641ad0..000000000 --- a/src/converters/NASA9Parser.cpp +++ /dev/null @@ -1,496 +0,0 @@ -/** - * @file CKParser.cpp - * - */ - -// Copyright 2001 California Institute of Technology - -#include -#include -#include -#include -#include - -#include "CKParser.h" -#include "ckr_utils.h" -#include "writelog.h" -#include -//#include "cantera/base/stringUtils.h" - -#include -#include -#include - -using namespace std; - -namespace ckr -{ - - - -/** - * Add an element to a species. - * @param symbol element symbol - * @param atoms number of atoms of this element in the - * species (may be non-integral) - * @param sp Species object to add element to - * @param log log file output stream - */ -static void addElement(std::string symbol, double atoms, - Species& sp, std::ostream& log) -{ - - if (atoms != 0.0) { - Constituent e; - e.name = symbol; - e.number = atoms; - sp.elements.push_back(e); - sp.comp[symbol] = atoms; - } -} - - -/** - * Throw an exception if number string is bad - */ -static void illegalNumber(std::ostream& f, - std::string s, int linenum = -1) -{ - string msg = "illegal number: "+s; - throw CK_SyntaxError(f, msg, linenum); -}; - - -void CKParser::checkSpeciesName(std::string spname) -{ - if (spname.size() <= 0) { - string sss = "Empty for string name"; - throw CK_SyntaxError(*m_log, sss, m_line); - } - char first = spname[0]; - if (isdigit(first)) { - string sss = "First char of string name is number"; - throw CK_SyntaxError(*m_log, sss, m_line); - } - if (isspace(first)) { - string sss = "First char of string name is white space"; - throw CK_SyntaxError(*m_log, sss, m_line); - } -} - -static std::string d2e(std::string s) -{ - size_t n; - size_t sz = s.size(); - string r = s; - char ch; - for (n = 0; n < sz; n++) { - ch = s[n]; - if (ch == 'D') { - r[n] = 'E'; - } else if (ch == 'd') { - r[n] = 'e'; - } - } - return r; -} - -static double de_atof(std::string s) -{ - string r = d2e(s); - //double rval = Cantera::atofCheck(r.c_str()); - double rval = atof(r.c_str()); - return rval; -} - -static double getNumberFromString(std::string s) -{ - bool inexp = false; - removeWhiteSpace(s); - int sz = static_cast(s.size()); - char ch; - for (int n = 0; n < sz; n++) { - ch = s[n]; - if (!inexp && (ch == 'E' || ch == 'e' || ch == 'D' || ch == 'd')) { - inexp = true; - } else if (ch == '+' || ch == '-') { - if (n > 0 && (s[n-1] != 'E' && s[n-1] - != 'e' && s[n-1] != 'd' && s[n-1] != 'D')) { - return UNDEF; - } - } else if (ch != '.' && (ch < '0' || ch > '9')) { - return UNDEF; - } - } - return de_atof(s); -} - -static int de_atoi(std::ostream& log, std::string s, int line = -1) -{ - double val = getNumberFromString(s); - int ival = (int) val; - double val2 = (double) ival; - if (fabs(val - val2) >= 0.00001 * (val + val2)) { - string sss = "de_atoi: Conversion of int failed: " + s; - throw CK_SyntaxError(log, sss, line); - } - return ival; -} - -/** - * - * Read species data from THERMO section records. - * - * @param names List of species names (input). - * @param species Table of species objects holding data from records - * in THERMO section (output). - * @param temp Default vector of temperature region boundaries - * There are one more temperatures than there are - * temperature regions. - * - * @return True, if the THERMO section exists and the species - * have all been successfully processed. False, if - * the THERMO section doesn't exist or there were - * additional problems. - */ -bool CKParser::readNASA9ThermoSection(std::vector& names, - speciesTable& species, vector_fp& temp, - int& optionFlag, std::ostream& log) -{ - // String buffer for lines - string s; - vector toks; - string defaultDate=""; - int nsp = static_cast(names.size()); - - // Comment string - string comment; - - // Check to see that we expect to be reading a NASA9 formatted file - if (!m_nasa9fmt) { - throw CK_SyntaxError(log, - "In NASA9 parser. However, we expect a different file format", - -1); - } - - // now read in all species records that have names in list 'names' - - bool getAllSpecies = (nsp > 0 && match(names[0], "")); - if (getAllSpecies) { - names.clear(); - } - - // Map between the number of times a species name appears in the database - map dup; // used to check for duplicate THERMO records - bool already_read; - - while (1 > 0) { - // If we don't have any more species to read, break - if (nsp == 0) { - break; - } - already_read = false; - - // Read a new species record from the section - Species spec; - readNASA9ThermoRecord(spec); - - // we signal the end of the section by putting as a - // species name. Break if you find the end of the section. - if (spec.name == "") { - break; - } - - // check for duplicate thermo data - if (dup[spec.name] == 2) { - log << "Warning: more than one THERMO record for " - << "species " << spec.name << endl; - log << "Record at line " << m_line - << " of " << m_ckfilename << " ignored." << endl; - already_read = true; - } - // Set the record in the map to 2 to create a signal for the - // next time. - dup[spec.name] = 2; - - // Check to see whether we need this particular species name - if (!already_read && (getAllSpecies - || (find(names.begin(), names.end(), spec.name) - < names.end()))) { - - // Add the species object to the map. Note we are - // doing a copy constructor here, so we create a - // lasting entry. - species[spec.name] = spec; - - if (verbose) { - log << endl << "found species " << spec.name; - log << " at line " << m_line - << " of " << m_ckfilename; - writeSpeciesData(log, spec); - } - if (getAllSpecies) { - names.push_back(spec.name); - nsp = static_cast(names.size()); - } else { - nsp--; - } - } - } - return true; -} - - -/** - * - * Read one species definition in a NASA9 string. - * - */ -void CKParser::readNASA9ThermoRecord(Species& sp) -{ - string s; - string numstr; - double cf; - // Set to the NASA9 polynomial format - sp.thermoFormatType = 1; - - // look for line 1, but if a keyword is found first or the end of - // the file is reached, return "" as the species name - string comment; - - // Name of the species - string nameid; - vector toks; - size_t nToks = 0; - - // Loop forward until we get to the next nonempty line. - do { - getCKLine(s, comment); - if (isKeyword(s) || match(s, "")) { - sp.name = ""; - putCKLine(s, comment); - return; - } - - // The first 18 spaces are devoted to the name of the species - string nameid = s.substr(0,18); - getTokens(nameid, static_cast(nameid.size()), toks); - nToks = toks.size(); - } while (nToks == 0); - - //------------- line 1 --------------------------- - // Everything after the first 18 spaces is a comment. - size_t nt = s.size(); - sp.m_commentsRef = s.substr(18, nt-18); - - // Parse the species name - sp.name = toks[0]; - sp.id = ""; - if (nToks > 1) { - throw CK_SyntaxError(*m_log, - "Illegal number of tokens for string name", m_line); - } - checkSpeciesName(sp.name); - - - //------------- line 2 --------------------------- - - getCKLine(s, comment); - if (s.size() < 79) { - throw CK_SyntaxError(*m_log, - "Size of second line is too small", m_line); - } - // Read the number of temperature regions. - string sN = s.substr(0,2); - sp.nTempRegions = de_atoi(*m_log, sN); - - string refDataCode = s.substr(3,6); - - // elemental composition (first 5 elements) - for (int i = 0; i < 5; i++) { - string elementSym = ""; - int iloc = 10 + 8*i; - if (s[iloc] != ' ') { - if (s[iloc+1] != ' ') { - elementSym = s.substr(iloc,2); - } else { - elementSym = s.substr(iloc,1); - } - } else if (s[iloc+1] != ' ') { - elementSym = s.substr(iloc+1,1); - } - double atoms = de_atof(s.substr(iloc+2,6)); - addElement(elementSym, atoms, sp, *m_log); - } - - - // single-character phase descriptor - sp.phase = s.substr(50,2); - - // Molecular weight in gm per gmol - string molecWeight = s.substr(52, 13); - - // Heat of formation at 298.15 K in J / gmol - string Hf298_Jgmol = s.substr(65, 15); - - vector_fp* coeffs_ptr; - for (int i = 0; i < sp.nTempRegions; i++) { - - coeffs_ptr = new vector_fp(9); - vector_fp& coeffs = *coeffs_ptr; - - //------------- line 3 --------------------------- - getCKLine(s, comment); - if (s.size() < 79) { - throw CK_SyntaxError(*m_log, - "Size of third line is too small", m_line); - } - - string sTlow = s.substr(0, 11); - double tLow = de_atof(sTlow); - - string sTHigh = s.substr(11, 11); - double tHigh = de_atof(sTHigh); - - string sNCoeff = s.substr(22, 1); - int nCoeff = de_atoi(*m_log, sNCoeff); - if (nCoeff != 7) { - throw CK_SyntaxError(*m_log, "ncoeff ne 7", m_line); - } - - string sTCoeff1 = s.substr(24, 5); - double TCoeff1 = de_atof(sTCoeff1); - if (TCoeff1 != -2.0) { - throw CK_SyntaxError(*m_log, "TCoeff1 ne -2.0", m_line); - } - - string sTCoeff2 = s.substr(29, 5); - double TCoeff2 = de_atof(sTCoeff2); - if (TCoeff2 != -1.0) { - throw CK_SyntaxError(*m_log, "TCoeff2 ne -1.0", m_line); - } - - string sTCoeff3 = s.substr(34, 5); - double TCoeff3 = de_atof(sTCoeff3); - if (TCoeff3 != 0.0) { - throw CK_SyntaxError(*m_log, "TCoeff3 ne 0.0", m_line); - } - - string sTCoeff4 = s.substr(39, 5); - double TCoeff4 = de_atof(sTCoeff4); - if (TCoeff4 != 1.0) { - throw CK_SyntaxError(*m_log, "TCoeff4 ne 1.0", m_line); - } - - string sTCoeff5 = s.substr(44, 5); - double TCoeff5 = de_atof(sTCoeff5); - if (TCoeff5 != 2.0) { - throw CK_SyntaxError(*m_log, "TCoeff5 ne 2.0", m_line); - } - - string sTCoeff6 = s.substr(49, 5); - double TCoeff6 = de_atof(sTCoeff6); - if (TCoeff6 != 3.0) { - throw CK_SyntaxError(*m_log, "TCoeff6 ne 3.0", m_line); - } - - string sTCoeff7 = s.substr(54, 5); - double TCoeff7 = de_atof(sTCoeff7); - if (TCoeff7 != 4.0) { - throw CK_SyntaxError(*m_log, "TCoeff7 ne 4.0", m_line); - } - - string sHf298mHF0 = s.substr(65, 15); - - //------------- line 4 --------------------------- - getCKLine(s, comment); - if (s.size() < 79) { - throw CK_SyntaxError(*m_log, - "Size of third line is too small", m_line); - } - - numstr = s.substr(0, 16); - cf = getNumberFromString(numstr); - if (cf == UNDEF) { - illegalNumber(*m_log, numstr, m_line); - } - coeffs[0] = cf; - - numstr = s.substr(16, 16); - cf = getNumberFromString(numstr); - if (cf == UNDEF) { - illegalNumber(*m_log, numstr, m_line); - } - coeffs[1] = cf; - - numstr = s.substr(32, 16); - cf = getNumberFromString(numstr); - if (cf == UNDEF) { - illegalNumber(*m_log, numstr, m_line); - } - coeffs[2] = cf; - - numstr = s.substr(48, 16); - cf = getNumberFromString(numstr); - if (cf == UNDEF) { - illegalNumber(*m_log, numstr, m_line); - } - coeffs[3] = cf; - - numstr = s.substr(64, 16); - cf = getNumberFromString(numstr); - if (cf == UNDEF) { - illegalNumber(*m_log, numstr, m_line); - } - coeffs[4] = cf; - - //------------- line 5 --------------------------- - getCKLine(s, comment); - if (s.size() < 79) { - throw CK_SyntaxError(*m_log, - "Size of fourth line is too small", m_line); - } - - numstr = s.substr(0, 16); - cf = getNumberFromString(numstr); - if (cf == UNDEF) { - illegalNumber(*m_log, numstr, m_line); - } - coeffs[5] = cf; - - numstr = s.substr(16, 16); - cf = getNumberFromString(numstr); - if (cf == UNDEF) { - illegalNumber(*m_log, numstr, m_line); - } - coeffs[6] = cf; - - numstr = s.substr(48, 16); - cf = getNumberFromString(numstr); - if (cf == UNDEF) { - illegalNumber(*m_log, numstr, m_line); - } - coeffs[7] = cf; - - numstr = s.substr(64, 16); - cf = getNumberFromString(numstr); - if (cf == UNDEF) { - illegalNumber(*m_log, numstr, m_line); - } - coeffs[8] = cf; - - // Store the coefficients. - sp.minTemps.push_back(tLow); - sp.maxTemps.push_back(tHigh); - - sp.region_coeffs.push_back(coeffs_ptr); - - } - - sp.valid = 1; -} - - - -} // ckr namespace - diff --git a/src/converters/Reaction.cpp b/src/converters/Reaction.cpp deleted file mode 100644 index 7e071765d..000000000 --- a/src/converters/Reaction.cpp +++ /dev/null @@ -1,196 +0,0 @@ -/** - * @file Reaction.cpp - * - */ - -// Copyright 2001 California Institute of Technology - -#include "Reaction.h" -#include -#include - -using namespace std; - -namespace ckr -{ - -Reaction forwardReaction(const Reaction& rxn) -{ - Reaction r(rxn); - r.isReversible = false; - r.krev = RateCoeff(); - return r; -} - -Reaction reverseReaction(const Reaction& rxn) -{ - Reaction r(rxn); - if (rxn.isReversible && (r.krev.A > 0.0)) { - r.isReversible = false; - r.products = rxn.reactants; - r.reactants = rxn.products; - r.kf = rxn.krev; - r.krev = RateCoeff(); - } else { - r.reactants.clear(); - r.products.clear(); - } - return r; -} - -Reaction& Reaction::operator=(const Reaction& b) -{ - if (this == &b) { - return *this; - } - type = b.type; - reactants = b.reactants; - fwdOrder = b.fwdOrder; - products = b.products; - thirdBody = b.thirdBody; - e3b = b.e3b; - kf = b.kf; - kf_aux = b.kf_aux; - krev = b.krev; - duplicate = b.duplicate; - falloffType = b.falloffType; - falloffParameters = b.falloffParameters; - otherAuxData = b.otherAuxData; - isFalloffRxn = b.isFalloffRxn; - isChemActRxn = b.isChemActRxn; - isThreeBodyRxn = b.isThreeBodyRxn; - isDuplicate = b.isDuplicate; - lines = b.lines; - number = b.number; - comment = b.comment; - return *this; -} - -void Reaction::write(std::ostream& s) const -{ - int nl = static_cast(lines.size()); - for (int nn = 0; nn < nl; nn++) { - s << lines[nn] << std::endl; - } - // int nr = reactants.size(); - // int np = products.size(); - // int n; - // double nu; - // for (n = 0; n < nr; n++) { - // nu = reactants[n].number; - // if (nu > 1) s << nu; - // s << reactants[n].name; - // if (n < nr - 1) - // s << " + "; - // else if (isThreeBodyRxn) - // s << " + " << thirdBody; - // else if (isFalloffRxn || isChemActRxn) - // s << " (+ " << thirdBody << ")"; - // } - - // if (isReversible) s << " = "; - // else s << "=>"; - // for (n = 0; n < np; n++) { - // nu = products[n].number; - // if (nu > 1) s << nu; - // s << products[n].name; - // if (n < np - 1) - // s << " + "; - // else if (isThreeBodyRxn) - // s << " + " << thirdBody; - // else if (isFalloffRxn || isChemActRxn) - // s << " (+ " << thirdBody << ")"; - // } - // char kfstr[100]; - // sprintf(kfstr, " %14.5g %4.2g %f", kf.A, kf.n, kf.E); - // s << kfstr << endl; -} - - -/** - * stoichiometric coefficient of species s in the reaction. Negative - * for reactants, positive for products, and zero if the species does - * not participate in the reaction. - */ - -double Reaction::stoichCoefficient(const std::string& s) const -{ - int k; - int nr = static_cast(reactants.size()); - for (k = 0; k < nr; k++) - if (reactants[k].name == s) { - return -reactants[k].number; - } - int np = static_cast(products.size()); - for (k = 0; k < np; k++) - if (products[k].name == s) { - return products[k].number; - } - return 0.0; -} - -/** - * used to find undeclared duplicate reactions. - * @todo could be made faster - */ -bool Reaction::operator==(const Reaction& r) const -{ - int nr = static_cast(reactants.size()); - int np = static_cast(products.size()); - if (int(r.reactants.size()) != nr || - int(r.products.size()) != np || r.thirdBody != thirdBody) { - return false; - } - - std::string nm; - std::map coeffs; - for (int ir = 0; ir < nr; ir++) { - coeffs[reactants[ir].name] = -reactants[ir].number; - } - for (int ip = 0; ip < np; ip++) { - coeffs[products[ip].name] = products[ip].number; - } - for (int jr = 0; jr < nr; jr++) { - nm = r.reactants[jr].name; - if (coeffs[nm] == 0.0) { - return false; - } - coeffs[nm] /= -r.reactants[jr].number; - } - for (int jp = 0; jp < np; jp++) { - nm = r.products[jp].name; - if (coeffs[nm] == 0.0) { - return false; - } - coeffs[nm] /= products[jp].number; - } - int nc = static_cast(coeffs.size()); - std::vector ratios; - getMapValues(coeffs, ratios); - - if (!isReversible && ratios[0] < 0.0) { - return false; - } - - for (int ic = 0; ic < nc; ic++) { - if (ratios[ic] != ratios[0]) { - return false; - } - } - return true; -} - -} - - - - - - - - - - - - - diff --git a/src/converters/Reaction.h b/src/converters/Reaction.h deleted file mode 100644 index f75d549cb..000000000 --- a/src/converters/Reaction.h +++ /dev/null @@ -1,261 +0,0 @@ -/** - * @file Reaction.h - * - */ - -// Copyright 2001 California Institute of Technology - - -#ifndef CKR_REACTION_H -#define CKR_REACTION_H - -#include -#include -#include -#include - -#include "ckr_defs.h" -#include "ckr_utils.h" -#include "RxnSpecies.h" - -namespace ckr -{ - - -/** @name Reaction Types - */ - -//@{ -const int Elementary = 2000; ///< elementary, pressure-independent reaction -const int ThreeBody = 2001; ///< three-body reaction -const int Falloff = 2002; ///< falloff reaction -const int ChemAct = 2003; ///< chemical activation reaction -//@} - -/** - * Reaction rate coefficient class. For simplicity, the RateCoeff - * class has public members representing the parameters of all rate - * coefficient types supported by Chemkin. The 'type' attribute - * specifies the rate coefficient type. - */ -class RateCoeff -{ -public: - - /** - * Constructor. Construct a default rate coefficient object. The - * type is set to Arrhenius, and all parameter values are set to - * zero. - */ - RateCoeff() : A(0.0), n(0.0), E(0.0), - B(0.0), C(0.0), type(Arrhenius) {} - - /** - * Copy constructor - */ - RateCoeff(const RateCoeff& k) : A(k.A), n(k.n), E(k.E), - B(k.B), C(k.C), type(k.type), b(k.b) {} - - /// Destructor. Does nothing. - ~RateCoeff() {} - - RateCoeff& operator=(const RateCoeff& k) { - if (this == &k) { - return *this; - } - A = k.A; - n = k.n; - E = k.E; - B = k.B; - C = k.C; - type = k.type; - b = k.b; - return *this; - } - - // Modified Arrhenius parameters, common to all types. - double A; ///< pre-exponential factor (all types) - double n; ///< temperature exponent (all types) - double E; ///< activation energy (all types) - - // Landau-Teller parameters - double B; ///< Landau-Teller B parameter - double C; ///< Landau-Teller C parameter - - int type; ///< rate coefficient type - - // Coefficients for the special forms allowed by Chemkin-III - vector_fp b; ///< coefficients for JAN or FIT1 form - -}; - - -////////////////////////////////////////////////////////////////////////// - -//! Specifies the Units for all reactions -/** - * The default units are Cal per gmol for the activivation units - * and the default number type is assumed to be gmol. - */ -class ReactionUnits -{ -public: - ReactionUnits() : - ActEnergy(ckr::Cal_per_Mole), - Quantity(ckr::Moles) { } - - int ActEnergy; ///< Activation energy unit flag - int Quantity; ///< Moles or molecules unit flag -}; - - -////////////////////////////////////////////////////////////////////////// - - -/// A class for reactions. - -// Note: if you add data items to this class, be sure to update -// the copy constructor and the assignment operator ! - -class Reaction -{ -public: - - /// a list of auxiliary data values - typedef vector_fp auxdata; - - /// Construct an empty Reaction object - Reaction() : type(Elementary), - isFalloffRxn(false), - isChemActRxn(false), - isThreeBodyRxn(false), - isReversible(false), - isDuplicate(false), - duplicate(0), - thirdBody(""), - number(0), - falloffType(Lindemann) {} - - /// Copy constructor - Reaction(const Reaction& r) : type(r.type), - isFalloffRxn(r.isFalloffRxn), - isChemActRxn(r.isChemActRxn), - isThreeBodyRxn(r.isThreeBodyRxn), - isReversible(r.isReversible), - isDuplicate(r.isDuplicate), - duplicate(r.duplicate), - thirdBody(r.thirdBody), - number(r.number), - reactants(r.reactants), - fwdOrder(r.fwdOrder), - products(r.products), - e3b(r.e3b), - kf(r.kf), - kf_aux(r.kf_aux), - krev(r.krev), - falloffType(r.falloffType), - falloffParameters(r.falloffParameters), - otherAuxData(r.otherAuxData), - lines(r.lines), comment(r.comment) {} - - /// Destructor - virtual ~Reaction() {} - - Reaction& operator=(const Reaction& r); - - int type; ///< Reaction type. - - bool isFalloffRxn; ///< True if reaction is a falloff reaction. - bool isChemActRxn; ///< True if reaction is a chemical activation reaction. - bool isThreeBodyRxn; ///< True if reaction is a three-body reaction. - bool isReversible; ///< True if reaction is reversible. - bool isDuplicate; ///< True if reaction is declared to be a duplicate; - - /** - * reaction number this one is a duplicate to (declared or not). - * If the reaction is not a duplicate, the value is zero. - */ - int duplicate; - - /** - * For pressure-dependent reactions (including three-body ones) - * this string contains either "M" if all species may act as - * third body collision partners, or a species name if only - * one species does. - */ - std::string thirdBody; - - /// Reaction number. - int number; - - /** - * list of species that participate as reactants, - * and their stoichiometric coefficients - */ - std::vector reactants; - - mutable std::map fwdOrder; - - /** - * list of species that participate as products, - * and their stoichiometric coefficients - */ - std::vector products; - - - /** - * map from species names to enhanced third-body collision efficiencies - */ - mutable std::map e3b; - - /** - * Forward rate coefficient. For falloff reactions, this is the - * high-pressure rate coefficient, and for chemical activation - * reactions it is the low-pressure one. - */ - RateCoeff kf; - - /** - * For pressure-dependent reactions, the rate coefficient for the - * opposite pressure limit as kf ( - */ - RateCoeff kf_aux; - - /// Reverse rate coefficient. Empty unless REV auxiliary data given. - RateCoeff krev; - - - int falloffType; - vector_fp falloffParameters; - - /** - * auxiliary data not handled elsewhere. - */ - mutable std::map otherAuxData; - - /** - * input file lines - */ - std::vector lines; - - /** - * comments - */ - std::vector comment; - - // methods - - double stoichCoefficient(const std::string& s) const; - bool operator==(const Reaction& r) const; - void write(std::ostream& s) const; - -}; - -/// a list of Reaction objects -typedef std::vector reactionList; - -Reaction forwardReaction(const Reaction& rxn); -Reaction reverseReaction(const Reaction& rxn); -} - -#endif diff --git a/src/converters/RxnSpecies.h b/src/converters/RxnSpecies.h deleted file mode 100644 index 50e79336c..000000000 --- a/src/converters/RxnSpecies.h +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @file RxnSpecies.h - * - */ - -// Copyright 2001 California Institute of Technology - - -#ifndef CKR_RXNSPECIES_H -#define CKR_RXNSPECIES_H - -#include -#include - -namespace ckr -{ - -typedef vector_int group_t; -typedef std::vector grouplist_t; - -/** - * A class for species in a reaction. - * - */ -class RxnSpecies -{ -public: - RxnSpecies() : - number(0) {} - std::string name; //!< The name of the object. - double number; //!< The number of units (molecules, etc.). - grouplist_t groups; -}; - -} - -#endif diff --git a/src/converters/Species.cpp b/src/converters/Species.cpp deleted file mode 100644 index 1dc228134..000000000 --- a/src/converters/Species.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/** - * @file Species.cpp - * - */ - -// Copyright 2001 California Institute of Technology - - -#include "Species.h" -#include -#include - -namespace ckr -{ - -// Construct an empty Species object -Species::Species() : - thermoFormatType(0), - name(""), - id(""), - phase(""), - tlow(0.0), - tmid(0.0), - thigh(0.0), - nTempRegions(2), - valid(0), - index(-1) -{ -} - -// Destructor -Species::~Species() -{ - delR(); -} - -void Species::delR() -{ - for (size_t i = 0; i < region_coeffs.size(); i++) { - if (region_coeffs[i]) { - delete region_coeffs[i]; - region_coeffs[i] = 0; - } - } -} - -//! Copy constructor -Species::Species(const Species& s) -{ - /* - * Use the assignment operator to do the brunt - * of the work for the copy constructor. - */ - *this = s; -} - -// Assignment operator -Species& Species::operator=(const Species& s) -{ - if (&s == this) { - return *this; - } - thermoFormatType = s.thermoFormatType; - name = s.name; - id = s.id; - phase = s.phase; - tlow = s.tlow; - tmid = s.tmid; - thigh = s.thigh; - nTempRegions = s.nTempRegions; - elements = s.elements; - comp = s.comp; - lowCoeffs = s.lowCoeffs; - highCoeffs = s.highCoeffs; - delR(); - for (size_t i = 0; i < s.region_coeffs.size(); i++) { - region_coeffs.push_back(new vector_fp(*(s.region_coeffs[i]))); - } - minTemps = s.minTemps; - maxTemps = s.maxTemps; - m_commentsRef = s.m_commentsRef; - valid = s.valid; - index = s.index; - return *this; -} - -// Test for equality based on name only. -bool Species::operator==(const Species& s) const -{ - return (s.name == name); -} - -bool Species::operator!=(const Species& s) const -{ - return !(*this == s); -} - -// Used to sort lists of species by index number. -bool Species::operator<(const Species& s) const -{ - return (index < s.index); -} - - - - - -} diff --git a/src/converters/Species.h b/src/converters/Species.h deleted file mode 100644 index d9f01b2a2..000000000 --- a/src/converters/Species.h +++ /dev/null @@ -1,106 +0,0 @@ -/** - * @file Species.h - */ -// Copyright 2001 California Institute of Technology - -#ifndef CKR_SPECIES_H -#define CKR_SPECIES_H - -#include "ckr_defs.h" -#include "Constituent.h" -#include -#include - -namespace ckr -{ - -/** - * Holds species data read in from entries in the THERMO section of - * a chemkin or nasa9 fortran formatted input file. - */ -class Species -{ -public: - - /// Construct an empty Species object - Species(); - - //! Copy constructor - Species(const Species& s); - - /// Destructor - ~Species(); - - /// Assignment operator - Species& operator=(const Species& s); - - /// Test for equality based on name only. - bool operator==(const Species& s) const; - - bool operator!=(const Species& s) const; - - /// Used to sort lists of species by index number. - bool operator<(const Species& s) const; - - //! Type of thermodynamic representation - /*! - * 0 This is a 2 region NASA polynomial representation - * - * 1 This is a multiple temperature region NASA9 polynomial - * representation. - */ - int thermoFormatType; - - //! Species Name - std::string name; - std::string id; //!< ID tag from 'date' field in input - std::string phase; //!< Phase string. Usually "G", "L", or "S". - double tlow; //!< Min temperature for thermo data fit - double tmid; //!< Mid temperature for thermo data fit - double thigh; //!< Max temperature for thermo data fit - - /// list of Constituent objects defining elemental composition - std::vector elements; - - /// map from element symbols to atom numbers - mutable std::map comp; - - /// polynomial coefficients for the lower temperature range - vector_fp lowCoeffs; - - /// polynomial coefficients for the upper temperature range - vector_fp highCoeffs; - - //! Number of temperature regions - int nTempRegions; - - std::vector region_coeffs; - vector_fp minTemps; - vector_fp maxTemps; - - /// flag set by the validation routines - int valid; - - /// position in the list of species in the input file - int index; - - std::string m_commentsRef; - -private: - //! Delete private data - void delR(); -}; - -//! Shorthand for a list of Species -typedef std::vector speciesList; - -//! A map from species names to Species objects -typedef std::map speciesTable; -} - -#endif - - - - - diff --git a/src/converters/atomicWeightDB.cpp b/src/converters/atomicWeightDB.cpp deleted file mode 100644 index 3d382abc6..000000000 --- a/src/converters/atomicWeightDB.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/** - * @file atomicWeightDB.cpp - * - * internal database of default atomic weights - * - */ - -// Copyright 2001 California Institute of Technology - -#include -#include -#include -using namespace std; - -namespace ckr -{ - -static double _weights[] = { - 1.00797, 4.0026, 6.939, 9.01220, 10.811, // H - B - 12.01115, 14.0067, 15.9994, 18.9984, 20.183, 22.9898, // C - Na - 24.312, 26.9815, 28.086, 30.9738, 32.064, // Mg - S - 35.453, 39.948, 39.102, 40.08, 44.956, // Cl - Sc - 47.9, 50.942, 51.996, 54.938, 55.847, // Ti - Fe - 58.9332, 58.71, 63.54, 65.37, 69.72, // Co - Ga - 72.59, 74.9216, 78.96, 79.9009, 83.8, // Ge - Kr - 85.47, 87.62, 88.905, 91.22, 92.9064, // Rb - Nb - 95.94, 98, 101.07, 102.906, 106.42, // Mo - Pd - 107.868, 112.41, 114.82, 118.71, 121.75, // Ag - Sb - 127.6, 126.905, 131.29, 132.905, 137.33, // Te - Ba - 138.906, 140.12, 140.908, 144.24, 145, // La - Pm - 150.36, 151.96, 157.25, 158.925, 162.5, // Sm - Dy - 164.93, 167.26, 168.934, 173.04, 174.967, // Ho - Lu - 178.49, 180.948, 183.85, 186.207, 190.2, // Hf - Os - 192.22, 195.08, 196.967, 200.59, 204.383, // Ir - Tl - 207.2, 208.98, 209, 210, 222, // Pb - Rn - 223, 226.025, 227.028, 232.038, 231.036, // Fr - Pa - 238.029, 237.048, 244, 243, 247, // U - Cm - 247, 251, 252, 257, 258, // Bk - Md - 259, 269, 2.0141, 5.45e-4, -1.0 // No - E -}; - - - -static char _symbols[][3] = { - "H", "He", "Li", "Be", "B", - "C", "N", "O", "F", "Ne", "Na", - "Mg", "Al", "Si", "P", "S", - "Cl", "Ar", "K", "Ca", "Sc", - "Ti", "V", "Cr", "Mn", "Fe", - "Co", "Ni", "Cu", "Zn", "Ga", - "Ge", "As", "Se", "Br", "Kr", - "Rb", "Sr", "Y", "Zr", "Nb", - "Mo", "Tc", "Ru", "Rh", "Pd", - "Ag", "Cd", "In", "Sn", "Sb", - "Te", "I", "Xe", "Cs", "Ba", - "La", "Ce", "Pr", "Nd", "Pm", - "Sm", "Eu", "Gd", "Tb", "Dy", - "Ho", "Er", "Tm", "Yb", "Lu", - "Hf", "Ta", "W", "Re", "Os", - "Ir", "Pt", "Au", "Hg", "Tl", - "Pb", "Bi", "Po", "At", "Rn", - "Fr", "Ra", "Ac", "Th", "Pa", - "U", "Np", "Pu", "Am", "Cm", - "Bk", "Cf", "Ei", "Fm", "Md", - "No", "Lw", "D", "E", "!" -}; - - - -/** - * Get table of atomic weights from the internal database. - * @param weights atomic symbol -> atomic weight map - * - * Example usage: - * @code - * #include "atomicWeightDB.h" - * ... - * map atw; - * getDefaultAtomicWeights(atw); - * double copperAtomicWeight = atw["Cu"]; - * ... - * @endcode - * Note that if the atomic weight is requested for an unknown - * element symbol, the value zero will be returned. - */ -//void getDefaultAtomicWeights(ct::ctmap_sd& weights) { -void getDefaultAtomicWeights(map& weights) -{ - - // erase existing entries, if any - //weights.clear(); - const int MAX_NUM = 200; - int n; - for (n = 0; n < MAX_NUM; n++) { - if (_symbols[n][0] == '!') { - break; - } - weights[_symbols[n]] = _weights[n]; - } -} - -void writeKnownElements(ostream& s, string fmt) -{ - - const int MAX_NUM = 200; - int n; - if (fmt == "CK") { - for (n = 0; n < MAX_NUM; n++) { - if (_symbols[n][0] == '!') { - break; - } - s << " " << string(_symbols[n]) << "/" << _weights[n] << "/" << endl; - } - } else if (fmt == "XML") { - s << "" << endl; - for (n = 0; n < MAX_NUM; n++) { - if (_symbols[n][0] == '!') { - break; - } - s << " " << _symbols[n] << "" - << _weights[n] << "" << endl; - } - s << "" << endl; - } -} -} - diff --git a/src/converters/ck2ct.cpp b/src/converters/ck2ct.cpp deleted file mode 100644 index 22165ae49..000000000 --- a/src/converters/ck2ct.cpp +++ /dev/null @@ -1,634 +0,0 @@ -/** - * @file ck2ct.cpp - * Convert CK-format reaction mechanism files to Cantera input format. - */ -#include -#include -#include - -#include "cantera/base/config.h" - -#include -using namespace std; - -#include "CKReader.h" -#include "Reaction.h" -#include "writelog.h" - -#include "ck2ct.h" -#include "cantera/base/stringUtils.h" -#include -#include "cantera/base/ct_defs.h" -#include "cantera/base/ctml.h" - - -using namespace Cantera; - -namespace pip -{ - -struct trdata { - int geom; - doublereal welldepth, diam, dipole, polar, rot; -}; - -static map _trmap; -static bool _with_transport = false; - -static void getTransportData(string trfile) -{ - - _with_transport = true; - ifstream s(trfile.c_str()); - if (!s) throw CanteraError("getTransportData", - "could not open transport database "+trfile); - - /* - * The first thing we will do is to read the entire transport - * database and place its contents into a map structure, - * indexed by the name of the species. - */ - string rest; - while (! s.eof()) { - /* - * Read a line from the file - * - * SOLARIS 10 NOTES: Optimized version of solaris seg faults - * without the '\n' argument for some reason, probably - * an internal solaris stl bug. - */ - getline(s, rest,'\n'); - /* - * In the transport database, we allow comment lines that - * consist of '#' and '!' as the first character in the - * in the line. We also don't bother to parse short lines that - * can't possibly have enough data in them to comprise a - * properly formatted record. - */ - if (rest.size() > 5 && rest[0] != '#' && rest[0] != '!') { - /* - * copy the string into a stringstream and parse the line - * into the trdata object - */ - std::istringstream ioline(rest); - trdata t; - string nm; - ioline >> nm >> t.geom >> t.welldepth >> t.diam - >> t.dipole >> t.polar >> t.rot; - /* - * Add the trdata object into the map database by making a - * copy of it, and index it by the species name. - */ - if (nm != "") { - _trmap[nm] = t; // t.name] = t; - } - } - } -} - - -// add a NASA polynomial parameterization -static void addNASA(FILE* f, - const vector_fp& low, const vector_fp& high, - doublereal minx, doublereal midx, - doublereal maxx) -{ - - fprintf(f," thermo = (\n"); - fprintf(f," NASA( [%8.2f, %8.2f], ", minx, midx); - fprintf(f,"[%17.9E, %17.9E, \n", low[0], low[1]); - fprintf(f," %17.9E, %17.9E, %17.9E,\n", - low[2], low[3], low[4]); - fprintf(f," %17.9E, %17.9E] ),\n", low[5], low[6]); - fprintf(f," NASA( [%8.2f, %8.2f], ", midx, maxx); - fprintf(f,"[%17.9E, %17.9E, \n", high[0], high[1]); - fprintf(f," %17.9E, %17.9E, %17.9E,\n", - high[2], high[3], high[4]); - fprintf(f," %17.9E, %17.9E] )\n", high[5], high[6]); - fprintf(f," )"); -} - - - -//! Add a NASA polynomial parameterization to the cti file -/*! - * This little tidbit of code writes out the polynomials to the cti file - */ -static void addNASA9(FILE* f, - const std::vector ®ion_coeffs, - const vector_fp& minTemps, const vector_fp& maxTemps) -{ - size_t nReg = region_coeffs.size(); - if (minTemps.size() != nReg) { - throw CanteraError("addNASA9", "incompat"); - } - if (maxTemps.size() != nReg) { - throw CanteraError("addNASA9", "incompat"); - } - - fprintf(f," thermo = (\n"); - for (size_t i = 0; i < nReg; i++) { - double minT = minTemps[i]; - double maxT = maxTemps[i]; - const vector_fp& coeffs = *(region_coeffs[i]); - if ((int) coeffs.size() != 9) { - throw CanteraError("addNASA9", "incompat"); - } - fprintf(f," NASA9( [%8.2f, %8.2f], ", minT, maxT); - fprintf(f,"[%17.9E, %17.9E, %17.9E,\n", coeffs[0], - coeffs[1], coeffs[2]); - fprintf(f," %17.9E, %17.9E, %17.9E,\n", - coeffs[3], coeffs[4], coeffs[5]); - fprintf(f," %17.9E, %17.9E, %17.9E] )", - coeffs[6], coeffs[7], coeffs[8]); - if (i < nReg - 1) { - fprintf(f,",\n"); - } else { - fprintf(f,"\n"); - } - } - fprintf(f," )"); -} - - -static void addTransportParams(FILE* f, string name) -{ - - trdata td; - if (_with_transport && _trmap.find(name) != _trmap.end()) { - td = _trmap[name]; - } else { - throw CanteraError("addTransportParams", - "no transport data for species "+name); - } - - fprintf(f,",\n transport = gas_transport(\n"); - int geom = td.geom; - switch (geom) { - case 0: - fprintf(f," geom = \"atom\",\n"); - break; - case 1: - fprintf(f," geom = \"linear\",\n"); - break; - case 2: - fprintf(f," geom = \"nonlinear\",\n"); - break; - default: - throw CanteraError("addTransportParams", - "Unrecognized geometry flag for species " + name); - } - fprintf(f," diam = %g,\n",td.diam); - fprintf(f," well_depth = %g",td.welldepth); - if (td.polar != 0.0) { - fprintf(f,",\n polar = %g",td.polar); - } - if (td.dipole != 0.0) { - fprintf(f,",\n dipole = %g",td.dipole); - } - if (td.rot != 0.0) { - fprintf(f,",\n rot_relax = %g",td.rot); - } - fprintf(f,")"); -} - - -static void addFalloff(FILE* f, string type, - const vector_fp& params) -{ - if (type == "Troe") { - fprintf(f, "%s", (",\n falloff = Troe(A = " + - fp2str(params[0]) + ", T3 = " + - fp2str(params[1]) + ", T1 = " + - fp2str(params[2])).c_str()); - if (params.size() >= 4) { - fprintf(f, "%s", (", T2 = " + fp2str(params[3])).c_str()); - } - fprintf(f, ")"); - } else if (type == "SRI") { - fprintf(f, "%s", (",\n falloff = SRI(A = " + - fp2str(params[0]) + ", B = " + - fp2str(params[1]) + ", C = " + - fp2str(params[2])).c_str()); - if (params.size() >= 5) { - fprintf(f, "%s", (", D = " + fp2str(params[3]) + - ", E = " + fp2str(params[4])).c_str()); - } - fprintf(f, ")"); - } -} - -/** - * Write out a species cti block to the output file. - * - */ -static void addSpecies(FILE* f, string idtag, const ckr::Species& sp) -{ - string spname = sp.name; - if (spname.size() == 0) { - throw CanteraError("addSpecies", - "Species name is empty"); - } - fprintf(f,"\nspecies(name = \"%s\",\n",spname.c_str()); - int nel = static_cast(sp.elements.size()); - int m, num; - string nm, str=""; - for (m = 0; m < nel; m++) { - /* - * Copy the element name into the string, nm. Lower case the - * second letter, if needed. - */ - nm = sp.elements[m].name; - nm[0] = (char) toupper(nm[0]); - if (nm.size() == 2) { - nm[1] = (char) tolower(nm[1]); - } - /* - * Obtain the current number of atoms in the species. - * Linearize the number (HKM question? can we employ real values here - * instead?) - */ - num = int(sp.elements[m].number); - /* - * Add the name and number to end of the string, str - */ - str += " "+nm+":"+int2str(num)+" "; - - } - - fprintf(f," atoms = \"%s\",\n", str.c_str()); - // Add the NASA block according to the thermoFormatType value - if (sp.thermoFormatType == 0) { - if (sp.lowCoeffs.size() == 0) { - throw CanteraError("addSpecies", - "Low Nasa Thermo Polynomial was not found"); - } - if (sp.highCoeffs.size() == 0) { - throw CanteraError("addSpecies", - "High Nasa Thermo Polynomial was not found"); - } - if (sp.tlow >= sp.thigh) { - throw CanteraError("addSpecies", - "Low temp limit is greater or equal to high temp limit"); - } - addNASA(f, sp.lowCoeffs, sp.highCoeffs, - sp.tlow, sp.tmid, sp.thigh); - } else if (sp.thermoFormatType == 1) { - // This new typs is a multiregion 9 coefficient formulation - addNASA9(f, sp.region_coeffs, sp.minTemps, sp.maxTemps); - } else { - throw CanteraError("addSpecies", "Unknown thermoFormatType"); - } - - if (_with_transport) { - addTransportParams(f, sp.name); - } - if (sp.id != "" || sp.m_commentsRef != "") { - fprintf(f,",\n note = \""); - if (sp.id != "") { - fprintf(f, "%s", sp.id.c_str()); - } - if (sp.m_commentsRef != "") { - fprintf(f, " %s", sp.m_commentsRef.c_str()); - } - fprintf(f, "\""); - } - fprintf(f,"\n )\n"); -} - - -static void addReaction(FILE* f, string idtag, int i, - const ckr::Reaction& rxn, - const ckr::ReactionUnits& runits, doublereal version) -{ - - fprintf(f, "%s", ("\n# Reaction " + int2str(i+1) + "\n").c_str()); - int nc = static_cast(rxn.comment.size()); - vector options; - - for (int nn = 0; nn < nc; nn++) - if (rxn.comment[nn] != "") fprintf(f, "# %s \n", - rxn.comment[nn].c_str()); - - string eqn = ckr::reactionEquation(rxn); - - if (rxn.isThreeBodyRxn) { - fprintf(f, "three_body_reaction( \"%s\",", eqn.c_str()); - } else if (rxn.isFalloffRxn) { - fprintf(f, "falloff_reaction( \"%s\",", eqn.c_str()); - } else { - fprintf(f, "reaction( \"%s\",", eqn.c_str()); - } - - if (rxn.isFalloffRxn) { - - if (rxn.kf.type == ckr::Arrhenius) { - fprintf(f,"\n kf = [%10.5E, %g, %g]", rxn.kf.A, rxn.kf.n, rxn.kf.E); - } - if (rxn.kf_aux.type == ckr::Arrhenius) { - fprintf(f,",\n kf0 = [%10.5E, %g, %g]", rxn.kf_aux.A, rxn.kf_aux.n, rxn.kf_aux.E); - } - if (rxn.falloffType == ckr::Lindemann) { - addFalloff(f, "Lindemann",rxn.falloffParameters); - } else if (rxn.falloffType == ckr::Troe) { - addFalloff(f, "Troe",rxn.falloffParameters); - } else if (rxn.falloffType == ckr::SRI) { - addFalloff(f, "SRI",rxn.falloffParameters); - } else { - throw CanteraError("addReaction","unknown falloff type"); - } - } else { - if (rxn.kf.type == ckr::Arrhenius) { - fprintf(f," [%10.5E, %g, %g]", rxn.kf.A, rxn.kf.n, rxn.kf.E); - } else { - throw CanteraError("addReaction", - "unknown kf_type to reaction: " + int2str(rxn.kf.type)); - } - } - - // reaction orders - int nord = static_cast(rxn.fwdOrder.size()); - if (nord > 0) { - map::const_iterator b = rxn.fwdOrder.begin(), - e = rxn.fwdOrder.end(); - string estr = ""; - for (; b != e; ++b) { - estr += " "+b->first+":"+fp2str(b->second)+" "; - } - fprintf(f, ",\n order = \"%s\"", estr.c_str()); - } - - int ne = static_cast(rxn.e3b.size()); - if (rxn.thirdBody != "") { - if (rxn.thirdBody != "M") { - ; - } else if (ne > 0.0) { - map::const_iterator b = rxn.e3b.begin(), - e = rxn.e3b.end(); - string estr = ""; - for (; b != e; ++b) { - estr += " "+b->first+":"+fp2str(b->second)+" "; - } - fprintf(f, ",\n efficiencies = \"%s\"", estr.c_str()); - } - } - if (rxn.kf.A <= 0.0) { - options.push_back("negative_A"); - } - if (rxn.isDuplicate) { - options.push_back("duplicate"); - } - size_t nopt = options.size(); - if (nopt > 0) { - fprintf(f, ",\n options = ["); - for (size_t n = 0; n < nopt; n++) { - fprintf(f, "\"%s\"", options[n].c_str()); - if (n < nopt-1) { - fprintf(f, ", "); - } - } - fprintf(f, "]"); - } - fprintf(f, ")\n"); -} - -void writeline(FILE* f) -{ - fprintf(f, "#-------------------------------------------------------------------------------\n"); -} - -/*! - * This routine is the main routine. - * - * @param r reference to a ckreader object that has already - * read a chemkin formatted mechanism. This is the input to the routine. - * - * @param root Reference to the root node of an XML description of the - * mechanism. The node will be filled up with the description - * of the mechanism. This is the output to the routine. - */ -void ck2ct(FILE* f, string idtag, ckr::CKReader& r, bool hastransport) -{ - - popError(); - doublereal version = 1.0; - - fprintf(f, "units(length = \"cm\", time = \"s\", quantity = \"mol\", "); - string e_unit = " "; - int eunit = r.units.ActEnergy; - if (eunit == ckr::Cal_per_Mole) { - e_unit = "cal/mol"; - } else if (eunit == ckr::Kcal_per_Mole) { - e_unit = "kcal/mol"; - } else if (eunit == ckr::Joules_per_Mole) { - e_unit = "J/mol"; - } else if (eunit == ckr::Kjoules_per_Mole) { - e_unit = "kJ/mol"; - } else if (eunit == ckr::Kelvin) { - e_unit = "K"; - } else if (eunit == ckr::Electron_Volts) { - e_unit = "eV"; - } - fprintf(f, "act_energy = \"%s\")\n\n", e_unit.c_str()); - - - fprintf(f,"\nideal_gas(name = \"%s\",\n",idtag.c_str()); - - string enames; - int nel = static_cast(r.elements.size()); - int i; - map emap; - string elnm; - for (i = 0; i < nel; i++) { - elnm = r.elements[i].name; - elnm[0] = (char) toupper(elnm[0]); - if (elnm.size() == 2) { - elnm[1] = (char) tolower(elnm[1]); - } - emap[r.elements[i].name] = elnm; - enames += " "+elnm+" "; - } - fprintf(f," elements = \"%s\",\n",enames.c_str()); - - string spnames = ""; - int nsp = static_cast(r.species.size()); - for (i = 0; i < nsp; i++) { - spnames += " "+r.species[i].name+" "; - if ((i+1) % 10 == 0) { - spnames += "\n "; - } - } - fprintf(f," species = \"\"\"%s\"\"\",\n", spnames.c_str()); - fprintf(f," reactions = \"all\",\n"); - if (hastransport) { - fprintf(f," transport = \"Mix\",\n"); - } - fprintf(f," initial_state = state(temperature = 300.0,\n"); - fprintf(f," pressure = OneAtm)"); - fprintf(f, " )\n"); - - fprintf(f, "\n\n\n"); - writeline(f); - fprintf(f, "# Species data \n"); - writeline(f); - - for (i = 0; i < nsp; i++) { - addSpecies(f, idtag, r.species[i]); - } - - fprintf(f, "\n\n\n"); - writeline(f); - fprintf(f, "# Reaction data \n"); - writeline(f); - - - int nrxns = static_cast(r.reactions.size()); - - int irxn = 0; - string idktag = idtag; - for (i = 0; i < nrxns; i++) { - - // if krev.A is non-zero, then the reverse rate coefficient is - // being explicitly specified rather than being computed from - // thermochemistry. In this case, convert the reaction into - // two irreversible reactions. - - if (r.reactions[i].krev.A != 0.0) { - fprintf(f, "\n# [CK Reaction (+%d)]\n",i+1); - addReaction(f, idktag, irxn, - ckr::forwardReaction(r.reactions[i]), r.units, version); - irxn++; - fprintf(f, "# [CK Reaction (-%d)]\n",i+1); - addReaction(f, idktag, irxn, - ckr::reverseReaction(r.reactions[i]), r.units, version); - irxn++; - } - - // Otherwise, just add the whole reaction, which may or may - // not be reversible. - else { - if (i != irxn) { - fprintf(f, "\n# [CK Reaction (%d)]\n",i+1); - } - addReaction(f, idktag, irxn, r.reactions[i], - r.units, version); - irxn++; - } - } -} - -/* - static int fixtext(string infile, string outfile) { - ifstream fin(infile.c_str()); - ofstream fout(outfile.c_str()); - if (!fout) { - throw CanteraError("fixtext","could not open "+outfile+" for writing."); - } - char ch; - char last_eol = ' '; - const char char10 = char(10); - const char char13 = char(13); - string line; - while (1 > 0) { - line = ""; - while (1 > 0) { - fin.get(ch); - if (fin.eof()) break; - if (ch == char13 || (ch == char10 - && (last_eol != char13))) { - last_eol = ch; - break; - } - if (isprint(ch)) line += ch; - } - fout << line << endl; - if (fin.eof()) break; - } - fin.close(); - fout.close(); - return 0; - } -*/ - -int convert_ck(const char* in_file, const char* db_file, - const char* tr_file, const char* id_tag, bool debug, bool validate) -{ - ckr::CKReader r; - - r.validate = validate; - r.debug = debug; - //int i=1; - - string infile = string(in_file); - string dbfile = string(db_file); - string trfile = string(tr_file); - //string outfile = string(out_file); - string idtag = string(id_tag); - string logfile; - if (dbfile == "-") { - dbfile = ""; - } - if (trfile == "-") { - trfile = ""; - } - - string::size_type idot = infile.rfind('.'); - string ctifile, ext; - if (idot != string::npos) { - ext = infile.substr(idot, infile.size()); - ctifile = infile.substr(0,idot)+".cti"; - } else { - ctifile = infile+".cti"; - } - - FILE* f = fopen(ctifile.c_str(),"w"); - - struct tm* newtime; - time_t aclock; - ::time(&aclock); /* Get time in seconds */ - newtime = localtime(&aclock); /* Convert time to struct tm form */ - - try { - - //string tmpinfile = tmpDir()+ - //fixtext(infile, tmpinfile); - - //string tmpdbfile = ""; - //string tmptrfile = ""; - //if (dbfile != "") { - // tmpdbfile = tmpDir()+"/.tmp_"+dbfile; - // fixtext(dbfile, tmpdbfile); - //} - //if (trfile != "") { - // tmptrfile = tmpDir()+"/.tmp_"+trfile; - // fixtext(trfile, tmptrfile); - //} - - logfile = "ck2cti.log"; - if (!r.read(infile, dbfile, logfile)) { - throw CanteraError("convert_ck", - "error encountered in input file " + string(infile) - + "\nsee file ck2cti.log for more information.\n"); - } - - fprintf(f, "#\n"); - fprintf(f, "# Generated from file %s\n# by ck2cti on %s#\n", - infile.c_str(), asctime(newtime)); - if (trfile != "") { - fprintf(f, "# Transport data from file %s.\n\n", - trfile.c_str()); - getTransportData(trfile); - } - bool hastransport = (trfile != ""); - ck2ct(f, idtag, r, hastransport); - } catch (CanteraError& err) { - err.save(); - fclose(f); - return -1; - } - fclose(f); - return 0; -} -} - - diff --git a/src/converters/ck2ct.h b/src/converters/ck2ct.h deleted file mode 100644 index 94dc1d61f..000000000 --- a/src/converters/ck2ct.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef CT_CK2CT_H -#define CT_CK2CT_H - -#include -#include -#include - -//#include "cantera/base/ctml.h" - -namespace ckr -{ -class CKReader; -} - -namespace pip -{ - -void ck2ct(std::string idtag, ckr::CKReader& r); - -int convert_ck(const char* in_file, const char* db_file, - const char* tr_file, const char* id_tag, bool debug, bool validate); - -} - -#endif - diff --git a/src/converters/ckr_defs.h b/src/converters/ckr_defs.h deleted file mode 100644 index 042234407..000000000 --- a/src/converters/ckr_defs.h +++ /dev/null @@ -1,96 +0,0 @@ -/** - * @file ckr_defs.h - * - */ - -// Copyright 2001 California Institute of Technology - - - -#ifndef CKR_DEFS_H -#define CKR_DEFS_H - -//#include "cantera/base/config.h" -#include -#include -#include - -/// the namespace for the CKReader packaage -namespace ckr -{ - -typedef std::vector vector_fp; -typedef std::vector vector_int; - -// exceptions -class CK_Exception -{ -public: - CK_Exception() { - m_msg = ""; - } - virtual ~CK_Exception() {} - std::string errorMessage() { - return m_msg; - } -protected: - std::string m_msg; -}; - -const double UNDEF = -9999.1234; - -/** - * @name Falloff Parameterizations - * These constants are used to specify which falloff parameterization - * to use for a pressure-dependent reaction. - * @see Reaction.h - */ - -//@{ -const int Lindemann = 0; -const int Troe = 1; -const int SRI = 2; -//@} - - - -/** @name Reaction Rate Types - * These constant are used to specify the type of rate coefficient - */ -//@{ -const int Arrhenius = 0, LandauTeller = 1, Jan = 2, Fit1 = 3; -//@} - - -/** @name Activation Energy Units - * These constants specify the supported units for the activation energy of - * a reaction - * The default is to assume Cal_per_Mole for unspecified units in the activation energy - * as this was the original default - */ -//@{ -const int Cal_per_Mole = 1, - Kcal_per_Mole = 2, - Joules_per_Mole = 3, - Kelvin= 4, - Electron_Volts = 5, - Kjoules_per_Mole = 6; -//@} - -/** - * @name Quantity Units - * These constants define the supported units for number of molecules. - */ -//@{ -const int Moles = 100; ///< specify number of moles (6.023e23 molecules / mole) -const int Molecules = 101; ///< specify number of molecules -//@} - -} // namespace - - -#endif - - - - diff --git a/src/converters/ckr_utils.cpp b/src/converters/ckr_utils.cpp deleted file mode 100644 index 99fb878a3..000000000 --- a/src/converters/ckr_utils.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/** - * @file ckr_utils.cpp - * - */ - -// Copyright 2001 California Institute of Technology - -#include - -#include -#include "ckr_utils.h" -#include - -using namespace std; - -namespace ckr -{ - - -bool match(const std::string& s1, const std::string& s2) -{ - size_t n = s2.size(); - if (s1.size() < n) { - return false; - } - for (size_t i = 0; i < n; i++) - if (s2[i] != '*' && (toupper(s1[i]) != toupper(s2[i]))) { - return false; - } - return true; -} - - -void removeWhiteSpace(std::string& s) -{ - string r; - int ssize = static_cast(s.size()); - for (int n = 0; n < ssize; n++) if (s[n] != ' ' - && s[n] != '\t' && s[n] != '\n') { - r += s[n]; - } - s = r; -} - -/** - * Get tokens from char array of length n beginning at 'begin'. Tokens are - * delimited by character 'delim' (space by default), with the exception of - * text contained within forward slashes ('/'), which is treated literally. - * - * code - * vector tokens; - * char line[] = "a b/3.0 txt/ c /4.0 6/ d"; - * int n = strlen(line); - * getTokens(line, n, tokens); - * for (int i = 0; i < tokens.size(); i++) cout << tokens[i] << endl; - * endcode - * - */ - -void getTokens(std::string& s, int n, std::vector& toks, char delim) -{ - string::iterator q, p = s.begin(), end = p + n; - vector tokk; - int inslash = -1; - - //p = begin; - while (1 > 0) { - for (; p < end; p++) { - if (*p != delim) { - break; - } - } - q = p; - for (; q < end; q++) { - if (*q == '/') { - inslash *= -1; - } - if (inslash < 0 && *q == delim) { - break; - } - } - if (p != q) { - tokk.push_back(s.substr(p - s.begin(), q - p)); - } - p = q; - if (p == end) { - break; - } - } - - toks.clear(); - int nt = static_cast(tokk.size()); - string t = ""; - for (int i = 0; i < nt; i++) { - if (tokk[i][0] == '/') { - t += tokk[i]; - } else { - if (t != "") { - toks.push_back(t); - } - t = tokk[i]; - } - } - if (t != "") { - toks.push_back(t); - } -} - - -/** - * Look for a slash-delimited number in string s, - * and if found set v to the numerical value, and - * set s to the portion of the string before the - * first slash. Return true if slash data found, - * false otherwise. - */ -bool extractSlashData(std::string& s, std::string& name, std::string& data) -{ - int slen = static_cast(s.size()); - string::size_type n = s.find_first_of("/"); - if (n != string::npos && (static_cast(n) < slen)) { - int m; - for (m = static_cast(n)+1; m < slen; m++) if (s[m] == '/') { - break; - } - if (m < slen) { - data = s.substr(n+1,m-n-1); - name = s.substr(0,n); - removeWhiteSpace(name); - s = s.substr(m+1,1000); - return true; - } else { - name = s; - removeWhiteSpace(name); - data = ""; - s = ""; - return false; - } - } else { - name = s; - removeWhiteSpace(name); - data = ""; - s = ""; - return false; - } -} - -/** - * Return a modified version of string word, in which - * the first letter is upper case, and the rest are - * lower case. - */ -string capitalize(const std::string& word) -{ - string cap = word; - int n = static_cast(word.size()); - if (n > 0) { - cap[0] = (char) toupper(word[0]); - for (int m = 1; m < n; m++) { - cap[m] = (char) tolower(word[m]); - } - } - return cap; -} - -} - diff --git a/src/converters/ckr_utils.h b/src/converters/ckr_utils.h deleted file mode 100644 index 019020cdd..000000000 --- a/src/converters/ckr_utils.h +++ /dev/null @@ -1,163 +0,0 @@ -/** - * @file ckr_utils.h - * - */ - -// Copyright 2001 California Institute of Technology - -#ifndef CKR_UTILS_H -#define CKR_UTILS_H - -#include -#include -#include -#include - -namespace ckr -{ - -/** - * Fill vector 'keys' with the keys of map 'mp' - */ -template -void getMapKeys(const std::map& mp, std::vector& keys) -{ - keys.clear(); - typename std::map::const_iterator i = mp.begin(); - for (; i != mp.end(); ++i) { - keys.push_back(i->first); - } -} - - -/** - * Fill vector 'values' with the values of map 'mp' - */ -template -void getMapValues(const std::map& mp, std::vector& values) -{ - values.clear(); - typename std::map::const_iterator i = mp.begin(); - for (; i != mp.end(); ++i) { - values.push_back(i->second); - } -} - - -/** - * - * Template to compare two objects a and b, possibly of different - * types, and return the greater of the two, converted to the type of - * a. The '<' operator is used for the comparison, and must be - * defined for the two types in question. - * - */ - -template -inline T max(T a, S b) -{ - return (a < b ? b : a); -} - - - -/** - * - * Template to compare two objects a and b, possibly of different - * types, and * return the lesser of the two, converted to the type - * of a. The '<' operator is used for the comparison, and must be - * defined for the two types in question. - * - */ - -template -inline T min(T a, S b) -{ - return (a < b ? a : b); -} - - -/** - * Template to return a string equal to s, but padded with spaces on - * the right as necessary to make the length n. - */ -template -inline S pad(const S& s, size_t n) -{ - S output; - output.resize(max(n,s.size()),' '); - copy(s.begin(), s.end(), output.begin()); - return output; -} - -/// Absolute value. -template -inline T absval(T x) -{ - if (x < 0) { - return -x; - } - return x; -} - -/** - * - * Iterate through a list of objects that have a numeric member named - * 'valid', and return false if for any object this attribute is not - * greater than 0. Otherwise return true. - * - */ - -template -inline bool valid(L& list) -{ - size_t i; - for (i=0; i < list.size(); i++) if (list[i].valid <= 0) { - return false; - } - return true; -} - - -/// Remove all white space from string s. -void removeWhiteSpace(std::string& s); - -void getTokens(std::string& begin, - int n, std::vector& toks, char delim=' '); - - -/** - * Perform a case-insensitive comparison of the first n2 characters - * of strings s1 and s2, where n2 is the length of s2. Typically, s1 - * is an unknown string and s2 is the significant portion of a - * keyword. Returns true if a match is found, false otherwise. An asterisk - * in string s2 matches any character at that position. - * - * Example: if s1 = "elements", then match(s1, "ELEM") would return true. - */ -bool match(const std::string& s1, const std::string& s2); - -/** - * Check whether string 'word' begins with a Chemkin keyword. - */ -inline bool isKeyword(std::string word) -{ - return (match(word, "ELEM") || - match(word, "SPEC") || - match(word, "THERM") || - match(word, "REAC") || - match(word, "END")); -} - - -bool extractSlashData(std::string& s, std::string& name, std::string& data); -std::string capitalize(const std::string& word); - -} - -#endif - - - - - diff --git a/src/converters/newThermoReading.txt b/src/converters/newThermoReading.txt deleted file mode 100644 index 23fefb835..000000000 --- a/src/converters/newThermoReading.txt +++ /dev/null @@ -1,12 +0,0 @@ - - - -Currently, we will branch off of the therm keyword's argument list: -The default is to assume the old thermo file format: - -therm NASA -therm - -The new file format is signaled by the following line - -therm NASA9 diff --git a/src/converters/thermoFunctions.cpp b/src/converters/thermoFunctions.cpp deleted file mode 100644 index 20e50825e..000000000 --- a/src/converters/thermoFunctions.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/** - * @file thermoFunctions.cpp - * File containing thermo evaluation functions for NASA polynomials, - * which are used in testing the interpolations. - */ - -// Copyright 2001 California Institute of Technology - -#include -#include "thermoFunctions.h" -#include -using namespace std; - -namespace ckr -{ - -/** - * non-dimensional heat capacity (\f$ C_p/R \f$) at constant P for - * one species @param t temperature @param s species object - */ -double cp(double t, const Species& s) -{ - if (s.thermoFormatType == 1) { - const vector_fp* cpc; - int ireg = -1; - for (int i = 0; i < s.nTempRegions; i++) { - if (t <= s.maxTemps[i]) { - ireg = i; - break; - } - } - cpc = s.region_coeffs[ireg]; - const vector_fp& c = *cpc; - double cp0r = c[0]/(t*t) + c[1]/t + c[2] + c[3]*t + c[4]*t*t - + c[5]*t*t*t + c[6]*t*t*t*t; - return cp0r; - } - const vector_fp* cpc; - if (t > s.tmid) { - cpc = &s.highCoeffs; - } else { - cpc = &s.lowCoeffs; - } - const vector_fp& c = *cpc; - double cp0r = c[0] + c[1]*t + c[2]*t*t + c[3]*t*t*t + c[4]*t*t*t*t; - return cp0r; -} - - - -/** - * enthalpy in Kelvin (\f$ H/R \f$) for - * one species. @param t temperature @param s species object - */ -double enthalpy(double t, const Species& s) -{ - if (s.thermoFormatType == 1) { - const vector_fp* cpc; - int ireg = -1; - for (int i = 0; i < s.nTempRegions; i++) { - if (t <= s.maxTemps[i]) { - ireg = i; - break; - } - } - cpc = s.region_coeffs[ireg]; - const vector_fp& c = *cpc; - double h0rt = -c[0]/(t*t) + c[1]*log(t)/t - + c[2] + 0.5*c[3]*t + c[4]*t*t/3.0 + 0.25*c[5]*t*t*t - + 0.2*c[6]*t*t*t*t + c[7]/t; - return t*h0rt; - } - const vector_fp* cp; - if (t > s.tmid) { - cp = &s.highCoeffs; - } else { - cp = &s.lowCoeffs; - } - const vector_fp& c = *cp; - double h0rt = c[0] + 0.5*c[1]*t + c[2]*t*t/3.0 + 0.25*c[3]*t*t*t - + 0.2*c[4]*t*t*t*t + c[5]/t; - return t*h0rt; -} - - -/** - * non-dimensional entropy (\f$ S/R \f$) for - * one species @param t temperature @param s species object - */ -double entropy(double t, const Species& s) -{ - if (s.thermoFormatType == 1) { - const vector_fp* cpc; - int ireg = -1; - for (int i = 0; i < s.nTempRegions; i++) { - if (t <= s.maxTemps[i]) { - ireg = i; - break; - } - } - cpc = s.region_coeffs[ireg]; - const vector_fp& c = *cpc; - double s0r = -0.5*c[0]/(t*t) - c[1]/t - + c[2]*log(t) + c[3]*t + 0.5*c[4]*t*t + c[5]*t*t*t/3.0 - + 0.25*c[6]*t*t*t*t + c[8]; - return t*s0r; - } - const vector_fp* cp; - if (t > s.tmid) { - cp = &s.highCoeffs; - } else { - cp = &s.lowCoeffs; - } - const vector_fp& c = *cp; - double s0r = c[0]*log(t) + c[1]*t + 0.5*c[2]*t*t + c[3]*t*t*t/3.0 - + 0.25*c[4]*t*t*t*t + c[6]; - return t*s0r; -} - -/** - * Gibbs function in Kelvin (\f$ G/R \f$) for - * one species. @param t temperature @param s species object - */ -double gibbs(double t, const Species& s) -{ - if (s.thermoFormatType == 1) { - double s0r = entropy(t, s); - double h0r = enthalpy(t, s); - return (h0r - s0r * t); - } - const vector_fp* cp; - if (t > s.tmid) { - cp = &s.highCoeffs; - } else { - cp = &s.lowCoeffs; - } - const vector_fp& c = *cp; - double h0rt = c[0] + 0.5*c[1]*t + c[2]*t*t/3.0 + 0.25*c[3]*t*t*t - + 0.2*c[4]*t*t*t*t + c[5]/t; - double s0r = c[0]*log(t) + c[1]*t + 0.5*c[2]*t*t + c[3]*t*t*t/3.0 - + 0.25*c[4]*t*t*t*t + c[6]; - return t*(h0rt - s0r); -} - -} - diff --git a/src/converters/thermoFunctions.h b/src/converters/thermoFunctions.h deleted file mode 100644 index 607150330..000000000 --- a/src/converters/thermoFunctions.h +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @file thermoFunctions.h - * - * Thermodynamic properties. Note that these functions are used only - * for validation purposes by CKReader. They are not used by Cantera. - */ - -// Copyright 2001 California Institute of Technology - -#ifndef CKR_THERMOFUNCTIONS_H -#define CKR_THERMOFUNCTIONS_H - -#include "Species.h" - -namespace ckr -{ - -double enthalpy(double t, const Species& s); -double cp(double t, const Species& s); -double entropy(double t, const Species& s); -double gibbs(double t, const Species& s); - -} - -#endif - diff --git a/src/converters/writelog.cpp b/src/converters/writelog.cpp deleted file mode 100644 index 69a53342e..000000000 --- a/src/converters/writelog.cpp +++ /dev/null @@ -1,282 +0,0 @@ -/** - * @file converters/writelog.cpp - * - */ - -// Copyright 2001 California Institute of Technology - -#include -#include "writelog.h" - -using namespace std; - -namespace ckr -{ - - -/// format a string for the log file message printed when starting a new task -string newTask(std::string msg) -{ - string s = "\n"; - s += msg + "...\n"; - return s; -} - - -/// print the falloff parameters for a pressure-dependent reaction -bool writeFalloff(int type, const vector_fp& c, std::ostream& log) -{ - - log.precision(6); - log.width(0); - log.flags(ios::uppercase); - - // bool ok = true; - switch (type) { - - case Lindemann: - log << " Lindemann falloff function" << endl; - return true; - - case Troe: - log << " Troe falloff function: " << endl; - if (c.size() == 3) { - log << " alpha, T***, T* = (" << c[0] << ", " << c[1] - << ", " << c[2] << ")" << endl; - } else if (c.size() == 4) { - log << " alpha, T***, T*, T** = (" << c[0] << ", " << c[1] - << ", " << c[2] << ", " << c[3] << ")" << endl; - } else { - for (size_t n = 0; n < c.size(); n++) { - log << c[n] << ", "; - log << endl; - } - log << "###### ERROR ##### incorrect number of parameters" << endl; - return false; - } - return true; - - case SRI: - log << " SRI falloff function: " << endl; - if (c.size() == 3) { - log << " a, b, c = (" << c[0] << ", " << c[1] - << ", " << c[2] << ")" << endl; - } else if (c.size() == 5) { - log << " a, b, c, d, e = (" << c[0] << ", " << c[1] - << ", " << c[2] << ", " << c[3] << ", " << c[4] - << ")" << endl; - } else { - for (size_t n = 0; n < c.size(); n++) { - log << c[n] << ", "; - log << endl; - } - log << "##### ERROR ##### incorrect number of parameters" << endl; - return false; - } - return true; - - default: - log << "unknown falloff type: " << type << endl; - return false; - } -} - - -/// print the rate coefficient parameters -bool writeRateCoeff(const RateCoeff& k, std::ostream& log) -{ - log.precision(10); - log.width(0); - log.flags(ios::uppercase); - - bool ok = true; - size_t nb; - - switch (k.type) { - - case Arrhenius: - log <<" A, n, E = (" << k.A << ", " << k.n - << ", " << k.E << ")" << endl; - break; - - case LandauTeller: - log << "A, n, E, B, C = (" << k.A << ", " << k.n - << ", " << k.E << ", " << k.B << ", " << k.C - << ") *** Landau-Teller ***" << endl; - break; - - case Jan: - log <<" A, n, E = (" << k.A << ", " << k.n - << ", " << k.E << ") *** JAN *** " << endl; - nb = k.b.size(); - for (size_t n = 0; n < nb; n++) { - log << " b" << n+1 << ": " << k.b[n] << endl; - } - if (nb != 9) log - << "warning: number of b coefficients should be 9." - << endl; - break; - - case Fit1: - log <<" A, n, E = (" << k.A << ", " << k.n - << ", " << k.E << ") *** FIT1 *** " << endl; - nb = k.b.size(); - for (size_t n = 0; n < nb; n++) { - log << " b" << n+1 << ": " << k.b[n] << endl; - } - if (nb != 9) log - << "warning: number of b coefficients should be 4." - << endl; - break; - - default: - log << "unknown rate coefficient type: " << k.type << endl; - ok = false; - } - return ok; -} - -/** - * Write onto an output stream the chemical equation for a reaction. - */ -void printReactionEquation(std::ostream& f, const Reaction& r) -{ - // r.write(f); - f << reactionEquation(r); -} - - -/** - * Write to a string the chemical equation for a reaction. - */ -string reactionEquation(const Reaction& r) -{ - string s = ""; - int nr = static_cast(r.reactants.size()); - int np = static_cast(r.products.size()); - int k; - double m; - char buf[20]; - - for (k = 0; k < nr; k++) { - m = r.reactants[k].number; - if (m != 1.0) { - sprintf(buf,"%g",m); - s += string(buf); - s += " "; - } - s += r.reactants[k].name; - if (k < nr - 1) { - s += " + "; - } - } - - if (r.isFalloffRxn) { - s += " (+ " + r.thirdBody + ")"; - } else if (r.isThreeBodyRxn) { - s += " + " + r.thirdBody; - } - if (r.isReversible) { - s += " <=> "; - } else { - s += " => "; - } - - for (k = 0; k < np; k++) { - m = r.products[k].number; - if (m != 1.0) { - sprintf(buf,"%g",m); - s += string(buf); - s += " "; - } - s += r.products[k].name; - if (k < np - 1) { - s += " + "; - } - } - if (r.isFalloffRxn) { - s += " (+ " + r.thirdBody + ")"; - } else if (r.isThreeBodyRxn) { - s += " + " + r.thirdBody; - } - return s; -} - - - -/** - * - * Write a summary of the properties of one species to the log file. - * @param log log file output stream - * @param spec instance of Species class - */ - -void writeSpeciesData(std::ostream& log, const Species& spec) -{ - - if (!spec.id.empty()) { - log << endl << " id/date: " << spec.id << endl; - } else { - log << " ... " << endl; - } - - log << " phase: " - << spec.phase << endl - << " composition: ("; - - for (size_t ie = 0; ie < spec.elements.size(); ie++) { - if (!spec.elements[ie].name.empty()) { - log.flags(ios::fixed); - log.precision(0); - if (ie > 0) { - log << ", "; - } - log << spec.elements[ie].number << " " - << spec.elements[ie].name; - } - } - log << ")"; - - if (spec.thermoFormatType == 0) { - log.flags(ios::showpoint | ios::fixed); - log.precision(2); - log << endl << " Tlow, Tmid, Thigh: (" << spec.tlow << ", " << - spec.tmid << ", " << spec.thigh << ")" << endl << endl; - log << " coefficients (low, high):" << endl; - log.flags(ios::scientific | ios::uppercase | ios::internal); - log.precision(8); - for (int j = 0; j < 7; j++) { - log << " a" << j + 1; - log.setf(ios::showpos); - log << " \t" << spec.lowCoeffs[j] - << " \t" << spec.highCoeffs[j] << endl; - log.unsetf(ios::showpos); - } - log << endl; - } else if (spec.thermoFormatType == 1) { - log.flags(ios::showpoint | ios::fixed); - log.precision(2); - log << endl; - log << "Number of temp regions = " << spec.nTempRegions << endl; - for (int i = 0; i < spec.nTempRegions; i++) { - log << " Tlow, Thigh: (" << spec.minTemps[i] << ", " - << spec.maxTemps[i] << ")" << endl << endl; - log << " coefficients :" << endl; - log.flags(ios::scientific | ios::uppercase | ios::internal); - log.precision(8); - vector_fp& cc = *spec.region_coeffs[i]; - for (int j = 0; j < 9; j++) { - log << " a" << j + 1; - log.setf(ios::showpos); - log << " \t" << cc[j] << endl; - log.unsetf(ios::showpos); - } - log << endl; - } - } -} - - -} - - diff --git a/src/converters/writelog.h b/src/converters/writelog.h deleted file mode 100644 index c924d39f7..000000000 --- a/src/converters/writelog.h +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @file writelog.h - * - */ - -// Copyright 2001 California Institute of Technology - - -#ifndef CKR_WRITELOG_H -#define CKR_WRITELOG_H - -#include -#include -#include - -#include "Species.h" -#include "Reaction.h" - - -namespace ckr -{ -std::string newTask(std::string msg); -bool writeFalloff(int type, const vector_fp& c, std::ostream& log); -bool writeRateCoeff(const RateCoeff& k, std::ostream& log); -void printReactionEquation(std::ostream& f, const Reaction& r); -void writeSpeciesData(std::ostream& log, const Species& spec); -std::string reactionEquation(const Reaction& r); -} - -#endif diff --git a/src/fortran/Makefile.am b/src/fortran/Makefile.am index 4aee94d08..28aa444b8 100644 --- a/src/fortran/Makefile.am +++ b/src/fortran/Makefile.am @@ -12,7 +12,7 @@ AM_CXXFLAGS = $(AM_CPPFLAGS) AM_FCFLAGS = $(AM_CPPFLAGS) LINK = -luser -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lctcxx -lm -lctf2c -lstdc++ AM_LDFLAGS = -L$(top_builddir)/build/lib/ diff --git a/test_problems/.gitignore b/test_problems/.gitignore index 7a310d61c..f64eb548a 100644 --- a/test_problems/.gitignore +++ b/test_problems/.gitignore @@ -2,7 +2,6 @@ *_output.txt *_output.csv *_output.out -ck2cti.log ChemEquil_gri_matrix/gri_matrix ChemEquil_gri_pairs/gri_pairs ChemEquil_ionizedGas/ionizedGasEquil @@ -39,8 +38,6 @@ cathermo/testIAPWSTripP/testIAPWSTripP cathermo/testWaterPDSS/testWaterPDSS cathermo/testWaterTP/testWaterSSTP cathermo/wtWater/wtWater -ck2cti_test/gri30.cti -ck2cti_test/soot.cti cxx_ex/cxx_examples cxx_ex/eq1.csv cxx_ex/eq1.dat @@ -59,7 +56,6 @@ diamondSurf/runDiamond fracCoeff/fracCoeff mixGasTransport/mixGasTransport multiGasTransport/multiGasTransport -nasa9_reader/sample.cti negATest/negATest negATest/noxNeg.xml printUtilUnitTest/pUtest diff --git a/test_problems/ChemEquil_gri_matrix/Makefile.am b/test_problems/ChemEquil_gri_matrix/Makefile.am index bc871a16c..36f96e31f 100644 --- a/test_problems/ChemEquil_gri_matrix/Makefile.am +++ b/test_problems/ChemEquil_gri_matrix/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lctf2c -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/ChemEquil_gri_pairs/Makefile.am b/test_problems/ChemEquil_gri_pairs/Makefile.am index 59a7fcd3c..e239e762b 100644 --- a/test_problems/ChemEquil_gri_pairs/Makefile.am +++ b/test_problems/ChemEquil_gri_pairs/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lctf2c -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/ChemEquil_ionizedGas/Makefile.am b/test_problems/ChemEquil_ionizedGas/Makefile.am index 3979a960b..40bce3aac 100644 --- a/test_problems/ChemEquil_ionizedGas/Makefile.am +++ b/test_problems/ChemEquil_ionizedGas/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lctf2c -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/ChemEquil_red1/Makefile.am b/test_problems/ChemEquil_red1/Makefile.am index 296369bb2..1c7808e1c 100644 --- a/test_problems/ChemEquil_red1/Makefile.am +++ b/test_problems/ChemEquil_red1/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lctf2c -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/CpJump/Makefile.am b/test_problems/CpJump/Makefile.am index ac14d60b4..c6a566f7a 100644 --- a/test_problems/CpJump/Makefile.am +++ b/test_problems/CpJump/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lctf2c -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/Makefile.am b/test_problems/Makefile.am index e2c60cdb4..4dc91ad3c 100644 --- a/test_problems/Makefile.am +++ b/test_problems/Makefile.am @@ -9,8 +9,6 @@ SUBDIRS += VCSnonideal PecosTransport #f77test # skipped (uses ck2cti or python): -# ck2cti_test -# nasa9_reader (uses ck2cti) # python # rankine_democxx # VCSnonideal (unsure of problem) diff --git a/test_problems/NASA9poly_test/Makefile.am b/test_problems/NASA9poly_test/Makefile.am index 69f82436f..3257d83ad 100644 --- a/test_problems/NASA9poly_test/Makefile.am +++ b/test_problems/NASA9poly_test/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lctf2c -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/PecosTransport/Makefile.am b/test_problems/PecosTransport/Makefile.am index bce509f43..ed9f321fe 100644 --- a/test_problems/PecosTransport/Makefile.am +++ b/test_problems/PecosTransport/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/VCSnonideal/NaCl_equil/Makefile.am b/test_problems/VCSnonideal/NaCl_equil/Makefile.am index 8906088b8..6d1ba9670 100644 --- a/test_problems/VCSnonideal/NaCl_equil/Makefile.am +++ b/test_problems/VCSnonideal/NaCl_equil/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -luser -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lctcxx -lm -lctf2c -lstdc++ AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/VPsilane_test/Makefile.am b/test_problems/VPsilane_test/Makefile.am index 1d2aa7484..f297cc3e7 100644 --- a/test_problems/VPsilane_test/Makefile.am +++ b/test_problems/VPsilane_test/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lctf2c -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/cathermo/DH_graph_1/Makefile.am b/test_problems/cathermo/DH_graph_1/Makefile.am index 356b84ab2..f05c35c16 100644 --- a/test_problems/cathermo/DH_graph_1/Makefile.am +++ b/test_problems/cathermo/DH_graph_1/Makefile.am @@ -4,7 +4,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -lexecstream -pthread #-lctcxx -luser AM_LDFLAGS = -L$(top_builddir)/build/lib/ diff --git a/test_problems/cathermo/HMW_dupl_test/Makefile.am b/test_problems/cathermo/HMW_dupl_test/Makefile.am index 21d05a4cd..8d8685f78 100644 --- a/test_problems/cathermo/HMW_dupl_test/Makefile.am +++ b/test_problems/cathermo/HMW_dupl_test/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/cathermo/HMW_graph_CpvT/Makefile.am b/test_problems/cathermo/HMW_graph_CpvT/Makefile.am index 14472b93c..d0fcd6e04 100644 --- a/test_problems/cathermo/HMW_graph_CpvT/Makefile.am +++ b/test_problems/cathermo/HMW_graph_CpvT/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/cathermo/HMW_graph_GvI/Makefile.am b/test_problems/cathermo/HMW_graph_GvI/Makefile.am index 2d305e8d3..aa65ffeb6 100644 --- a/test_problems/cathermo/HMW_graph_GvI/Makefile.am +++ b/test_problems/cathermo/HMW_graph_GvI/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/cathermo/HMW_graph_GvT/Makefile.am b/test_problems/cathermo/HMW_graph_GvT/Makefile.am index b1258ee1b..f67391227 100644 --- a/test_problems/cathermo/HMW_graph_GvT/Makefile.am +++ b/test_problems/cathermo/HMW_graph_GvT/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/cathermo/HMW_graph_HvT/Makefile.am b/test_problems/cathermo/HMW_graph_HvT/Makefile.am index 6f19f735f..9bd88964d 100644 --- a/test_problems/cathermo/HMW_graph_HvT/Makefile.am +++ b/test_problems/cathermo/HMW_graph_HvT/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/cathermo/HMW_graph_VvT/Makefile.am b/test_problems/cathermo/HMW_graph_VvT/Makefile.am index 190cc2084..223f735f5 100644 --- a/test_problems/cathermo/HMW_graph_VvT/Makefile.am +++ b/test_problems/cathermo/HMW_graph_VvT/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -lexecstream -pthread LIBS = $(LINK) AM_LDFLAGS = -L$(top_builddir)/build/lib/ diff --git a/test_problems/cathermo/HMW_test_1/Makefile.am b/test_problems/cathermo/HMW_test_1/Makefile.am index a89927b47..4f68701ec 100644 --- a/test_problems/cathermo/HMW_test_1/Makefile.am +++ b/test_problems/cathermo/HMW_test_1/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/cathermo/HMW_test_3/Makefile.am b/test_problems/cathermo/HMW_test_3/Makefile.am index ddbf0af6a..ddf4e2e27 100644 --- a/test_problems/cathermo/HMW_test_3/Makefile.am +++ b/test_problems/cathermo/HMW_test_3/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/cathermo/VPissp/Makefile.am b/test_problems/cathermo/VPissp/Makefile.am index c96332fff..15c24b081 100644 --- a/test_problems/cathermo/VPissp/Makefile.am +++ b/test_problems/cathermo/VPissp/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/cathermo/ims/Makefile.am b/test_problems/cathermo/ims/Makefile.am index 0c0d9e854..9afce991b 100644 --- a/test_problems/cathermo/ims/Makefile.am +++ b/test_problems/cathermo/ims/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/cathermo/issp/Makefile.am b/test_problems/cathermo/issp/Makefile.am index c96332fff..15c24b081 100644 --- a/test_problems/cathermo/issp/Makefile.am +++ b/test_problems/cathermo/issp/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/cathermo/stoichSubSSTP/Makefile.am b/test_problems/cathermo/stoichSubSSTP/Makefile.am index e292c26eb..131963f84 100644 --- a/test_problems/cathermo/stoichSubSSTP/Makefile.am +++ b/test_problems/cathermo/stoichSubSSTP/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/cathermo/testIAPWS/Makefile.am b/test_problems/cathermo/testIAPWS/Makefile.am index 18c5a659a..f3bc9c83c 100644 --- a/test_problems/cathermo/testIAPWS/Makefile.am +++ b/test_problems/cathermo/testIAPWS/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/cathermo/testIAPWSPres/Makefile.am b/test_problems/cathermo/testIAPWSPres/Makefile.am index 6c9393a0c..1e3da33fd 100644 --- a/test_problems/cathermo/testIAPWSPres/Makefile.am +++ b/test_problems/cathermo/testIAPWSPres/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/cathermo/testIAPWSTripP/Makefile.am b/test_problems/cathermo/testIAPWSTripP/Makefile.am index aa681f1f8..595dfe03f 100644 --- a/test_problems/cathermo/testIAPWSTripP/Makefile.am +++ b/test_problems/cathermo/testIAPWSTripP/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/cathermo/testWaterPDSS/Makefile.am b/test_problems/cathermo/testWaterPDSS/Makefile.am index 3b6e34350..7058cda88 100644 --- a/test_problems/cathermo/testWaterPDSS/Makefile.am +++ b/test_problems/cathermo/testWaterPDSS/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/cathermo/testWaterTP/Makefile.am b/test_problems/cathermo/testWaterTP/Makefile.am index 4a3bd966a..22147d819 100644 --- a/test_problems/cathermo/testWaterTP/Makefile.am +++ b/test_problems/cathermo/testWaterTP/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/cathermo/wtWater/Makefile.am b/test_problems/cathermo/wtWater/Makefile.am index bc505aa50..e8a380517 100644 --- a/test_problems/cathermo/wtWater/Makefile.am +++ b/test_problems/cathermo/wtWater/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/diamondSurf/Makefile.am b/test_problems/diamondSurf/Makefile.am index c40cf2500..a74efaef1 100644 --- a/test_problems/diamondSurf/Makefile.am +++ b/test_problems/diamondSurf/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lctf2c -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/diamondSurf_dupl/Makefile.am b/test_problems/diamondSurf_dupl/Makefile.am index c77c28bbb..54fb6c1dc 100644 --- a/test_problems/diamondSurf_dupl/Makefile.am +++ b/test_problems/diamondSurf_dupl/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lctf2c -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/fracCoeff/Makefile.am b/test_problems/fracCoeff/Makefile.am index ca7da8865..ecde56f51 100644 --- a/test_problems/fracCoeff/Makefile.am +++ b/test_problems/fracCoeff/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lctf2c -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/mixGasTransport/Makefile.am b/test_problems/mixGasTransport/Makefile.am index a5c5e7b2d..451bc70f8 100644 --- a/test_problems/mixGasTransport/Makefile.am +++ b/test_problems/mixGasTransport/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/multiGasTransport/Makefile.am b/test_problems/multiGasTransport/Makefile.am index 4e678025f..282ad9cba 100644 --- a/test_problems/multiGasTransport/Makefile.am +++ b/test_problems/multiGasTransport/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lctf2c -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/negATest/Makefile.am b/test_problems/negATest/Makefile.am index 2a990d12b..f1c0e7e80 100644 --- a/test_problems/negATest/Makefile.am +++ b/test_problems/negATest/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/printUtilUnitTest/Makefile.am b/test_problems/printUtilUnitTest/Makefile.am index dd5e83dfd..52eed7040 100644 --- a/test_problems/printUtilUnitTest/Makefile.am +++ b/test_problems/printUtilUnitTest/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lctf2c -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/pureFluidTest/Makefile.am b/test_problems/pureFluidTest/Makefile.am index eabf78729..47ad20c72 100644 --- a/test_problems/pureFluidTest/Makefile.am +++ b/test_problems/pureFluidTest/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lctf2c -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/rankine_democxx/Makefile.am b/test_problems/rankine_democxx/Makefile.am index 2c6362af4..bbf9a47a3 100644 --- a/test_problems/rankine_democxx/Makefile.am +++ b/test_problems/rankine_democxx/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -luser -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lctcxx -lm -lctf2c -lstdc++ AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/silane_equil/Makefile.am b/test_problems/silane_equil/Makefile.am index 6b7eefb7e..461f79948 100644 --- a/test_problems/silane_equil/Makefile.am +++ b/test_problems/silane_equil/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lctf2c -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/spectroscopy/Makefile.am b/test_problems/spectroscopy/Makefile.am index 7e363a29d..8807901ff 100644 --- a/test_problems/spectroscopy/Makefile.am +++ b/test_problems/spectroscopy/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lctf2c -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/statmech/Makefile.am b/test_problems/statmech/Makefile.am index 15f633965..e72774e5b 100644 --- a/test_problems/statmech/Makefile.am +++ b/test_problems/statmech/Makefile.am @@ -3,7 +3,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lctf2c -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/surfSolverTest/Makefile.am b/test_problems/surfSolverTest/Makefile.am index 4f314ff6d..cc061c9f1 100644 --- a/test_problems/surfSolverTest/Makefile.am +++ b/test_problems/surfSolverTest/Makefile.am @@ -6,7 +6,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lctf2c -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK) diff --git a/test_problems/surfkin/Makefile.am b/test_problems/surfkin/Makefile.am index 86269dc20..c4b817b01 100644 --- a/test_problems/surfkin/Makefile.am +++ b/test_problems/surfkin/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(INC) AM_CXXFLAGS = $(AM_CPPFLAGS) LINK = -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lctbase -lcvode LINK += -lctlapack -lctblas -lctf2c -lm -lctf2c -lstdc++ -lexecstream -pthread AM_LDFLAGS = -L$(top_builddir)/build/lib/ LIBS = $(LINK)