Deprecated the global "report(ThermoPhase&)" function
This commit is contained in:
parent
c440373aba
commit
312b7ff2c4
10 changed files with 14 additions and 67 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<int>(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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 <cstdio>
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue