From 79461c34e8078be7fb5b774baf8357dcc8f1accc Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Sat, 27 Sep 2014 00:09:11 +0000 Subject: [PATCH] [Thermo] Add default value for 'id' argument of 'newPhase' --- include/cantera/thermo/ThermoFactory.h | 2 +- test/thermo/MaskellSolidSolnPhase_Test.cpp | 2 +- test/thermo/ThermoPhase_Test.cpp | 2 +- test/thermo/phaseConstructors.cpp | 10 +++++----- test_problems/VCSnonideal/NaCl_equil/nacl_equil.cpp | 2 +- .../dustyGasTransport/dustyGasTransportTest.cpp | 2 +- .../stoichSolidKinetics/stoichSolidKinetics.cpp | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/cantera/thermo/ThermoFactory.h b/include/cantera/thermo/ThermoFactory.h index 226193703..5ea3e025d 100644 --- a/include/cantera/thermo/ThermoFactory.h +++ b/include/cantera/thermo/ThermoFactory.h @@ -161,7 +161,7 @@ ThermoPhase* newPhase(XML_Node& phase); * @return * Returns an initialized ThermoPhase object. */ -ThermoPhase* newPhase(const std::string& infile, std::string id); +ThermoPhase* newPhase(const std::string& infile, std::string id=""); //! Import a phase information into an empty thermophase object /*! diff --git a/test/thermo/MaskellSolidSolnPhase_Test.cpp b/test/thermo/MaskellSolidSolnPhase_Test.cpp index 59bd3dbcc..f170c23d4 100644 --- a/test/thermo/MaskellSolidSolnPhase_Test.cpp +++ b/test/thermo/MaskellSolidSolnPhase_Test.cpp @@ -19,7 +19,7 @@ public: void initializeTestPhaseWithXML(const std::string & filename) { - test_phase = newPhase(filename.c_str(), ""); + test_phase = newPhase(filename.c_str()); } void set_r(const double r) { diff --git a/test/thermo/ThermoPhase_Test.cpp b/test/thermo/ThermoPhase_Test.cpp index 08056861a..a092e1c90 100644 --- a/test/thermo/ThermoPhase_Test.cpp +++ b/test/thermo/ThermoPhase_Test.cpp @@ -51,7 +51,7 @@ class TestThermoMethods : public testing::Test public: ThermoPhase* thermo; TestThermoMethods() { - thermo = newPhase("h2o2.xml", ""); + thermo = newPhase("h2o2.xml"); } ~TestThermoMethods() { diff --git a/test/thermo/phaseConstructors.cpp b/test/thermo/phaseConstructors.cpp index 74081f0ac..db8ae529f 100644 --- a/test/thermo/phaseConstructors.cpp +++ b/test/thermo/phaseConstructors.cpp @@ -13,7 +13,7 @@ class FixedChemPotSstpConstructorTest : public testing::Test TEST_F(FixedChemPotSstpConstructorTest, fromXML) { - ThermoPhase* p = newPhase("../data/LiFixed.xml", ""); + ThermoPhase* p = newPhase("../data/LiFixed.xml"); ASSERT_EQ((int) p->nSpecies(), 1); double mu; p->getChemPotentials(&mu); @@ -51,15 +51,15 @@ public: }; TEST_F(CtiConversionTest, ExplicitConversion) { - p1 = newPhase("../data/air-no-reactions.xml", ""); + p1 = newPhase("../data/air-no-reactions.xml"); ctml::ct2ctml("../data/air-no-reactions.cti"); p2 = newPhase("air-no-reactions.xml", ""); compare(); } TEST_F(CtiConversionTest, ImplicitConversion) { - p1 = newPhase("../data/air-no-reactions.xml", ""); - p2 = newPhase("../data/air-no-reactions.cti", ""); + p1 = newPhase("../data/air-no-reactions.xml"); + p2 = newPhase("../data/air-no-reactions.cti"); compare(); } @@ -76,7 +76,7 @@ public: TEST_F(ChemkinConversionTest, ValidConversion) { copyInputFile("pdep-test.inp"); ctml::ck2cti("pdep-test.inp"); - ThermoPhase* p = newPhase("pdep-test.cti", ""); + ThermoPhase* p = newPhase("pdep-test.cti"); ASSERT_GT(p->temperature(), 0.0); } diff --git a/test_problems/VCSnonideal/NaCl_equil/nacl_equil.cpp b/test_problems/VCSnonideal/NaCl_equil/nacl_equil.cpp index 0ac704af3..b8f5e1eec 100644 --- a/test_problems/VCSnonideal/NaCl_equil/nacl_equil.cpp +++ b/test_problems/VCSnonideal/NaCl_equil/nacl_equil.cpp @@ -97,7 +97,7 @@ int main(int argc, char** argv) Xmol[iH2OL] = 1.0; hmw.setState_TPX(T, pres, DATA_PTR(Xmol)); - ThermoPhase* gas = newPhase("gas.xml", ""); + ThermoPhase* gas = newPhase("gas.xml"); kk = gas->nSpecies(); Xmol.resize(kk, 0.0); diff --git a/test_problems/dustyGasTransport/dustyGasTransportTest.cpp b/test_problems/dustyGasTransport/dustyGasTransportTest.cpp index 9b5a3aa9f..2c43051ab 100644 --- a/test_problems/dustyGasTransport/dustyGasTransportTest.cpp +++ b/test_problems/dustyGasTransport/dustyGasTransportTest.cpp @@ -13,7 +13,7 @@ int main(int argc, char** argv) try { int log_level = 0; - std::auto_ptr g(newPhase("h2o2.xml", "ohmech")); + std::auto_ptr g(newPhase("h2o2.xml")); auto_ptr tran(newTransportMgr("DustyGas", g.get(), log_level)); DustyGasTransport* tranDusty = dynamic_cast(tran.get()); diff --git a/test_problems/stoichSolidKinetics/stoichSolidKinetics.cpp b/test_problems/stoichSolidKinetics/stoichSolidKinetics.cpp index 3520b365e..2251f05bf 100644 --- a/test_problems/stoichSolidKinetics/stoichSolidKinetics.cpp +++ b/test_problems/stoichSolidKinetics/stoichSolidKinetics.cpp @@ -49,7 +49,7 @@ void testProblem() throw CanteraError("couldn't find file", ""); } std::auto_ptr surfTP(newPhase(*xg)); - std::auto_ptr gasTP(newPhase("gas.xml", "")); + std::auto_ptr gasTP(newPhase("gas.xml")); std::auto_ptr cao_s(newPhase("solidPhases.xml", "CaO(S)")); std::auto_ptr caco3_s(newPhase("solidPhases.xml", "CaCO3(S)"));