Skip to content

Commit

Permalink
Rename Kinetics::addPhase to Kinetics::addThermo
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl committed Mar 5, 2023
1 parent 9e21546 commit 6d24884
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions include/cantera/kinetics/InterfaceKinetics.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class InterfaceKinetics : public Kinetics
//! @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.
Expand All @@ -142,9 +142,9 @@ class InterfaceKinetics : public Kinetics
*
* @param thermo Reference to the ThermoPhase to be added.
*/
virtual void addPhase(shared_ptr<ThermoPhase> thermo);
virtual void addThermo(shared_ptr<ThermoPhase> thermo);

//! @see InterfaceKinetics::addPhase(shared_ptr<ThermoPhase>)
//! @see InterfaceKinetics::addThermo(shared_ptr<ThermoPhase>)
virtual void addPhase(ThermoPhase& thermo);

virtual void init();
Expand Down
8 changes: 4 additions & 4 deletions include/cantera/kinetics/Kinetics.h
Original file line number Diff line number Diff line change
Expand Up @@ -1104,12 +1104,12 @@ class Kinetics
* 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<ThermoPhase> thermo);
virtual void addThermo(shared_ptr<ThermoPhase> thermo);

//! @see Kinetics::addPhase(shared_ptr<ThermoPhase>)
//! @deprecated To be removed after Cantera 3.0. Replaced by version using shared
//! @see Kinetics::addThermo(shared_ptr<ThermoPhase>)
//! @deprecated To be removed after Cantera 3.0. Replaced by addThermo
//! pointer.
virtual void addPhase(ThermoPhase& thermo);

Expand Down
2 changes: 1 addition & 1 deletion interfaces/cython/cantera/kinetics.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions interfaces/cython/cantera/solutionbase.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/kinetics/InterfaceKinetics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,9 @@ void InterfaceKinetics::setIOFlag(int ioFlag)
}
}

void InterfaceKinetics::addPhase(shared_ptr<ThermoPhase> thermo)
void InterfaceKinetics::addThermo(shared_ptr<ThermoPhase> thermo)
{
Kinetics::addPhase(thermo);
Kinetics::addThermo(thermo);
m_phaseExists.push_back(true);
m_phaseIsStable.push_back(true);
}
Expand Down
4 changes: 2 additions & 2 deletions src/kinetics/Kinetics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ Eigen::SparseMatrix<double> Kinetics::netProductionRates_ddX()
return m_stoichMatrix * netRatesOfProgress_ddX();
}

void Kinetics::addPhase(shared_ptr<ThermoPhase> thermo)
void Kinetics::addThermo(shared_ptr<ThermoPhase> thermo)
{
// the phase with lowest dimensionality is assumed to be the
// phase/interface at which reactions take place
Expand All @@ -593,7 +593,7 @@ void Kinetics::addPhase(shared_ptr<ThermoPhase> 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
Expand Down
2 changes: 1 addition & 1 deletion src/kinetics/KineticsFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ shared_ptr<Kinetics> newKinetics(const vector<shared_ptr<ThermoPhase>>& phases,

shared_ptr<Kinetics> kin(KineticsFactory::factory()->newKinetics(kinType));
for (auto& phase : phases) {
kin->addPhase(phase);
kin->addThermo(phase);
}
kin->init();
addReactions(*kin, phaseNode, rootNode);
Expand Down
8 changes: 4 additions & 4 deletions test/kinetics/kineticsFromScratch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class KineticsFromScratch : public testing::Test
th.push_back(pp_ref);
kin_ref = newKinetics(th, "../data/kineticsfromscratch.yaml", "ohmech");

kin.addPhase(pp);
kin.addThermo(pp);
kin.init();
}

Expand Down Expand Up @@ -520,8 +520,8 @@ class InterfaceKineticsFromScratch : public testing::Test
, 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<ThermoPhase> gas;
Expand Down Expand Up @@ -603,7 +603,7 @@ class KineticsAddSpecies : public testing::Test
vector<shared_ptr<ThermoPhase>> th;
th.push_back(pp_ref);
kin_ref = newKinetics(th, "../data/kineticsfromscratch.yaml", "ohmech");
kin.addPhase(p);
kin.addThermo(p);

std::vector<shared_ptr<Species>> S = getSpecies(
AnyMap::fromYamlFile("h2o2.yaml")["species"]);
Expand Down

0 comments on commit 6d24884

Please sign in to comment.