diff --git a/dune/solvers/iterationsteps/blockgsstep.cc b/dune/solvers/iterationsteps/blockgsstep.cc index 8f49cc47059f90ab7e6ae8492a02f2a55552d261..ab3f3ff4cbd729350da8ea2e78e126f24f1dc9bb 100644 --- a/dune/solvers/iterationsteps/blockgsstep.cc +++ b/dune/solvers/iterationsteps/blockgsstep.cc @@ -57,24 +57,18 @@ void BlockGSStep<OperatorType, DiscFuncType, BitVectorType>::iterate() // No degree of freedom shall be ignored --> solve linear problem mat[i][i].solve(v, r); } else { - // Copy the matrix and adjust rhs so that dofs given in ignoreNodes[i] + // Copy the matrix and adjust rhs and matrix so that dofs given in ignoreNodes[i] // are not touched - typename OperatorType::block_type matRes = mat[i][i]; + typename OperatorType::block_type matRes; for (int j = 0; j < BlockSize; ++j) { if ((*this->ignoreNodes_)[i][j]) { r[j] = 0; - for (int k = 0; k < BlockSize; ++k) { - if (k == j) - continue; + for (int k = 0; k < BlockSize; ++k) + matRes[j][k] = (k == j); + } else + matRes[j] == mat[i][i][j]; - 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); }