From e4876200a39e9ec5fa41e1e75a2e4c56c9644e41 Mon Sep 17 00:00:00 2001 From: frohne Date: Wed, 3 Apr 2013 20:23:49 +0000 Subject: [PATCH] trying the Bicgstab solver git-svn-id: https://svn.dealii.org/trunk@29167 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-42/step-42.cc | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/deal.II/examples/step-42/step-42.cc b/deal.II/examples/step-42/step-42.cc index 2e904aefb2..129d8f7c96 100644 --- a/deal.II/examples/step-42/step-42.cc +++ b/deal.II/examples/step-42/step-42.cc @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -1262,17 +1263,32 @@ namespace Step42 const double solver_tolerance = 1e-3 * system_matrix_newton.residual (tmp, distributed_solution, system_rhs_newton); +// SolverControl solver_control (system_matrix_newton.m(), solver_tolerance); +// SolverFGMRES +// solver(solver_control, mem, +// SolverFGMRES:: +// AdditionalData(30, true)); +// +// solver.solve(system_matrix_newton, distributed_solution, system_rhs_newton, preconditioner_u); +// +// pcout << " Error: " << solver_control.initial_value() +// << " -> " << solver_control.last_value() +// << " in " << solver_control.last_step() +// << " FGMRES iterations." +// << std::endl; + SolverControl solver_control (system_matrix_newton.m(), solver_tolerance); - SolverFGMRES + SolverBicgstab solver(solver_control, mem, - SolverFGMRES:: - AdditionalData(30, true)); + SolverBicgstab:: + AdditionalData(false, 1.e-10)); + solver.solve(system_matrix_newton, distributed_solution, system_rhs_newton, preconditioner_u); pcout << " Error: " << solver_control.initial_value() << " -> " << solver_control.last_value() << " in " << solver_control.last_step() - << " FGMRES iterations." + << " Bicgstab iterations." << std::endl; computing_timer.exit_section("Solve: iterate"); -- 2.39.5