Skip to content

Commit fe78cfb

Browse files
committed
Fix reaction config scope in particles
1 parent edd0f36 commit fe78cfb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/libcadet/model/particle/GeneralRateParticle.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ namespace model
162162
paramProvider.popScope();
163163
}
164164

165+
MultiplexedScopeSelector scopeGuard(paramProvider, "reaction", _dynReaction->usesParamProviderInDiscretizationConfig());
165166
reactionConfSuccess = _dynReaction->configureModelDiscretization(paramProvider, _nComp, _nBound.get(), _parDiffOp->offsetBoundComp()) && reactionConfSuccess;
166167
}
167168

src/libcadet/model/particle/HomogeneousParticle.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ namespace model
176176
paramProvider.popScope();
177177
}
178178

179+
MultiplexedScopeSelector scopeGuard(paramProvider, "reaction", _dynReaction->usesParamProviderInDiscretizationConfig());
179180
reactionConfSuccess = _dynReaction->configureModelDiscretization(paramProvider, _nComp, _nBound.get(), _boundOffset) && reactionConfSuccess;
180181
}
181182

@@ -404,24 +405,22 @@ namespace model
404405

405406
void HomogeneousParticle::setParJacPattern(std::vector<Eigen::Triplet<double>>& tripletList, const unsigned int offsetPar, const unsigned int offsetBulk, unsigned int colNode, unsigned int secIdx) const
406407
{
407-
// binding Jacobian pattern
408-
// add dense nComp * nBound blocks, since all solid and liquid entries can be coupled through binding.
408+
// binding and reaction Jacobian pattern
409+
// add dense nComp * nBound blocks, since all solid and liquid entries can be coupled through reaction and or binding.
409410
for (unsigned int parState = 0; parState < _nComp + _strideBound; parState++) {
410411
for (unsigned int toParState = 0; toParState < _nComp + _strideBound; toParState++) {
411412
tripletList.push_back(Eigen::Triplet<double>(offsetPar + parState, offsetPar + toParState, 0.0));
412413
}
413414
}
414415

415416
// flux Jacobian pattern
416-
417417
for (unsigned int comp = 0; comp < _nComp; comp++)
418418
{
419419
tripletList.push_back(Eigen::Triplet<double>(offsetPar + comp, offsetBulk + comp, 0.0));
420420
tripletList.push_back(Eigen::Triplet<double>(offsetBulk + comp, offsetPar + comp, 0.0));
421421
}
422422
}
423423

424-
425424
unsigned int HomogeneousParticle::jacobianNNZperParticle() const
426425
{
427426
return (_nComp + _strideBound) * (_nComp + _strideBound) + _nComp * 4; // reaction, binding patter + film diffusion pattern for one particle

0 commit comments

Comments
 (0)