From 17c3b019c091c2ef11890a73b627b7f4e7f95dd4 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 8 Oct 2014 16:54:35 +0000 Subject: [PATCH] [Kinetics] Deprecate unused methods for writing hard-coded mechanisms --- include/cantera/kinetics/ReactionStoichMgr.h | 6 +++ include/cantera/kinetics/StoichManager.h | 44 +++++++++++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/include/cantera/kinetics/ReactionStoichMgr.h b/include/cantera/kinetics/ReactionStoichMgr.h index ba9ad2ff9..5021ae7a2 100644 --- a/include/cantera/kinetics/ReactionStoichMgr.h +++ b/include/cantera/kinetics/ReactionStoichMgr.h @@ -197,13 +197,19 @@ public: */ virtual void multiplyRevProducts(const doublereal* c, doublereal* r); + //! @deprecated To be removed after Cantera 2.2 virtual void write(const std::string& filename); protected: + //! @deprecated To be removed after Cantera 2.2 void writeCreationRates(std::ostream& f); + //! @deprecated To be removed after Cantera 2.2 void writeDestructionRates(std::ostream& f); + //! @deprecated To be removed after Cantera 2.2 void writeNetProductionRates(std::ostream& f); + //! @deprecated To be removed after Cantera 2.2 void writeMultiplyReactants(std::ostream& f); + //! @deprecated To be removed after Cantera 2.2 void writeMultiplyRevProducts(std::ostream& f); StoichManagerN m_reactants; StoichManagerN m_revproducts; diff --git a/include/cantera/kinetics/StoichManager.h b/include/cantera/kinetics/StoichManager.h index 7b33f83a3..4df1d364c 100644 --- a/include/cantera/kinetics/StoichManager.h +++ b/include/cantera/kinetics/StoichManager.h @@ -135,6 +135,7 @@ static doublereal ppow(doublereal x, doublereal order) } } +//! @deprecated To be removed after Cantera 2.2 inline static std::string fmt(const std::string& r, size_t n) { return r + "[" + int2str(n) + "]"; @@ -203,20 +204,27 @@ public: return 1; } + //! @deprecated To be removed after Cantera 2.2 void writeMultiply(const std::string& r, std::map& out) { out[m_rxn] = fmt(r, m_ic0); } + //! @deprecated To be removed after Cantera 2.2 void writeIncrementReaction(const std::string& r, std::map& out) { out[m_rxn] += " + "+fmt(r, m_ic0); } + + //! @deprecated To be removed after Cantera 2.2 void writeDecrementReaction(const std::string& r, std::map& out) { out[m_rxn] += " - "+fmt(r, m_ic0); } + //! @deprecated To be removed after Cantera 2.2 void writeIncrementSpecies(const std::string& r, std::map& out) { out[m_ic0] += " + "+fmt(r, m_rxn); } + + //! @deprecated To be removed after Cantera 2.2 void writeDecrementSpecies(const std::string& r, std::map& out) { out[m_ic0] += " - "+fmt(r, m_rxn); } @@ -293,21 +301,29 @@ public: return 2; } + //! @deprecated To be removed after Cantera 2.2 void writeMultiply(const std::string& r, std::map& out) { out[m_rxn] = fmt(r, m_ic0) + " * " + fmt(r, m_ic1); } + + //! @deprecated To be removed after Cantera 2.2 void writeIncrementReaction(const std::string& r, std::map& out) { out[m_rxn] += " + "+fmt(r, m_ic0)+" + "+fmt(r, m_ic1); } + + //! @deprecated To be removed after Cantera 2.2 void writeDecrementReaction(const std::string& r, std::map& out) { out[m_rxn] += " - "+fmt(r, m_ic0)+" - "+fmt(r, m_ic1); } + //! @deprecated To be removed after Cantera 2.2 void writeIncrementSpecies(const std::string& r, std::map& out) { std::string s = " + "+fmt(r, m_rxn); out[m_ic0] += s; out[m_ic1] += s; } + + //! @deprecated To be removed after Cantera 2.2 void writeDecrementSpecies(const std::string& r, std::map& out) { std::string s = " - "+fmt(r, m_rxn); out[m_ic0] += s; @@ -392,21 +408,30 @@ public: return 3; } + //! @deprecated To be removed after Cantera 2.2 void writeMultiply(const std::string& r, std::map& out) { out[m_rxn] = fmt(r, m_ic0) + " * " + fmt(r, m_ic1) + " * " + fmt(r, m_ic2); } + + //! @deprecated To be removed after Cantera 2.2 void writeIncrementReaction(const std::string& r, std::map& out) { out[m_rxn] += " + "+fmt(r, m_ic0)+" + "+fmt(r, m_ic1)+" + "+fmt(r, m_ic2); } + + //! @deprecated To be removed after Cantera 2.2 void writeDecrementReaction(const std::string& r, std::map& out) { out[m_rxn] += " - "+fmt(r, m_ic0)+" - "+fmt(r, m_ic1)+" - "+fmt(r, m_ic2); } + + //! @deprecated To be removed after Cantera 2.2 void writeIncrementSpecies(const std::string& r, std::map& out) { std::string s = " + "+fmt(r, m_rxn); out[m_ic0] += s; out[m_ic1] += s; out[m_ic2] += s; } + + //! @deprecated To be removed after Cantera 2.2 void writeDecrementSpecies(const std::string& r, std::map& out) { std::string s = " - "+fmt(r, m_rxn); out[m_ic0] += s; @@ -524,6 +549,7 @@ public: -= m_stoich[n]*input[m_ic[n]]; } + //! @deprecated To be removed after Cantera 2.2 void writeMultiply(const std::string& r, std::map& out) { out[m_rxn] = ""; for (size_t n = 0; n < m_n; n++) { @@ -537,16 +563,22 @@ public: } } } + + //! @deprecated To be removed after Cantera 2.2 void writeIncrementReaction(const std::string& r, std::map& out) { for (size_t n = 0; n < m_n; n++) { out[m_rxn] += " + "+fp2str(m_stoich[n]) + "*" + fmt(r, m_ic[n]); } } + + //! @deprecated To be removed after Cantera 2.2 void writeDecrementReaction(const std::string& r, std::map& out) { for (size_t n = 0; n < m_n; n++) { out[m_rxn] += " - "+fp2str(m_stoich[n]) + "*" + fmt(r, m_ic[n]); } } + + //! @deprecated To be removed after Cantera 2.2 void writeIncrementSpecies(const std::string& r, std::map& out) { std::string s = fmt(r, m_rxn); for (size_t n = 0; n < m_n; n++) { @@ -554,6 +586,7 @@ public: } } + //! @deprecated To be removed after Cantera 2.2 void writeDecrementSpecies(const std::string& r, std::map& out) { std::string s = fmt(r, m_rxn); for (size_t n = 0; n < m_n; n++) { @@ -648,7 +681,7 @@ inline static void _decrementReactions(InputIter begin, } } - +//! @deprecated To be removed after Cantera 2.2 template inline static void _writeIncrementSpecies(InputIter begin, InputIter end, const std::string& r, std::map& out) @@ -658,6 +691,7 @@ inline static void _writeIncrementSpecies(InputIter begin, InputIter end, } } +//! @deprecated To be removed after Cantera 2.2 template inline static void _writeDecrementSpecies(InputIter begin, InputIter end, const std::string& r, std::map& out) @@ -667,6 +701,7 @@ inline static void _writeDecrementSpecies(InputIter begin, InputIter end, } } +//! @deprecated To be removed after Cantera 2.2 template inline static void _writeIncrementReaction(InputIter begin, InputIter end, const std::string& r, std::map& out) @@ -676,6 +711,7 @@ inline static void _writeIncrementReaction(InputIter begin, InputIter end, } } +//! @deprecated To be removed after Cantera 2.2 template inline static void _writeDecrementReaction(InputIter begin, InputIter end, const std::string& r, std::map& out) @@ -685,6 +721,7 @@ inline static void _writeDecrementReaction(InputIter begin, InputIter end, } } +//! @deprecated To be removed after Cantera 2.2 template inline static void _writeMultiply(InputIter begin, InputIter end, const std::string& r, std::map& out) @@ -885,6 +922,7 @@ public: _decrementReactions(m_cn_list.begin(), m_cn_list.end(), input, output); } + //! @deprecated To be removed after Cantera 2.2 void writeIncrementSpecies(const std::string& r, std::map& out) { _writeIncrementSpecies(m_c1_list.begin(), m_c1_list.end(), r, out); _writeIncrementSpecies(m_c2_list.begin(), m_c2_list.end(), r, out); @@ -892,6 +930,7 @@ public: _writeIncrementSpecies(m_cn_list.begin(), m_cn_list.end(), r, out); } + //! @deprecated To be removed after Cantera 2.2 void writeDecrementSpecies(const std::string& r, std::map& out) { _writeDecrementSpecies(m_c1_list.begin(), m_c1_list.end(), r, out); _writeDecrementSpecies(m_c2_list.begin(), m_c2_list.end(), r, out); @@ -899,6 +938,7 @@ public: _writeDecrementSpecies(m_cn_list.begin(), m_cn_list.end(), r, out); } + //! @deprecated To be removed after Cantera 2.2 void writeIncrementReaction(const std::string& r, std::map& out) { _writeIncrementReaction(m_c1_list.begin(), m_c1_list.end(), r, out); _writeIncrementReaction(m_c2_list.begin(), m_c2_list.end(), r, out); @@ -906,6 +946,7 @@ public: _writeIncrementReaction(m_cn_list.begin(), m_cn_list.end(), r, out); } + //! @deprecated To be removed after Cantera 2.2 void writeDecrementReaction(const std::string& r, std::map& out) { _writeDecrementReaction(m_c1_list.begin(), m_c1_list.end(), r, out); _writeDecrementReaction(m_c2_list.begin(), m_c2_list.end(), r, out); @@ -913,6 +954,7 @@ public: _writeDecrementReaction(m_cn_list.begin(), m_cn_list.end(), r, out); } + //! @deprecated To be removed after Cantera 2.2 void writeMultiply(const std::string& r, std::map& out) { _writeMultiply(m_c1_list.begin(), m_c1_list.end(), r, out); _writeMultiply(m_c2_list.begin(), m_c2_list.end(), r, out);