From e2ecd2c387983974c927be1aed0cfe5fd7f823c7 Mon Sep 17 00:00:00 2001 From: Simon Praetorius <simon.praetorius@tu-dresden.de> Date: Tue, 30 Oct 2018 23:14:26 -0400 Subject: [PATCH] replaced SeqILU0 with SeqILU in ISTL backend --- .../linear_algebra/istl/ISTL_Preconditioner.hpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/amdis/linear_algebra/istl/ISTL_Preconditioner.hpp b/src/amdis/linear_algebra/istl/ISTL_Preconditioner.hpp index 32f4f917..f6ec6a1b 100644 --- a/src/amdis/linear_algebra/istl/ISTL_Preconditioner.hpp +++ b/src/amdis/linear_algebra/istl/ISTL_Preconditioner.hpp @@ -39,6 +39,7 @@ namespace AMDiS ISTLPrecon(std::string const& prefix) { Parameters::get(prefix + "->relaxation", w_); + Parameters::get(prefix + "->iterations", iter_); } using PreconBase = Dune::Preconditioner<VectorX, VectorB>; @@ -51,13 +52,13 @@ namespace AMDiS template <class P> std::unique_ptr<P> createImpl(Matrix const& A, Type<P>) const { - return std::make_unique<P>(A, 1, w_); + return std::make_unique<P>(A, iter_, w_); } - std::unique_ptr<Dune::SeqILU0<Matrix, VectorX, VectorB>> - createImpl(Matrix const& A, Type<Dune::SeqILU0<Matrix, VectorX, VectorB>>) const + std::unique_ptr<Dune::SeqILU<Matrix, VectorX, VectorB>> + createImpl(Matrix const& A, Type<Dune::SeqILU<Matrix, VectorX, VectorB>>) const { - return std::make_unique<Dune::SeqILU0<Matrix, VectorX, VectorB>>(A, w_); + return std::make_unique<Dune::SeqILU<Matrix, VectorX, VectorB>>(A, iter_, w_); } std::unique_ptr<Dune::Richardson<VectorX, VectorB>> @@ -67,6 +68,7 @@ namespace AMDiS } double w_ = 1.0; + int iter_ = 0; }; @@ -105,7 +107,7 @@ namespace AMDiS auto ssor = new PreconCreator<Dune::SeqSSOR<Matrix, VectorX, VectorB>>; Map::addCreator("ssor", ssor); - auto ilu = new PreconCreator<Dune::SeqILU0<Matrix, VectorX, VectorB>>; + auto ilu = new PreconCreator<Dune::SeqILU<Matrix, VectorX, VectorB>>; Map::addCreator("ilu", ilu); Map::addCreator("ilu0", ilu); -- GitLab