diff --git a/include/cantera/kinetics/AqueousKinetics.h b/include/cantera/kinetics/AqueousKinetics.h index 1cfe43c60..96e94e8d5 100644 --- a/include/cantera/kinetics/AqueousKinetics.h +++ b/include/cantera/kinetics/AqueousKinetics.h @@ -123,10 +123,6 @@ public: //! @name Reaction Mechanism Informational Query Routines //! @{ - virtual int reactionType(size_t i) const { - return getValue(m_index, i).first; - } - virtual bool isReversible(size_t i) { if (std::find(m_revindex.begin(), m_revindex.end(), i) < m_revindex.end()) { @@ -189,8 +185,6 @@ protected: std::map > m_rgroups; std::map > m_pgroups; - std::vector m_rxntype; - std::vector > m_rrxn; std::vector > m_prxn; diff --git a/include/cantera/kinetics/GasKinetics.h b/include/cantera/kinetics/GasKinetics.h index cec3092ea..3786bfad9 100644 --- a/include/cantera/kinetics/GasKinetics.h +++ b/include/cantera/kinetics/GasKinetics.h @@ -100,10 +100,6 @@ public: //! @name Reaction Mechanism Informational Query Routines //! @{ - virtual int reactionType(size_t i) const { - return getValue(m_index, i).first; - } - virtual bool isReversible(size_t i) { if (std::find(m_revindex.begin(), m_revindex.end(), i) < m_revindex.end()) { @@ -167,8 +163,6 @@ protected: size_t m_nirrev; size_t m_nrev; - std::vector m_rxntype; - std::vector > m_rrxn; std::vector > m_prxn; diff --git a/include/cantera/kinetics/InterfaceKinetics.h b/include/cantera/kinetics/InterfaceKinetics.h index 64572d1e8..3c1ae97b9 100644 --- a/include/cantera/kinetics/InterfaceKinetics.h +++ b/include/cantera/kinetics/InterfaceKinetics.h @@ -183,14 +183,6 @@ public: */ virtual doublereal productStoichCoeff(size_t kSpecKin, size_t irxn) const; - //! return the reaction type of the reaction irxn - /*! - * @param[in] Reaction index - * - * @return Returns the reaction type of the reaction. - */ - virtual int reactionType(size_t irxn) const; - virtual void getActivityConcentrations(doublereal* const conc); @@ -511,13 +503,6 @@ protected: */ std::vector > m_prxn; - //! Vector of reactionType for the reactions defined within this object - /*! - * Length = number of reactions, m_ii - * contains the type of reaction. - */ - vector_int reactionType_; - public: //! Vector of additional information about each reaction /*! @@ -623,12 +608,6 @@ protected: //! Pointer to the single surface phase SurfPhase* m_surf; - //! Vector of reaction types - /*! - * Length = m_ii the number of reactions in the mechanism. - */ - vector_int reactionTypes_; - //! Pointer to the Implicit surface chemistry object /*! * Note this object is owned by this InterfaceKinetics object. It may only diff --git a/include/cantera/kinetics/Kinetics.h b/include/cantera/kinetics/Kinetics.h index c6a60e81f..74850b796 100644 --- a/include/cantera/kinetics/Kinetics.h +++ b/include/cantera/kinetics/Kinetics.h @@ -681,7 +681,7 @@ public: * @param i reaction index */ virtual int reactionType(size_t i) const { - throw NotImplementedError("Kinetics::reactionType"); + return m_rxntype[i]; } /** @@ -909,6 +909,8 @@ protected: */ std::vector > m_products; + std::vector m_rxntype; + //! m_thermo is a vector of pointers to ThermoPhase objects that are //! involved with this kinetics operator /*! diff --git a/src/kinetics/ElectrodeKinetics.cpp b/src/kinetics/ElectrodeKinetics.cpp index ebbfc5e26..4ca282572 100644 --- a/src/kinetics/ElectrodeKinetics.cpp +++ b/src/kinetics/ElectrodeKinetics.cpp @@ -207,7 +207,7 @@ void ElectrodeKinetics::updateROP() for (size_t iBeta = 0; iBeta < m_beta.size(); iBeta++) { size_t irxn = m_ctrxn[iBeta]; - int reactionType = reactionTypes_[irxn]; + int reactionType = m_rxntype[irxn]; if (reactionType == BUTLERVOLMER_RXN) { // // Get the beta value @@ -778,7 +778,7 @@ getExchangeCurrentDensityFormulation(size_t irxn, double mG0 = m_deltaG0[irxn]; - int reactionType = reactionTypes_[irxn]; + int reactionType = m_rxntype[irxn]; // // Start with the forward reaction rate diff --git a/src/kinetics/GasKinetics.cpp b/src/kinetics/GasKinetics.cpp index c5356c890..a326b49c8 100644 --- a/src/kinetics/GasKinetics.cpp +++ b/src/kinetics/GasKinetics.cpp @@ -74,7 +74,6 @@ GasKinetics& GasKinetics::operator=(const GasKinetics& right) m_fwdOrder = right.m_fwdOrder; m_nirrev = right.m_nirrev; m_nrev = right.m_nrev; - m_rxntype = right.m_rxntype; m_rrxn = right.m_rrxn; m_prxn = right.m_prxn; m_dn = right.m_dn; @@ -494,7 +493,6 @@ void GasKinetics::addReaction(ReactionData& r) // operations common to all reaction types Kinetics::addReaction(r); - m_rxntype.push_back(r.reactionType); } void GasKinetics::addFalloffReaction(ReactionData& r) diff --git a/src/kinetics/InterfaceKinetics.cpp b/src/kinetics/InterfaceKinetics.cpp index ed636dd32..6a042ebcd 100644 --- a/src/kinetics/InterfaceKinetics.cpp +++ b/src/kinetics/InterfaceKinetics.cpp @@ -128,7 +128,6 @@ InterfaceKinetics& InterfaceKinetics::operator=(const InterfaceKinetics& right) m_nrev = right.m_nrev; m_rrxn = right.m_rrxn; m_prxn = right.m_prxn; - reactionType_ = right.reactionType_; m_conc = right.m_conc; m_actConc = right.m_actConc; m_mu0 = right.m_mu0; @@ -636,7 +635,7 @@ void InterfaceKinetics::updateROP() // Fix up these calculations for cases where the above formalism doesn't hold double OCV = 0.0; for (size_t jrxn = 0; jrxn != m_ii; ++jrxn) { - int reactionType = reactionTypes_[jrxn]; + int reactionType = m_rxntype[jrxn]; if (reactionType == BUTLERVOLMER_RXN) { // // OK, the reaction rate constant contains the current density rate constant calculation @@ -871,8 +870,6 @@ void InterfaceKinetics::addReaction(ReactionData& r) { int reactionType = r.reactionType; - reactionType_.push_back(reactionType); - if ((reactionType == BUTLERVOLMER_NOACTIVITYCOEFFS_RXN ) || (reactionType == BUTLERVOLMER_RXN ) || (reactionType == SURFACEAFFINITY_RXN) || @@ -924,7 +921,6 @@ void InterfaceKinetics::addElementaryReaction(ReactionData& rdata) // Find out the reaction type int reactionType = rdata.reactionType; - reactionTypes_.push_back(reactionType); /* * Temporarily change the reaction rate coefficient type to surface arrhenius. @@ -990,7 +986,6 @@ void InterfaceKinetics::addGlobalReaction(ReactionData& rdata) // Find out the reaction type int reactionType = rdata.reactionType; - reactionTypes_.push_back(reactionType); /* * Temporarily change the reaction rate coefficient type to surface arrhenius. @@ -1330,11 +1325,6 @@ doublereal InterfaceKinetics::productStoichCoeff(size_t kSpecKin, size_t irxn) c return getValue(m_prxn[kSpecKin], irxn, 0.0); } -int InterfaceKinetics::reactionType(size_t irxn) const -{ - return reactionType_[irxn]; -} - void InterfaceKinetics::setPhaseStability(const size_t iphase, const int isStable) { if (iphase >= m_thermo.size()) { diff --git a/src/kinetics/Kinetics.cpp b/src/kinetics/Kinetics.cpp index 0cf55b07d..9d271b3c2 100644 --- a/src/kinetics/Kinetics.cpp +++ b/src/kinetics/Kinetics.cpp @@ -65,6 +65,7 @@ Kinetics& Kinetics::operator=(const Kinetics& right) m_perturb = right.m_perturb; m_reactants = right.m_reactants; m_products = right.m_products; + m_rxntype = right.m_rxntype; m_thermo = right.m_thermo; // DANGER -> shallow pointer copy @@ -299,6 +300,7 @@ void Kinetics::addReaction(ReactionData& r) { m_rxneqn.push_back(r.equation); m_reactantStrings.push_back(r.reactantString); m_productStrings.push_back(r.productString); + m_rxntype.push_back(r.reactionType); } void Kinetics::installGroups(size_t irxn, const vector& r,