BUG: incorrect cellId check in fvMatrix::setReferences()

This commit is contained in:
Mark Olesen
2018-03-02 13:17:54 +01:00
parent 53ab527b45
commit 330b113abc

View File

@ -527,14 +527,14 @@ void Foam::fvMatrix<Type>::setReferences
const bool forceReference const bool forceReference
) )
{ {
bool needRef = (forceReference || psi_.needReference()); const bool needRef = (forceReference || psi_.needReference());
if (needRef) if (needRef)
{ {
forAll(cellLabels, celli) forAll(cellLabels, celli)
{ {
label cellId = cellLabels[celli]; const label cellId = cellLabels[celli];
if (celli >= 0) if (cellId >= 0)
{ {
source()[cellId] += diag()[cellId]*values[celli]; source()[cellId] += diag()[cellId]*values[celli];
diag()[cellId] += diag()[cellId]; diag()[cellId] += diag()[cellId];