Skip to content

Commit

Permalink
Deprecate (previously) used convenience wrapper classes
Browse files Browse the repository at this point in the history
- IdealGasMix.h and Interface.h
  • Loading branch information
Ingmar Schoegl committed Oct 27, 2019
1 parent 852a089 commit 9d9f588
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
15 changes: 15 additions & 0 deletions include/cantera/IdealGasMix.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -25,6 +31,9 @@ class IdealGasMix :
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_ == "-") {
Expand All @@ -38,12 +47,18 @@ class IdealGasMix :

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);
}

Expand Down
14 changes: 14 additions & 0 deletions include/cantera/Interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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,
Expand All @@ -42,6 +47,10 @@ class Interface :
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 = "";
Expand Down Expand Up @@ -79,11 +88,16 @@ class Interface :
//! 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);
}

Expand Down

0 comments on commit 9d9f588

Please sign in to comment.