Skip to content

Commit

Permalink
[Kinetics] Eliminate unnecessary variable m_rxntype
Browse files Browse the repository at this point in the history
  • Loading branch information
speth committed Jul 20, 2015
1 parent f623e44 commit 62f2af5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
7 changes: 2 additions & 5 deletions include/cantera/kinetics/Kinetics.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -663,7 +662,7 @@ class Kinetics
* @param i reaction index
*/
virtual int reactionType(size_t i) const {
return m_rxntype[i];
return m_reactions[i]->reaction_type;
}

/**
Expand Down Expand Up @@ -938,8 +937,6 @@ class Kinetics
//! 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
/*!
Expand Down
2 changes: 1 addition & 1 deletion src/kinetics/GasKinetics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
3 changes: 1 addition & 2 deletions src/kinetics/InterfaceKinetics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/kinetics/Kinetics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 62f2af5

Please sign in to comment.