diff --git a/doc/doxygen/demo1a.cpp b/doc/doxygen/demo1a.cpp index d8f0a6ae6..bde08e4a6 100644 --- a/doc/doxygen/demo1a.cpp +++ b/doc/doxygen/demo1a.cpp @@ -17,7 +17,7 @@ void simple_demo() gas->setState_TPX(500.0, 2.0*OneAtm, "H2O:1.0, H2:8.0, AR:1.0"); // Print a summary report of the state of the gas - std::cout << report(*gas) << std::endl; + std::cout << gas->report() << std::endl; // Clean up delete gas; diff --git a/doc/doxygen/demoequil.cpp b/doc/doxygen/demoequil.cpp index fbb743786..20f1b38d7 100644 --- a/doc/doxygen/demoequil.cpp +++ b/doc/doxygen/demoequil.cpp @@ -8,7 +8,7 @@ void equil_demo() ThermoPhase* gas = newPhase("h2o2.cti","ohmech"); gas->setState_TPX(1500.0, 2.0*OneAtm, "O2:1.0, H2:3.0, AR:1.0"); equilibrate(*gas, "TP"); - std::cout << report(*gas) << std::endl; + std::cout << gas->report() << std::endl; } int main() diff --git a/include/cantera/equil/MultiPhase.h b/include/cantera/equil/MultiPhase.h index 74dfb7c7f..8849527e2 100644 --- a/include/cantera/equil/MultiPhase.h +++ b/include/cantera/equil/MultiPhase.h @@ -732,7 +732,7 @@ inline std::ostream& operator<<(std::ostream& s, Cantera::MultiPhase& x) } s << "Moles: " << x.phaseMoles(ip) << std::endl; - s << report(x.phase(ip)) << std::endl; + s << x.phase(ip).report() << std::endl; } return s; } diff --git a/include/cantera/thermo/ThermoPhase.h b/include/cantera/thermo/ThermoPhase.h index 65c7f7c48..2e199e8c0 100644 --- a/include/cantera/thermo/ThermoPhase.h +++ b/include/cantera/thermo/ThermoPhase.h @@ -1679,9 +1679,9 @@ typedef ThermoPhase thermo_t; * of the phase should be written out * * @return Returns a string containing the report + * @deprecated use "th.report(show_thermo)" instead */ - -std::string report(const ThermoPhase& th, const bool show_thermo = true); +DEPRECATED(std::string report(const ThermoPhase& th, const bool show_thermo = true)); } diff --git a/src/clib/ct.cpp b/src/clib/ct.cpp index adcb95d51..436a18206 100644 --- a/src/clib/ct.cpp +++ b/src/clib/ct.cpp @@ -95,12 +95,6 @@ static double pfprop(int n, int i, double v=0.0, double x=0.0) } #endif - -namespace Cantera -{ -void writephase(const ThermoPhase& th, bool show_thermo); -} - /** * Exported functions. */ @@ -1351,7 +1345,7 @@ extern "C" { { try { bool stherm = (show_thermo != 0); - string s = report(ThermoCabinet::item(nth), stherm); + string s = ThermoCabinet::item(nth).report(stherm); if (int(s.size()) > ibuf - 1) { return -(static_cast(s.size()) + 1); } @@ -1367,7 +1361,7 @@ extern "C" { { try { bool stherm = (show_thermo != 0); - writephase(ThermoCabinet::item(nth), stherm); + writelog(ThermoCabinet::item(nth).report(stherm)+"\n"); return 0; } catch (...) { return handleAllExceptions(-1, ERR); diff --git a/src/fortran/fct.cpp b/src/fortran/fct.cpp index c63ff382c..edd4f22e4 100644 --- a/src/fortran/fct.cpp +++ b/src/fortran/fct.cpp @@ -899,7 +899,7 @@ extern "C" { { try { bool stherm = (*show_thermo != 0); - std::string s = report(*_fth(nth), stherm); + std::string s = _fth(nth)->report(stherm); if (int(s.size()) > buflen - 1) { return -(s.size() + 1); } diff --git a/src/thermo/ThermoPhase.cpp b/src/thermo/ThermoPhase.cpp index 38c76ce59..3eb284185 100644 --- a/src/thermo/ThermoPhase.cpp +++ b/src/thermo/ThermoPhase.cpp @@ -1500,5 +1500,9 @@ void ThermoPhase::reportCSV(std::ofstream& csvFile) const } } +std::string report(const ThermoPhase& th, const bool show_thermo) +{ + return th.report(show_thermo); +} } diff --git a/src/thermo/phasereport.cpp b/src/thermo/phasereport.cpp deleted file mode 100644 index 370456036..000000000 --- a/src/thermo/phasereport.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @file phasereport.cpp - * Output routines for phases - */ - -// Copyright 2001 California Institute of Technology - -#include "cantera/thermo/ThermoPhase.h" -#include "cantera/thermo/PureFluidPhase.h" -#include "cantera/thermo/mix_defs.h" - -#include - -using namespace std; - -namespace Cantera -{ - -// Format a summary of the mixture state for output. -/* - * @param th ThermoPhase object to create a report about - * @param show_thermo Boolean indicating whether the thermo functions - * of the phase should be written out - * - * @return Returns a string containing the report - */ -std::string report(const ThermoPhase& th, const bool show_thermo) -{ - return th.report(show_thermo); -} - -//! Write a phase report to the screen device -/*! - * This routine is a wrapper around the report() function. - * It writes to the screen device. - * - * @param th ThermoPhase object to create a report about - * @param show_thermo Boolean indicating whether the thermo functions - * of the phase should be written out - */ -void writephase(const ThermoPhase& th, bool show_thermo) -{ - std::string s = report(th, show_thermo); - writelog(s+"\n"); -} - - - -} - - diff --git a/test_problems/ChemEquil_ionizedGas/ionizedGasEquil.cpp b/test_problems/ChemEquil_ionizedGas/ionizedGasEquil.cpp index 82915fdde..1417ff95f 100644 --- a/test_problems/ChemEquil_ionizedGas/ionizedGasEquil.cpp +++ b/test_problems/ChemEquil_ionizedGas/ionizedGasEquil.cpp @@ -57,7 +57,7 @@ int main(int argc, char** argv) beginLogGroup("topEquil", -1); equilibrate(*gas,"UV", -1); endLogGroup("topEquil"); - cout << report(*gas) << endl; + cout << gas->report() << endl; tkelvin = gas->temperature(); pres = gas->pressure(); diff --git a/test_problems/VPsilane_test/silane_equil.cpp b/test_problems/VPsilane_test/silane_equil.cpp index 10e4f401e..156c33c5f 100644 --- a/test_problems/VPsilane_test/silane_equil.cpp +++ b/test_problems/VPsilane_test/silane_equil.cpp @@ -25,7 +25,7 @@ int main(int argc, char** argv) //g.setState_TPX(1500.0, 1.0132E5, "SIH4:0.01, H2:0.99"); Cantera::ChemEquil_print_lvl = 40; equilibrate(*g, "TP"); - std::string r = Cantera::report(*g, true); + std::string r = g->report(true); cout << r; cout << endl; return 0;