Deprecate (previously) used convenience wrapper classes

- IdealGasMix.h and Interface.h
This commit is contained in:
Ingmar Schoegl 2019-10-26 20:01:02 -05:00 committed by Ray Speth
parent eda3b2fbfb
commit d730b4c5e8
2 changed files with 28 additions and 0 deletions

View file

@ -6,6 +6,8 @@
#ifndef CXX_IDEALGASMIX
#define CXX_IDEALGASMIX
#pragma message("warning: IdealGasMix.h is deprecated and will be removed after Cantera 2.5.")
#include "thermo/IdealGasPhase.h"
#include "kinetics/GasKinetics.h"
#include "kinetics/importKinetics.h"
@ -15,6 +17,10 @@ namespace Cantera
{
//! Convenience class which inherits from both IdealGasPhase and GasKinetics
/*!
* @deprecated To be removed after Cantera 2.5.
* Replaceable with Solution and/or IdealGasPhase/GasKinetics.
*/
class IdealGasMix :
public IdealGasPhase,
public GasKinetics
@ -25,6 +31,9 @@ public:
IdealGasMix(const std::string& infile, std::string id_="") :
m_ok(false), m_r(0)
{
warn_deprecated("class IdealGasMix",
"To be removed after Cantera 2.5. "
"Replaceable with Solution and/or IdealGasPhase/GasKinetics.");
m_r = get_XML_File(infile);
m_id = id_;
if (id_ == "-") {
@ -38,12 +47,18 @@ public:
IdealGasMix(XML_Node& root,
std::string id_) : m_ok(false), m_r(&root), m_id(id_) {
warn_deprecated("class IdealGasMix",
"To be removed after Cantera 2.5. "
"Replaceable with Solution and/or IdealGasPhase/GasKinetics.");
m_ok = buildSolutionFromXML(root, id_, "phase", this, this);
}
IdealGasMix(const IdealGasMix& other) : m_ok(false),
m_r(other.m_r),
m_id(other.m_id) {
warn_deprecated("class IdealGasMix",
"To be removed after Cantera 2.5. "
"Replaceable with Solution and/or IdealGasPhase/GasKinetics.");
m_ok = buildSolutionFromXML(*m_r, m_id, "phase", this, this);
}

View file

@ -9,6 +9,8 @@
#ifndef CXX_INTERFACE
#define CXX_INTERFACE
#pragma message("warning: Interface.h is deprecated and will be removed after Cantera 2.5.")
#include "thermo.h"
#include "kinetics.h"
#include "cantera/thermo/SurfPhase.h"
@ -22,6 +24,9 @@ namespace Cantera
* and InterfaceKinetics. It therefore represents a surface phase, and also acts
* as the kinetics manager to manage reactions occurring on the surface,
* possibly involving species from other phases.
*
* @deprecated To be removed after Cantera 2.5.
* Replaceable with Solution and/or SurfPhase/InterfaceKinetics.
*/
class Interface :
public SurfPhase,
@ -42,6 +47,10 @@ public:
std::vector<ThermoPhase*> otherPhases) :
m_ok(false),
m_r(0) {
warn_deprecated("class Interface",
"To be removed after Cantera 2.5. "
"Replaceable with Solution and/or SurfPhase/InterfaceKinetics.");
m_r = get_XML_File(infile);
if (id == "-") {
id = "";
@ -79,11 +88,15 @@ protected:
//! Import an instance of class Interface from a specification in an input file.
/*!
* This is the preferred method to create an Interface instance.
*
* @deprecated To be removed after Cantera 2.5. Replaceable with Solution.
*/
inline Interface* importInterface(const std::string& infile,
const std::string& id,
std::vector<ThermoPhase*> phases)
{
warn_deprecated("importInterface", "To be removed after Cantera 2.5. "
"Replaceable with Solution.");
return new Interface(infile, id, phases);
}