diff --git a/include/cantera/kinetics/InterfaceKinetics.h b/include/cantera/kinetics/InterfaceKinetics.h index c99d98004..d4900d97e 100644 --- a/include/cantera/kinetics/InterfaceKinetics.h +++ b/include/cantera/kinetics/InterfaceKinetics.h @@ -130,7 +130,7 @@ public: //! @name Reaction Mechanism Construction //! @{ - //! Add a phase to the kinetics manager object. + //! Add a thermo phase to the kinetics manager object. /*! * This must be done before the function init() is called or * before any reactions are input. @@ -142,9 +142,9 @@ public: * * @param thermo Reference to the ThermoPhase to be added. */ - virtual void addPhase(shared_ptr thermo); + virtual void addThermo(shared_ptr thermo); - //! @see InterfaceKinetics::addPhase(shared_ptr) + //! @see InterfaceKinetics::addThermo(shared_ptr) virtual void addPhase(ThermoPhase& thermo); virtual void init(); diff --git a/include/cantera/kinetics/Kinetics.h b/include/cantera/kinetics/Kinetics.h index 19c38f1cd..201761184 100644 --- a/include/cantera/kinetics/Kinetics.h +++ b/include/cantera/kinetics/Kinetics.h @@ -1104,12 +1104,12 @@ public: * kinetics manager object as the value. * * @param thermo Reference to the ThermoPhase to be added. - * @since Changed in Cantera 3.0. Replaces version using reference. + * @since New in Cantera 3.0. Replaces addPhase. */ - virtual void addPhase(shared_ptr thermo); + virtual void addThermo(shared_ptr thermo); - //! @see Kinetics::addPhase(shared_ptr) - //! @deprecated To be removed after Cantera 3.0. Replaced by version using shared + //! @see Kinetics::addThermo(shared_ptr) + //! @deprecated To be removed after Cantera 3.0. Replaced by addThermo //! pointer. virtual void addPhase(ThermoPhase& thermo); diff --git a/interfaces/cython/cantera/kinetics.pxd b/interfaces/cython/cantera/kinetics.pxd index d79d4028d..fd205547d 100644 --- a/interfaces/cython/cantera/kinetics.pxd +++ b/interfaces/cython/cantera/kinetics.pxd @@ -32,7 +32,7 @@ cdef extern from "cantera/kinetics/Kinetics.h" namespace "Cantera": CxxThermoPhase& thermo(int) - void addPhase(shared_ptr[CxxThermoPhase]) except +translate_exception + void addThermo(shared_ptr[CxxThermoPhase]) except +translate_exception void init() except +translate_exception void skipUndeclaredThirdBodies(cbool) void addReaction(shared_ptr[CxxReaction]) except +translate_exception diff --git a/interfaces/cython/cantera/solutionbase.pyx b/interfaces/cython/cantera/solutionbase.pyx index b81146f84..585c2f882 100644 --- a/interfaces/cython/cantera/solutionbase.pyx +++ b/interfaces/cython/cantera/solutionbase.pyx @@ -241,10 +241,10 @@ cdef class _SolutionBase: if isinstance(self, Kinetics): self.base.setKinetics(newKinetics(stringify(kinetics))) self.kinetics = self.base.kinetics().get() - self.kinetics.addPhase(self.base.thermo()) + self.kinetics.addThermo(self.base.thermo()) for phase in adjacent: # adjacent bulk phases for a surface phase - self.kinetics.addPhase(phase.base.thermo()) + self.kinetics.addThermo(phase.base.thermo()) self.kinetics.init() self.kinetics.skipUndeclaredThirdBodies(True) for reaction in reactions: diff --git a/src/kinetics/InterfaceKinetics.cpp b/src/kinetics/InterfaceKinetics.cpp index b3afd6325..1d4558e14 100644 --- a/src/kinetics/InterfaceKinetics.cpp +++ b/src/kinetics/InterfaceKinetics.cpp @@ -487,9 +487,9 @@ void InterfaceKinetics::setIOFlag(int ioFlag) } } -void InterfaceKinetics::addPhase(shared_ptr thermo) +void InterfaceKinetics::addThermo(shared_ptr thermo) { - Kinetics::addPhase(thermo); + Kinetics::addThermo(thermo); m_phaseExists.push_back(true); m_phaseIsStable.push_back(true); } diff --git a/src/kinetics/Kinetics.cpp b/src/kinetics/Kinetics.cpp index b5c874e59..9f9a6b59a 100644 --- a/src/kinetics/Kinetics.cpp +++ b/src/kinetics/Kinetics.cpp @@ -571,7 +571,7 @@ Eigen::SparseMatrix Kinetics::netProductionRates_ddX() return m_stoichMatrix * netRatesOfProgress_ddX(); } -void Kinetics::addPhase(shared_ptr thermo) +void Kinetics::addThermo(shared_ptr thermo) { // the phase with lowest dimensionality is assumed to be the // phase/interface at which reactions take place @@ -593,7 +593,7 @@ void Kinetics::addPhase(shared_ptr thermo) void Kinetics::addPhase(ThermoPhase& thermo) { warn_deprecated("Kinetics::addPhase", - "To be removed after Cantera 3.0. Use version with shared pointer instead."); + "To be removed after Cantera 3.0. Replaced by addThermo."); // the phase with lowest dimensionality is assumed to be the // phase/interface at which reactions take place diff --git a/src/kinetics/KineticsFactory.cpp b/src/kinetics/KineticsFactory.cpp index 295eeab7d..3647504c2 100644 --- a/src/kinetics/KineticsFactory.cpp +++ b/src/kinetics/KineticsFactory.cpp @@ -89,7 +89,7 @@ shared_ptr newKinetics(const vector>& phases, shared_ptr kin(KineticsFactory::factory()->newKinetics(kinType)); for (auto& phase : phases) { - kin->addPhase(phase); + kin->addThermo(phase); } kin->init(); addReactions(*kin, phaseNode, rootNode); diff --git a/test/kinetics/kineticsFromScratch.cpp b/test/kinetics/kineticsFromScratch.cpp index 757cbf080..52e068ddf 100644 --- a/test/kinetics/kineticsFromScratch.cpp +++ b/test/kinetics/kineticsFromScratch.cpp @@ -29,7 +29,7 @@ public: th.push_back(pp_ref); kin_ref = newKinetics(th, "../data/kineticsfromscratch.yaml", "ohmech"); - kin.addPhase(pp); + kin.addThermo(pp); kin.init(); } @@ -520,8 +520,8 @@ public: , surf_ref(newThermo("sofc.yaml", "metal_surface")) { kin_ref = newKinetics({surf_ref, gas_ref}, "sofc.yaml", "metal_surface"); - kin.addPhase(surf); - kin.addPhase(gas); + kin.addThermo(surf); + kin.addThermo(gas); } shared_ptr gas; @@ -603,7 +603,7 @@ public: vector> th; th.push_back(pp_ref); kin_ref = newKinetics(th, "../data/kineticsfromscratch.yaml", "ohmech"); - kin.addPhase(p); + kin.addThermo(p); std::vector> S = getSpecies( AnyMap::fromYamlFile("h2o2.yaml")["species"]);