Skip to content

Commit

Permalink
Fix indexing error in ImplicitSurfChem::eval
Browse files Browse the repository at this point in the history
This method was not working in the case where there was more than one surface
phase, since 'loc' was always set to zero.
  • Loading branch information
speth committed Nov 24, 2015
1 parent a75a8f2 commit 2dfa43f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/kinetics/ImplicitSurfChem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,12 @@ void ImplicitSurfChem::eval(doublereal time, doublereal* y,
{
updateState(y); // synchronize the surface state(s) with y
doublereal rs0, sum;
size_t loc, kstart;
size_t loc = 0, kstart;
for (size_t n = 0; n < m_nsurf; n++) {
rs0 = 1.0/m_surf[n]->siteDensity();
m_vecKinPtrs[n]->getNetProductionRates(m_work.data());
kstart = m_vecKinPtrs[n]->kineticsSpeciesIndex(0,m_surfindex[n]);
sum = 0.0;
loc = 0;
for (size_t k = 1; k < m_nsp[n]; k++) {
ydot[k + loc] = m_work[kstart + k] * rs0 * m_surf[n]->size(k);
sum -= ydot[k];
Expand Down

0 comments on commit 2dfa43f

Please sign in to comment.