[0D] Consolidate zeroD insert methods

This commit is contained in:
Ingmar Schoegl 2024-01-20 18:17:38 -06:00 committed by Ray Speth
parent 8841f11c83
commit c348fef4a9
5 changed files with 17 additions and 9 deletions

View File

@ -68,14 +68,16 @@ public:
/**
* Insert something into the reactor. The 'something' must belong to a class
* that is a subclass of both ThermoPhase and Kinetics.
* @deprecated Unused; to be removed after %Cantera 3.1.
*/
template<class G>
void insert(G& contents) {
warn_deprecated("Reactor::insert", "Unused; to be removed after Cantera 3.1.");
setThermoMgr(contents);
setKineticsMgr(contents);
}
void insert(shared_ptr<Solution> sol);
using ReactorBase::insert;
void setKineticsMgr(Kinetics& kin) override;

View File

@ -89,6 +89,9 @@ public:
m_vol = vol;
}
//! @deprecated To be removed after %Cantera 3.1. Superseded by setSolution.
void insert(shared_ptr<Solution> sol);
//! Specify the mixture contained in the reactor. Note that a pointer to
//! this substance is stored, and as the integration proceeds, the state of
//! the substance is modified.

View File

@ -26,13 +26,14 @@ public:
void initialize(double t0=0.0) override {}
//! @deprecated Unused; to be removed after %Cantera 3.1.
void insert(ThermoPhase& contents) {
warn_deprecated("Reservoir::insert",
"Unused; to be removed after Cantera 3.1.");
setThermoMgr(contents);
}
void insert(shared_ptr<Solution> sol) {
setThermoMgr(*sol->thermo());
}
using ReactorBase::insert;
};
}

View File

@ -22,11 +22,6 @@ namespace bmt = boost::math::tools;
namespace Cantera
{
void Reactor::insert(shared_ptr<Solution> sol) {
setThermoMgr(*sol->thermo());
setKineticsMgr(*sol->kinetics());
}
void Reactor::setDerivativeSettings(AnyMap& settings)
{
m_kin->setDerivativeSettings(settings);

View File

@ -34,6 +34,13 @@ void ReactorBase::setSolution(shared_ptr<Solution> sol) {
}
}
void ReactorBase::insert(shared_ptr<Solution> sol)
{
// warn_deprecated("ReactorBase::insert",
// "To be removed after Cantera 3.1. Superseded by 'setSolution'.");
setSolution(sol);
}
void ReactorBase::setThermoMgr(ThermoPhase& thermo)
{
m_thermo = &thermo;