From 7cdeedb91b6971d38d50fd3a585fa739c2c78e9d Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Thu, 26 Feb 2015 21:59:37 +0000 Subject: [PATCH] [Transport] Provide transitional 'TransportFactory::initTransport' There are user-provided classes derived from GasTransport which still call this method, so a version of it that calls the new method for initializing GasTransport objects needs to be provided until after Cantera 2.2. --- include/cantera/transport/TransportFactory.h | 16 ++++++++++++++++ src/transport/TransportFactory.cpp | 9 +++++++++ 2 files changed, 25 insertions(+) diff --git a/include/cantera/transport/TransportFactory.h b/include/cantera/transport/TransportFactory.h index 747e8ed07..52e05f13b 100644 --- a/include/cantera/transport/TransportFactory.h +++ b/include/cantera/transport/TransportFactory.h @@ -107,6 +107,22 @@ public: virtual Transport* newTransport(thermo_t* thermo, int log_level=0); + //! Initialize an existing transport manager + /*! + * This routine sets up an existing gas-phase transport manager. It + * calculates the collision integrals and calls the initGas() function to + * populate the species-dependent data structure. + * + * @param tr Pointer to the Transport manager + * @param thermo Pointer to the ThermoPhase object + * @param mode Chemkin compatible mode or not. This alters the specification of the + * collision integrals. defaults to no. + * @param log_level Defaults to zero, no logging + * @deprecated To be removed after Cantera 2.2. This initialization is now + * handled directly by GasTransport::init. + */ + virtual void initTransport(Transport* tr, thermo_t* thermo, int mode=0, int log_level=0); + //! Initialize an existing transport manager for liquid phase /*! * This routine sets up an existing liquid-phase transport manager. It is diff --git a/src/transport/TransportFactory.cpp b/src/transport/TransportFactory.cpp index 784f808a8..65d6bbfbf 100644 --- a/src/transport/TransportFactory.cpp +++ b/src/transport/TransportFactory.cpp @@ -286,6 +286,15 @@ Transport* TransportFactory::newTransport(thermo_t* phase, int log_level) return newTransport(transportModel, phase,log_level); } +void TransportFactory::initTransport(Transport* tr, thermo_t* thermo, + int mode, int log_level) +{ + warn_deprecated("TransportFactory::initTransport", + "To be removed after Cantera 2.2. This initialization is " + "now handled directly by GasTransport::init"); + tr->init(thermo); +} + void TransportFactory::setupLiquidTransport(thermo_t* thermo, int log_level, LiquidTransportParams& trParam) {