Skip to content

Commit

Permalink
[Reactor] Add bounds check on sensitivity parameter index
Browse files Browse the repository at this point in the history
  • Loading branch information
speth committed Jul 8, 2015
1 parent b7f2451 commit d44f46a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/cantera/zeroD/ReactorNet.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ class ReactorNet : public FuncEval
if (!m_init) {
initialize();
}
if (p >= m_sensIndex.size()) {
throw IndexError("ReactorNet::sensitivity",
"m_sensIndex", p, m_sensIndex.size()-1);
}
return m_integ->sensitivity(k, m_sensIndex[p])/m_integ->solution(k);
}

Expand Down

0 comments on commit d44f46a

Please sign in to comment.