Skip to content

Commit

Permalink
Merge pull request #506 from ginkgo-project/ilu_pteconditioner_assure…
Browse files Browse the repository at this point in the history
…_linearity

This vector copy ensures linearity of the preconditioner when iterative solvers are used for the triangular systems.

Without the additional copy, the solution vector is used as initial guess to the second solver, no matter its content. When only doing a few iterations, this initial guess still has a strong influence on the result and, depending what is in the respective initial guess vecotrs, we cannot assume the following equality:
prec(x_1) + prec(x_2) = prec(x_1 + x_2)

(here, prec(x) means applying the preconditioner to a vector x)

Especially for preconditioned GMRES, this leads to errors in the result.

Related PR: #506
  • Loading branch information
fritzgoebel authored Apr 24, 2020
2 parents be2eb46 + cdbbab4 commit dd890cb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/ginkgo/core/preconditioner/ilu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,11 @@ class Ilu : public EnableLinOp<
set_cache_to(b);
if (!ReverseApply) {
l_solver_->apply(b, cache_.intermediate.get());
x->copy_from(cache_.intermediate.get());
u_solver_->apply(cache_.intermediate.get(), x);
} else {
u_solver_->apply(b, cache_.intermediate.get());
x->copy_from(cache_.intermediate.get());
l_solver_->apply(cache_.intermediate.get(), x);
}
}
Expand Down

0 comments on commit dd890cb

Please sign in to comment.