diff --git a/include/cantera/kinetics/KineticsFactory.h b/include/cantera/kinetics/KineticsFactory.h index ffd476b79..a57244f3a 100644 --- a/include/cantera/kinetics/KineticsFactory.h +++ b/include/cantera/kinetics/KineticsFactory.h @@ -76,23 +76,35 @@ private: /** * Create a new kinetics manager. + * @deprecated The `KineticsFactory*` argument to this function is deprecated + * and will be removed after Cantera 2.3. */ inline Kinetics* newKineticsMgr(XML_Node& phase, std::vector th, KineticsFactory* f=0) { if (f == 0) { f = KineticsFactory::factory(); + } else { + warn_deprecated("newKineticsMgr(XML_Node&, KineticsFactory*)", + "The `KineticsFactory*` argument to this function is deprecated and" + " will be removed after Cantera 2.3."); } return f->newKinetics(phase, th); } /** * Create a new kinetics manager. + * @deprecated The `KineticsFactory*` argument to this function is deprecated + * and will be removed after Cantera 2.3. */ inline Kinetics* newKineticsMgr(const std::string& model, KineticsFactory* f=0) { if (f == 0) { f = KineticsFactory::factory(); + } else { + warn_deprecated("newKineticsMgr(string, KineticsFactory*)", + "The `KineticsFactory*` argument to this function is deprecated and" + " will be removed after Cantera 2.3."); } return f->newKinetics(model); } diff --git a/include/cantera/thermo/ThermoFactory.h b/include/cantera/thermo/ThermoFactory.h index b506970ef..ee4694266 100644 --- a/include/cantera/thermo/ThermoFactory.h +++ b/include/cantera/thermo/ThermoFactory.h @@ -95,12 +95,18 @@ private: * @returns a pointer to a new ThermoPhase instance matching the model string. * Returns NULL if something went wrong. Throws an exception * UnknownThermoPhaseModel if the string wasn't matched. + * @deprecated The `ThermoFactory*` argument to this function is deprecated and + * will be removed after Cantera 2.3. */ inline ThermoPhase* newThermoPhase(const std::string& model, ThermoFactory* f=0) { if (f == 0) { f = ThermoFactory::factory(); + } else { + warn_deprecated("newThermoPhase(string, ThermoFactory*)", + "The `ThermoFactory*` argument to this function is deprecated and" + " will be removed after Cantera 2.3."); } return f->create(model); } diff --git a/include/cantera/transport/TransportFactory.h b/include/cantera/transport/TransportFactory.h index d4b98bc73..2fc7902c3 100644 --- a/include/cantera/transport/TransportFactory.h +++ b/include/cantera/transport/TransportFactory.h @@ -255,11 +255,15 @@ private: * @param loglevel int containing the Loglevel, defaults to zero * @param f optional pointer to the TransportFactory object * @param ndim Number of dimensions for transport fluxes - * + * @deprecated Use the version which does not take a `TransportFactory*`.To be + * removed after Cantera 2.3. * @ingroup tranprops */ -Transport* newTransportMgr(const std::string& transportModel = "", thermo_t* thermo = 0, int loglevel = 0, - TransportFactory* f = 0, int ndim=1); +Transport* newTransportMgr(const std::string& transportModel, thermo_t* thermo, int loglevel, + TransportFactory* f, int ndim=1); + +Transport* newTransportMgr(const std::string& transportModel = "", + thermo_t* thermo = 0, int loglevel = 0, int ndim=1); //! Create a new transport manager instance. /*! @@ -267,7 +271,8 @@ Transport* newTransportMgr(const std::string& transportModel = "", thermo_t* the * @param loglevel int containing the Loglevel, defaults to zero * @param f pointer to the TransportFactory object if it's been allocated * @returns a transport manager for the phase - * + * @deprecated The `TransportFactory*` argument to this function is deprecated + * and will be removed after Cantera 2.3. * @ingroup tranprops */ Transport* newDefaultTransportMgr(thermo_t* thermo, int loglevel = 0, TransportFactory* f = 0); diff --git a/include/cantera/zeroD/ReactorFactory.h b/include/cantera/zeroD/ReactorFactory.h index 27ef22797..be252456e 100644 --- a/include/cantera/zeroD/ReactorFactory.h +++ b/include/cantera/zeroD/ReactorFactory.h @@ -41,11 +41,18 @@ private: ReactorFactory(); }; +//! Create a Reactor object of the specified type +//! @deprecated The `ReactorFactory*` argument to this function is deprecated and +//! will be removed after Cantera 2.3. inline ReactorBase* newReactor(const std::string& model, ReactorFactory* f=0) { if (f == 0) { f = ReactorFactory::factory(); + } else { + warn_deprecated("newReactor(string, ReactorFactory*)", + "The `ReactorFactory*` argument to this function is deprecated and" + " will be removed after Cantera 2.3."); } return f->newReactor(model); } diff --git a/src/thermo/VPSSMgrFactory.cpp b/src/thermo/VPSSMgrFactory.cpp index 7ecac5b3c..fdc459f03 100644 --- a/src/thermo/VPSSMgrFactory.cpp +++ b/src/thermo/VPSSMgrFactory.cpp @@ -337,6 +337,10 @@ VPSSMgr* newVPSSMgr(VPStandardStateTP* tp_ptr, { if (f == 0) { f = VPSSMgrFactory::factory(); + } else { + warn_deprecated("newVPSSMgr(VPStandardStateTP*, XML_Node*, vector, VPSSMgrFactory*)", + "The `VPSSMgrFactory*` argument to this function is deprecated and" + " will be removed after Cantera 2.3."); } return f->newVPSSMgr(tp_ptr, phaseNode_ptr, spDataNodeList); } diff --git a/src/thermo/VPSSMgrFactory.h b/src/thermo/VPSSMgrFactory.h index 722fc51a3..ab32ad71a 100644 --- a/src/thermo/VPSSMgrFactory.h +++ b/src/thermo/VPSSMgrFactory.h @@ -176,6 +176,8 @@ VPSSMgr* newVPSSMgr(VPSSMgr_enumType type, * of species XML nodes that will be in the phase * @param f Pointer to a VPSSMgrFactory. optional * parameter. Defaults to NULL. + * @deprecated The `VPSSMgrFactory*` argument to this function is deprecated and + * will be removed after Cantera 2.3. */ VPSSMgr* newVPSSMgr(VPStandardStateTP* vp_ptr, XML_Node* phaseNode_ptr, diff --git a/src/transport/TransportFactory.cpp b/src/transport/TransportFactory.cpp index 5b10703d2..8af521307 100644 --- a/src/transport/TransportFactory.cpp +++ b/src/transport/TransportFactory.cpp @@ -594,16 +594,29 @@ void TransportFactory::getSolidTransportData(const XML_Node& transportNode, Transport* newTransportMgr(const std::string& transportModel, thermo_t* thermo, int loglevel, TransportFactory* f, int ndim) { + warn_deprecated("newTransportMgr(string, thermo_t*, int, TransportFactory*, int)", + "This overload is deprecated and will be removed after Cantera 2.3." + " Use the version that does not take a TransportFactory*."); if (f == 0) { f = TransportFactory::factory(); } return f->newTransport(transportModel, thermo, loglevel, ndim); } +Transport* newTransportMgr(const std::string& transportModel, thermo_t* thermo, int loglevel, int ndim) +{ + TransportFactory* f = TransportFactory::factory(); + return f->newTransport(transportModel, thermo, loglevel, ndim); +} + Transport* newDefaultTransportMgr(thermo_t* thermo, int loglevel, TransportFactory* f) { if (f == 0) { f = TransportFactory::factory(); + } else { + warn_deprecated("newDefaultTransportMgr(ThermoPhase*, int, TransportFactory*)", + "The `TransportFactory*` argument to this function is deprecated" + " and will be removed after Cantera 2.3."); } return f->newTransport(thermo, loglevel); }