[Kinetics] Eliminate unnecessary variable m_rxntype

This commit is contained in:
Ray Speth 2015-07-20 13:01:05 -04:00
parent f623e44d32
commit 62f2af5534
4 changed files with 4 additions and 10 deletions

View file

@ -13,14 +13,13 @@
#include "cantera/thermo/ThermoPhase.h"
#include "StoichManager.h"
#include "cantera/thermo/mix_defs.h"
#include "cantera/kinetics/Reaction.h"
#include "cantera/base/global.h"
#include "cantera/base/smart_ptr.h"
namespace Cantera
{
class Reaction;
/**
* @defgroup chemkinetics Chemical Kinetics
*/
@ -663,7 +662,7 @@ public:
* @param i reaction index
*/
virtual int reactionType(size_t i) const {
return m_rxntype[i];
return m_reactions[i]->reaction_type;
}
/**
@ -938,8 +937,6 @@ protected:
//! Vector of Reaction objects represented by this Kinetics manager
std::vector<shared_ptr<Reaction> > m_reactions;
std::vector<int> m_rxntype;
//! m_thermo is a vector of pointers to ThermoPhase objects that are
//! involved with this kinetics operator
/*!

View file

@ -151,7 +151,7 @@ void GasKinetics::processFalloffReactions()
m_falloffn.pr_to_falloff(&pr[0], work);
for (size_t i = 0; i < m_nfall; i++) {
if (m_rxntype[m_fallindx[i]] == FALLOFF_RXN) {
if (reactionType(m_fallindx[i]) == FALLOFF_RXN) {
pr[i] *= m_rfn_high[i];
} else { // CHEMACT_RXN
pr[i] *= m_rfn_low[i];

View file

@ -507,8 +507,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 != nReactions(); ++jrxn) {
int reactionType = m_rxntype[jrxn];
if (reactionType == BUTLERVOLMER_RXN) {
if (reactionType(jrxn) == BUTLERVOLMER_RXN) {
//
// OK, the reaction rate constant contains the current density rate constant calculation
// the rxnstoich calculation contained the dependence of the current density on the activity concentrations

View file

@ -51,7 +51,6 @@ Kinetics& Kinetics::operator=(const Kinetics& right)
m_kk = right.m_kk;
m_perturb = right.m_perturb;
m_reactions = right.m_reactions;
m_rxntype = right.m_rxntype;
m_thermo = right.m_thermo; // DANGER -> shallow pointer copy
@ -652,7 +651,6 @@ bool Kinetics::addReaction(shared_ptr<Reaction> r)
m_rxneqn.push_back(r->equation());
m_reactantStrings.push_back(r->reactantString());
m_productStrings.push_back(r->productString());
m_rxntype.push_back(r->reaction_type);
m_rfn.push_back(0.0);
m_rkcn.push_back(0.0);
m_ropf.push_back(0.0);