From 6287c2c311a639d5f3f9ebb2fbe90d8448f6a72b Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 22 Oct 2014 21:48:19 +0000 Subject: [PATCH] [Kinetics] Remove unused m_index member of Kinetics classes --- include/cantera/kinetics/AqueousKinetics.h | 8 -------- include/cantera/kinetics/GasKinetics.h | 5 ----- include/cantera/kinetics/InterfaceKinetics.h | 20 -------------------- src/kinetics/AqueousKinetics.cpp | 2 -- src/kinetics/GasKinetics.cpp | 16 +++++----------- src/kinetics/InterfaceKinetics.cpp | 13 ++----------- 6 files changed, 7 insertions(+), 57 deletions(-) diff --git a/include/cantera/kinetics/AqueousKinetics.h b/include/cantera/kinetics/AqueousKinetics.h index 96e94e8d5..983e4ed56 100644 --- a/include/cantera/kinetics/AqueousKinetics.h +++ b/include/cantera/kinetics/AqueousKinetics.h @@ -171,8 +171,6 @@ protected: Rate1 m_rates; - std::map > m_index; - std::vector m_irrev; ReactionStoichMgr m_rxnstoich; @@ -182,9 +180,6 @@ protected: size_t m_nirrev; size_t m_nrev; - std::map > m_rgroups; - std::map > m_pgroups; - std::vector > m_rrxn; std::vector > m_prxn; @@ -229,9 +224,6 @@ private: */ void updateKc(); - void registerReaction(size_t rxnNumber, int type, size_t loc) { - m_index[rxnNumber] = std::pair(type, loc); - } bool m_finalized; }; } diff --git a/include/cantera/kinetics/GasKinetics.h b/include/cantera/kinetics/GasKinetics.h index 3786bfad9..942cef301 100644 --- a/include/cantera/kinetics/GasKinetics.h +++ b/include/cantera/kinetics/GasKinetics.h @@ -144,8 +144,6 @@ protected: Rate1 m_falloff_high_rates; Rate1 m_rates; - std::map > m_index; - FalloffMgr m_falloffn; ThirdBodyMgr m_3b_concm; @@ -217,9 +215,6 @@ private: //! Update the equilibrium constants in molar units. void updateKc(); - void registerReaction(size_t rxnNumber, int type_, size_t loc) { - m_index[rxnNumber] = std::pair(type_, loc); - } bool m_finalized; }; } diff --git a/include/cantera/kinetics/InterfaceKinetics.h b/include/cantera/kinetics/InterfaceKinetics.h index 3c1ae97b9..1c4b87a35 100644 --- a/include/cantera/kinetics/InterfaceKinetics.h +++ b/include/cantera/kinetics/InterfaceKinetics.h @@ -341,18 +341,6 @@ public: */ void updateKc(); - //! Write values into m_index - /*! - * @param rxnNumber reaction number - * @param type reaction type - * @param loc location location in the reaction rate coefficient calculator - * - * Right now we only use one reaction rate coefficient calculated named ELEMENTARY_RXN - * Therefore, this is not used within the code) - * (type, loc) is stored as a std::pair - */ - void registerReaction(size_t rxnNumber, int type, size_t loc); - //! Apply modifications for the fowward reaction rate for interfacial charge transfer reactions /*! * For reactions that transfer charge across a potential difference, @@ -455,14 +443,6 @@ protected: bool m_redo_rates; - /** - * Vector of information about reactions in the mechanism. - * The key is the reaction index (0 < i < m_ii). - * The first pair is the reactionType of the reaction. - * The second pair is ... - */ - std::map > m_index; - //! Vector of irreversible reaction numbers /*! * vector containing the reaction numbers of irreversible reactions. diff --git a/src/kinetics/AqueousKinetics.cpp b/src/kinetics/AqueousKinetics.cpp index ab8a96cd3..e9ca79cdf 100644 --- a/src/kinetics/AqueousKinetics.cpp +++ b/src/kinetics/AqueousKinetics.cpp @@ -55,7 +55,6 @@ AqueousKinetics& AqueousKinetics::operator=(const AqueousKinetics& right) m_nfall = right.m_nfall; m_rates = right.m_rates; - m_index = right.m_index; m_irrev = right.m_irrev; m_rxnstoich = right.m_rxnstoich; @@ -368,7 +367,6 @@ void AqueousKinetics::addElementaryReaction(ReactionData& r) // forward rxn order equals number of reactants m_fwdOrder.push_back(r.reactants.size()); - registerReaction(reactionNumber(), ELEMENTARY_RXN, iloc); } void AqueousKinetics::installReagents(const ReactionData& r) diff --git a/src/kinetics/GasKinetics.cpp b/src/kinetics/GasKinetics.cpp index a326b49c8..add49d375 100644 --- a/src/kinetics/GasKinetics.cpp +++ b/src/kinetics/GasKinetics.cpp @@ -61,7 +61,6 @@ GasKinetics& GasKinetics::operator=(const GasKinetics& right) m_falloff_low_rates = right.m_falloff_low_rates; m_falloff_high_rates = right.m_falloff_high_rates; m_rates = right.m_rates; - m_index = right.m_index; m_falloffn = right.m_falloffn; m_3b_concm = right.m_3b_concm; m_falloff_concm = right.m_falloff_concm; @@ -499,7 +498,7 @@ void GasKinetics::addFalloffReaction(ReactionData& r) { // install high and low rate coeff calculators // and add constant terms to high and low rate coeff value vectors - size_t iloc = m_falloff_high_rates.install(m_nfall, r); + m_falloff_high_rates.install(m_nfall, r); m_rfn_high.push_back(r.rateCoeffParameters[0]); std::swap(r.rateCoeffParameters, r.auxRateCoeffParameters); m_falloff_low_rates.install(m_nfall, r); @@ -529,26 +528,24 @@ void GasKinetics::addFalloffReaction(ReactionData& r) // increment the falloff reaction counter ++m_nfall; - registerReaction(reactionNumber(), r.reactionType, iloc); } void GasKinetics::addElementaryReaction(ReactionData& r) { // install rate coeff calculator - size_t iloc = m_rates.install(reactionNumber(), r); + m_rates.install(reactionNumber(), r); // add constant term to rate coeff value vector m_rfn.push_back(r.rateCoeffParameters[0]); // forward rxn order equals number of reactants m_fwdOrder.push_back(r.reactants.size()); - registerReaction(reactionNumber(), ELEMENTARY_RXN, iloc); } void GasKinetics::addThreeBodyReaction(ReactionData& r) { // install rate coeff calculator - size_t iloc = m_rates.install(reactionNumber(), r); + m_rates.install(reactionNumber(), r); // add constant term to rate coeff value vector m_rfn.push_back(r.rateCoeffParameters[0]); @@ -558,31 +555,28 @@ void GasKinetics::addThreeBodyReaction(ReactionData& r) m_3b_concm.install(reactionNumber(), r.thirdBodyEfficiencies, r.default_3b_eff); - registerReaction(reactionNumber(), THREE_BODY_RXN, iloc); } void GasKinetics::addPlogReaction(ReactionData& r) { // install rate coefficient calculator - size_t iloc = m_plog_rates.install(reactionNumber(), r); + m_plog_rates.install(reactionNumber(), r); // add a dummy entry in m_rfn, where computed rate coeff will be put m_rfn.push_back(0.0); m_fwdOrder.push_back(r.reactants.size()); - registerReaction(reactionNumber(), PLOG_RXN, iloc); } void GasKinetics::addChebyshevReaction(ReactionData& r) { // install rate coefficient calculator - size_t iloc = m_cheb_rates.install(reactionNumber(), r); + m_cheb_rates.install(reactionNumber(), r); // add a dummy entry in m_rfn, where computed rate coeff will be put m_rfn.push_back(0.0); m_fwdOrder.push_back(r.reactants.size()); - registerReaction(reactionNumber(), CHEBYSHEV_RXN, iloc); } void GasKinetics::installReagents(const ReactionData& r) diff --git a/src/kinetics/InterfaceKinetics.cpp b/src/kinetics/InterfaceKinetics.cpp index 6a042ebcd..91e604aa2 100644 --- a/src/kinetics/InterfaceKinetics.cpp +++ b/src/kinetics/InterfaceKinetics.cpp @@ -121,7 +121,6 @@ InterfaceKinetics& InterfaceKinetics::operator=(const InterfaceKinetics& right) m_revindex = right.m_revindex; m_rates = right.m_rates; m_redo_rates = right.m_redo_rates; - m_index = right.m_index; m_irrev = right.m_irrev; m_rxnstoich = right.m_rxnstoich; m_nirrev = right.m_nirrev; @@ -936,7 +935,7 @@ void InterfaceKinetics::addElementaryReaction(ReactionData& rdata) /* * Install the reaction rate into the vector of reactions handled by this class */ - size_t iloc = m_rates.install(m_ii, rdata); + m_rates.install(m_ii, rdata); /* * Change the reaction rate coefficient type back to its original value @@ -968,7 +967,6 @@ void InterfaceKinetics::addElementaryReaction(ReactionData& rdata) // add constant term to rate coeff value vector m_rfn.push_back(rdata.rateCoeffParameters[0]); - registerReaction(reactionNumber(), ELEMENTARY_RXN, iloc); } void InterfaceKinetics::addGlobalReaction(ReactionData& rdata) @@ -1001,7 +999,7 @@ void InterfaceKinetics::addGlobalReaction(ReactionData& rdata) /* * Install the reaction rate into the vector of reactions handled by this class */ - size_t iloc = m_rates.install(m_ii, rdata); + m_rates.install(m_ii, rdata); /* * Change the reaction rate coefficient type back to its original value @@ -1059,7 +1057,6 @@ void InterfaceKinetics::addGlobalReaction(ReactionData& rdata) // add constant term to rate coeff value vector m_rfn.push_back(rdata.rateCoeffParameters[0]); - registerReaction(m_ii, ELEMENTARY_RXN, iloc); } void InterfaceKinetics::setIOFlag(int ioFlag) @@ -1337,12 +1334,6 @@ void InterfaceKinetics::setPhaseStability(const size_t iphase, const int isStabl } } -void InterfaceKinetics::registerReaction(size_t rxnNumber, int type, size_t loc) -{ - // type and loc is storred as a pair of values. - m_index[rxnNumber] = std::pair(type, loc); -} - void InterfaceKinetics::determineFwdOrdersBV(ReactionData& rdata, std::vector& fwdFullorders) { // Start out with the full ROP orders vector.