From d7663aca782f0a1f3335d9c55e714f8499831f3b Mon Sep 17 00:00:00 2001 From: "Toby D. Young" Date: Wed, 24 Feb 2010 09:14:30 +0000 Subject: [PATCH] Assertions generate more meaningful messages in SolverBase solve() git-svn-id: https://svn.dealii.org/trunk@20681 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/slepc_solver.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/deal.II/lac/include/lac/slepc_solver.h b/deal.II/lac/include/lac/slepc_solver.h index 95457f2f75..ecba728777 100644 --- a/deal.II/lac/include/lac/slepc_solver.h +++ b/deal.II/lac/include/lac/slepc_solver.h @@ -270,11 +270,17 @@ namespace SLEPcWrappers * Exceptions. */ DeclException0 (ExcSLEPcWrappersUsageError); + DeclException1 (ExcSLEPcError, int, - << "An error with error number " << arg1 + << " An error with error number " << arg1 << " occured while calling a SLEPc function"); + DeclException2 (ExcSLEPcEigenvectorConvergenceMismatchError, + int, int, + << " The number of converged eigenvectors is " << arg1 + << " but " << arg2 << " were requested. "); + protected: /** @@ -534,7 +540,8 @@ namespace SLEPcWrappers if (n_converged > n_eigenvectors) n_converged = n_eigenvectors; - AssertThrow (n_converged == n_eigenvectors, ExcSLEPcWrappersUsageError()); + AssertThrow (n_converged == n_eigenvectors, + ExcSLEPcEigenvectorConvergenceMismatchError(n_converged, n_eigenvectors)); AssertThrow (vr.size() >= 1, ExcSLEPcWrappersUsageError()); vr.resize (n_converged, vr.front()); @@ -561,8 +568,10 @@ namespace SLEPcWrappers if (n_converged >= n_eigenvectors) n_converged = n_eigenvectors; - AssertThrow (n_converged == n_eigenvectors, ExcSLEPcWrappersUsageError()); + AssertThrow (n_converged == n_eigenvectors, + ExcSLEPcEigenvectorConvergenceMismatchError(n_converged, n_eigenvectors)); AssertThrow (vr.size() >= 1, ExcSLEPcWrappersUsageError()); + vr.resize (n_converged, vr.front()); kr.resize (n_converged); -- 2.39.5