Replace auto_ptr with unique_ptr
auto_ptr is deprecated in c++11
This commit is contained in:
parent
0b2c7b59b8
commit
e131766b71
10 changed files with 21 additions and 21 deletions
|
|
@ -4,7 +4,7 @@ using namespace Cantera;
|
|||
|
||||
void equil_demo()
|
||||
{
|
||||
std::auto_ptr<ThermoPhase> gas(newPhase("h2o2.cti","ohmech"));
|
||||
std::unique_ptr<ThermoPhase> gas(newPhase("h2o2.cti","ohmech"));
|
||||
gas->setState_TPX(1500.0, 2.0*OneAtm, "O2:1.0, H2:3.0, AR:1.0");
|
||||
gas->equilibrate("TP");
|
||||
std::cout << gas->report() << std::endl;
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ protected:
|
|||
*/
|
||||
size_t m_nComponents;
|
||||
|
||||
std::auto_ptr<PropertyCalculator<thermo_t> > m_p1, m_p2;
|
||||
std::unique_ptr<PropertyCalculator<thermo_t> > m_p1, m_p2;
|
||||
|
||||
/**
|
||||
* Current value of the mole fractions in the single phase.
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ void demoprog()
|
|||
|
||||
// create a transport manager for the gas that computes
|
||||
// mixture-averaged properties
|
||||
std::auto_ptr<Transport> tr(newTransportMgr("Mix", &gas, 1));
|
||||
std::unique_ptr<Transport> tr(newTransportMgr("Mix", &gas, 1));
|
||||
|
||||
// print the viscosity, thermal conductivity, and diffusion
|
||||
// coefficients
|
||||
|
|
|
|||
|
|
@ -84,8 +84,8 @@ int flamespeed(double phi)
|
|||
// specify the objects to use to compute kinetic rates and
|
||||
// transport properties
|
||||
|
||||
std::auto_ptr<Transport> trmix(newTransportMgr("Mix", &gas));
|
||||
std::auto_ptr<Transport> trmulti(newTransportMgr("Multi", &gas));
|
||||
std::unique_ptr<Transport> trmix(newTransportMgr("Mix", &gas));
|
||||
std::unique_ptr<Transport> trmulti(newTransportMgr("Multi", &gas));
|
||||
|
||||
flow.setTransport(*trmix);
|
||||
flow.setKinetics(gas);
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ Application::Application() :
|
|||
m_suppress_deprecation_warnings(false)
|
||||
{
|
||||
#if !defined( THREAD_SAFE_CANTERA )
|
||||
pMessenger = std::auto_ptr<Messages>(new Messages());
|
||||
pMessenger = std::unique_ptr<Messages>(new Messages());
|
||||
#endif
|
||||
|
||||
// install a default logwriter that writes to standard
|
||||
|
|
|
|||
|
|
@ -388,7 +388,7 @@ protected:
|
|||
#if defined(THREAD_SAFE_CANTERA)
|
||||
ThreadMessages pMessenger;
|
||||
#else
|
||||
std::auto_ptr<Messages> pMessenger;
|
||||
std::unique_ptr<Messages> pMessenger;
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@ void testProblem()
|
|||
vcs_timing_print_lvl = 0;
|
||||
|
||||
// Create the phases
|
||||
std::auto_ptr<ThermoPhase> LiSi_solid(newPhase("Li7Si3_ls.xml",
|
||||
"Li7Si3_and_Interstitials(S)"));
|
||||
std::auto_ptr<ThermoPhase> Li_liq(newPhase("Li_Liquid.xml", "Li(L)"));
|
||||
std::unique_ptr<ThermoPhase> LiSi_solid(newPhase("Li7Si3_ls.xml",
|
||||
"Li7Si3_and_Interstitials(S)"));
|
||||
std::unique_ptr<ThermoPhase> Li_liq(newPhase("Li_Liquid.xml", "Li(L)"));
|
||||
FixedChemPotSSTP LiFixed("Li", -2.3E7);
|
||||
MargulesVPSSTP salt("LiKCl_liquid.xml", "MoltenSalt_electrolyte");
|
||||
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ int main(int argc, char** argv)
|
|||
try {
|
||||
int log_level = 0;
|
||||
|
||||
std::auto_ptr<ThermoPhase> g(newPhase("h2o2.xml"));
|
||||
auto_ptr<Transport> tran(newTransportMgr("DustyGas", g.get(), log_level));
|
||||
unique_ptr<ThermoPhase> g(newPhase("h2o2.xml"));
|
||||
unique_ptr<Transport> tran(newTransportMgr("DustyGas", g.get(), log_level));
|
||||
DustyGasTransport* tranDusty = dynamic_cast<DustyGasTransport*>(tran.get());
|
||||
|
||||
size_t nsp = g->nSpecies();
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ int main(int argc, char** argv)
|
|||
|
||||
HMWSoln HMW("HMW_NaCl_pdss.xml", "NaCl_electrolyte");
|
||||
|
||||
auto_ptr<Transport> tran(newDefaultTransportMgr(&HMW, log_level));
|
||||
unique_ptr<Transport> tran(newDefaultTransportMgr(&HMW, log_level));
|
||||
|
||||
SimpleTransport& tranSimple = dynamic_cast<SimpleTransport&>(*tran.get());
|
||||
size_t nsp = HMW.nSpecies();
|
||||
|
|
|
|||
|
|
@ -48,15 +48,15 @@ void testProblem()
|
|||
if (!xg) {
|
||||
throw CanteraError("couldn't find file", "");
|
||||
}
|
||||
std::auto_ptr<ThermoPhase> surfTP(newPhase(*xg));
|
||||
std::auto_ptr<ThermoPhase> gasTP(newPhase("gas.xml"));
|
||||
unique_ptr<ThermoPhase> surfTP(newPhase(*xg));
|
||||
unique_ptr<ThermoPhase> gasTP(newPhase("gas.xml"));
|
||||
|
||||
std::auto_ptr<ThermoPhase> cao_s(newPhase("solidPhases.xml", "CaO(S)"));
|
||||
std::auto_ptr<ThermoPhase> caco3_s(newPhase("solidPhases.xml", "CaCO3(S)"));
|
||||
std::auto_ptr<ThermoPhase> c_s(newPhase("solidPhases.xml", "C(S)"));
|
||||
std::auto_ptr<ThermoPhase> fe3o4_s(newPhase("solidPhases.xml", "Fe3O4(S)"));
|
||||
std::auto_ptr<ThermoPhase> feo_s(newPhase("solidPhases.xml", "FeO(S)"));
|
||||
std::auto_ptr<ThermoPhase> fe_s(newPhase("solidPhases.xml", "Fe(S)"));
|
||||
unique_ptr<ThermoPhase> cao_s(newPhase("solidPhases.xml", "CaO(S)"));
|
||||
unique_ptr<ThermoPhase> caco3_s(newPhase("solidPhases.xml", "CaCO3(S)"));
|
||||
unique_ptr<ThermoPhase> c_s(newPhase("solidPhases.xml", "C(S)"));
|
||||
unique_ptr<ThermoPhase> fe3o4_s(newPhase("solidPhases.xml", "Fe3O4(S)"));
|
||||
unique_ptr<ThermoPhase> feo_s(newPhase("solidPhases.xml", "FeO(S)"));
|
||||
unique_ptr<ThermoPhase> fe_s(newPhase("solidPhases.xml", "Fe(S)"));
|
||||
|
||||
vector<ThermoPhase*> phaseList;
|
||||
phaseList.push_back(gasTP.get());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue