From d8772f261b4bed59e0a261114563d73052ea31e5 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Tue, 21 Jul 2015 14:43:24 -0400 Subject: [PATCH] [Reactor] Cannot add sensitivity reactions to initialized ReactorNet Before, the attempt to add the reaction was silently ignored. Now, this raises an exception. --- src/zeroD/ReactorNet.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/zeroD/ReactorNet.cpp b/src/zeroD/ReactorNet.cpp index 7562f047b..41e0effe5 100644 --- a/src/zeroD/ReactorNet.cpp +++ b/src/zeroD/ReactorNet.cpp @@ -213,6 +213,11 @@ size_t ReactorNet::globalComponentIndex(const string& component, size_t reactor) void ReactorNet::registerSensitivityReaction(void* reactor, size_t reactionIndex, const std::string& name, int leftright) { + if (m_integrator_init) { + throw CanteraError("ReactorNet::registerSensitivityReaction", + "Sensitivity reactions cannot be added after the" + "integrator has been initialized."); + } std::pair R = std::make_pair(reactor, leftright); if (m_sensOrder.count(R) && m_sensOrder[R].count(reactionIndex)) {