diff --git a/dune/solvers/iterationsteps/blockgsstep.cc b/dune/solvers/iterationsteps/blockgsstep.cc index 66144ef11b99809609b0fc8f8b25453deb3bfc05..8f49cc47059f90ab7e6ae8492a02f2a55552d261 100644 --- a/dune/solvers/iterationsteps/blockgsstep.cc +++ b/dune/solvers/iterationsteps/blockgsstep.cc @@ -64,8 +64,16 @@ void BlockGSStep<OperatorType, DiscFuncType, BitVectorType>::iterate() if ((*this->ignoreNodes_)[i][j]) { r[j] = 0; - for (int k = 0; k < BlockSize; ++k) - matRes[j][k] = (k==j); + for (int k = 0; k < BlockSize; ++k) { + if (k == j) + continue; + + matRes[j][k] = 0; + // Since r[j] is zero anyway, this changes + // nothing but simplifies solving + matRes[k][j] = 0; + } + matRes[j][j] = 1; } } matRes.solve(v, r);