From b6475d8eba894edb2dd89a756a7469a484c7b403 Mon Sep 17 00:00:00 2001 From: Max Kahnt <max.kahnt@fu-berlin.de> Date: Wed, 21 May 2014 11:11:26 +0200 Subject: [PATCH] Fix TruncatedBlockGSStep localExactSolve. FieldMatrix::solve method should be used. The code assumed that all diagonal elements were nonzero before truncation. In this case any zero diagonal element was due to truncation and hence setting it to one was alright. Now instead, we do not assume nonzero diagonal elements. We check for truncation of diagonal elements instead (and assert that they were set to zero before in the truncation step). Then setting these entries to one (but not the ones which were zero a-priori) is alright and we do not solve a modified system. --- dune/solvers/iterationsteps/truncatedblockgsstep.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dune/solvers/iterationsteps/truncatedblockgsstep.hh b/dune/solvers/iterationsteps/truncatedblockgsstep.hh index 6069091b..1381e3a9 100644 --- a/dune/solvers/iterationsteps/truncatedblockgsstep.hh +++ b/dune/solvers/iterationsteps/truncatedblockgsstep.hh @@ -301,8 +301,9 @@ public: typename MBlock::row_type::Iterator inner_it = A[i].begin(); typename MBlock::row_type::Iterator inner_end = A[i].end(); for(; inner_it!=inner_end; ++inner_it) - if (inner_it.index()==i and *inner_it==0.0) + if (ignore[i] && inner_it.index()==i) { + assert(*inner_it == 0.0); *inner_it = 1.0; b[i] = x[i]; } -- GitLab