[Reactor] Cannot add sensitivity reactions to initialized ReactorNet
Before, the attempt to add the reaction was silently ignored. Now, this raises an exception.
This commit is contained in:
parent
6cc5652de6
commit
d8772f261b
1 changed files with 5 additions and 0 deletions
|
|
@ -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<void*, int> R = std::make_pair(reactor, leftright);
|
||||
if (m_sensOrder.count(R) &&
|
||||
m_sensOrder[R].count(reactionIndex)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue