From 5e34beb4a828d23ea4ac6e5197962a2a7731d3af Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 24 Oct 2012 15:46:22 +0000 Subject: [PATCH] Fixed incorrectly defined duplication method of ConstDensityThermo --- include/cantera/thermo/ConstDensityThermo.h | 14 +++++--------- src/thermo/ConstDensityThermo.cpp | 6 +++--- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/include/cantera/thermo/ConstDensityThermo.h b/include/cantera/thermo/ConstDensityThermo.h index d24a35d8a..109af837a 100644 --- a/include/cantera/thermo/ConstDensityThermo.h +++ b/include/cantera/thermo/ConstDensityThermo.h @@ -68,17 +68,13 @@ public: */ ConstDensityThermo& operator=(const ConstDensityThermo& right); - - //! Duplication routine for objects which inherit from - //! %SpeciesThermo + //! Duplication routine for objects which inherit from %ThermoPhase /*! - * This virtual routine can be used to duplicate %SpeciesThermo objects - * inherited from %SpeciesThermo even if the application only has - * a pointer to %SpeciesThermo to work with. - * ->commented out because we first need to add copy constructors - * and assignment operators to all of the derived classes. + * This virtual routine can be used to duplicate %ThermoPhase objects + * inherited from %ThermoPhase even if the application only has + * a pointer to %ThermoPhase to work with. */ - virtual SpeciesThermo* duplMyselfAsSpeciesThermo() const; + virtual ThermoPhase* duplMyselfAsThermoPhase() const; //! overloaded methods of class ThermoPhase virtual int eosType() const; diff --git a/src/thermo/ConstDensityThermo.cpp b/src/thermo/ConstDensityThermo.cpp index 8ba559808..3624db0c5 100644 --- a/src/thermo/ConstDensityThermo.cpp +++ b/src/thermo/ConstDensityThermo.cpp @@ -50,11 +50,11 @@ ConstDensityThermo& ConstDensityThermo::operator=(const ConstDensityThermo& righ } -SpeciesThermo* ConstDensityThermo::duplMyselfAsSpeciesThermo() const +ThermoPhase* ConstDensityThermo::duplMyselfAsThermoPhase() const { - ConstDensityThermo* cdt = new ConstDensityThermo(*this); - return (SpeciesThermo*) cdt; + return new ConstDensityThermo(*this); } + int ConstDensityThermo:: eosType() const {