From 4b7e058b43d140fbc7f1d7e1cd07cdde353c4f2c 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 52e201c58..6e39c02fa 100644 --- a/src/zeroD/ReactorNet.cpp +++ b/src/zeroD/ReactorNet.cpp @@ -234,6 +234,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)) {