From d2f4228a1a59e545813764e822c91a4f4c42263a Mon Sep 17 00:00:00 2001 From: bangerth Date: Fri, 15 Oct 2010 21:18:07 +0000 Subject: [PATCH] Make failure mode more explicit. git-svn-id: https://svn.dealii.org/trunk@22351 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/source/trilinos_solver.cc | 28 +++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/deal.II/lac/source/trilinos_solver.cc b/deal.II/lac/source/trilinos_solver.cc index aadc4b0bd7..18517f414e 100644 --- a/deal.II/lac/source/trilinos_solver.cc +++ b/deal.II/lac/source/trilinos_solver.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2008 by the deal.II authors +// Copyright (C) 2008, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -129,7 +129,31 @@ namespace TrilinosWrappers // ... and then solve! ierr = solver.Iterate (solver_control.max_steps(), solver_control.tolerance()); - AssertThrow (ierr >= 0, ExcTrilinosError(ierr)); + + // report errors in more detail + // than just by checking whether + // the return status is zero or + // greater. the error strings are + // taken from the implementation + // of the AztecOO::Iterate + // function + switch (ierr) + { + case -1: + AssertThrow (false, ExcMessage("AztecOO::Iterate error code -1: " + "option not implemented")); + case -2: + AssertThrow (false, ExcMessage("AztecOO::Iterate error code -2: " + "numerical breakdown")); + case -3: + AssertThrow (false, ExcMessage("AztecOO::Iterate error code -3: " + "loss of precision")); + case -4: + AssertThrow (false, ExcMessage("AztecOO::Iterate error code -4: " + "GMRES hessenberg ill-conditioned")); + default: + AssertThrow (ierr >= 0, ExcTrilinosError(ierr)); + } // Finally, let the deal.II // SolverControl object know -- 2.39.5