From f82fcd5be3070cd2b8bbf122c59d54ce6cb7fa53 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Sun, 20 Nov 2011 11:40:15 +0000 Subject: [PATCH] Partially revert last patch, and improve the implementation some more - shorter code - don't zero out columns, there's no reason to do so - don't copy rows that get overwritten with zeros anyways [[Imported from SVN: r4894]] --- dune/solvers/iterationsteps/blockgsstep.cc | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/dune/solvers/iterationsteps/blockgsstep.cc b/dune/solvers/iterationsteps/blockgsstep.cc index 8f49cc47..ab3f3ff4 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); } -- GitLab