]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix exception catch 2814/head
authorDenis Davydov <davydden@gmail.com>
Tue, 12 Jul 2016 13:51:41 +0000 (15:51 +0200)
committerDenis Davydov <davydden@gmail.com>
Tue, 12 Jul 2016 13:51:41 +0000 (15:51 +0200)
tests/petsc_complex/solver_real_01.cc
tests/petsc_complex/solver_real_01.output
tests/petsc_complex/solver_real_01.output.2 [deleted file]
tests/petsc_complex/solver_real_02.cc
tests/petsc_complex/solver_real_02.output
tests/petsc_complex/solver_real_02.output.2 [deleted file]

index c5126c999e0783d1eb13e018ae6c655ae5768f70..383e017417ad86814ce06c7552cbfc20a8e443bf 100644 (file)
@@ -46,12 +46,9 @@ check_solve( SOLVER &solver, const MATRIX &A,
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exception &e)
+  catch (dealii::SolverControl::NoConvergence &e)
     {
-      deallog << e.what() << std::endl;
-      // it needs to be expected for the
-      // richardson solver that we end up
-      // here, so don't abort
+      deallog << "Exception: " << e.get_exc_name() << std::endl;
     }
 
   deallog << "Solver stopped after " << solver.control().last_step()
@@ -93,4 +90,3 @@ int main(int argc, char **argv)
     check_solve (solver, A,u,f, preconditioner);
   }
 }
-
index 79c6bb04096d45e2c56a338858c7d5573a96d666..dbab15846c21d4adc218d78c53b97ac68bb0b1e8 100644 (file)
@@ -3,20 +3,5 @@ DEAL::Size 32 Unknowns 961
 DEAL::Solver type: N6dealii13PETScWrappers16SolverRichardsonE
 DEAL::Starting value 7.750
 DEAL::Failure step 100 value 4.004
-DEAL::
---------------------------------------------------------
-An error occurred in file <petsc_solver.cc> in function
-    void dealii::PETScWrappers::SolverBase::solve(const dealii::PETScWrappers::MatrixBase &, dealii::PETScWrappers::VectorBase &, const dealii::PETScWrappers::VectorBase &, const dealii::PETScWrappers::PreconditionerBase &)
-The violated condition was: 
-    false
-The name and call sequence of the exception was:
-    SolverControl::NoConvergence (solver_control.last_step(), solver_control.last_value())
-Additional Information: 
-Iterative method reported convergence failure in step 100. The residual in the last step was 4.00437.
-
-This error message can indicate that you have simply not allowed a sufficiently large number of iterations for your iterative solver to converge. This often happens when you increase the size of your problem. In such cases, the last residual will likely still be very small, and you can make the error go away by increasing the allowed number of iterations when setting up the SolverControl object that determines the maximal number of iterations you allow.
-
-The other situation where this error may occur is when your matrix is not invertible (e.g., your matrix has a null-space), or if you try to apply the wrong solver to a matrix (e.g., using CG for a matrix that is not symmetric or not positive definite). In these cases, the residual in the last iteration is likely going to be large.
---------------------------------------------------------
-
+DEAL::Exception: SolverControl::NoConvergence (solver_control.last_step(), solver_control.last_value())
 DEAL::Solver stopped after 100 iterations
diff --git a/tests/petsc_complex/solver_real_01.output.2 b/tests/petsc_complex/solver_real_01.output.2
deleted file mode 100644 (file)
index c822840..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-
-DEAL::Size 32 Unknowns 961
-DEAL::Solver type: N6dealii13PETScWrappers16SolverRichardsonE
-DEAL::Starting value 7.750
-DEAL::Failure step 100 value 4.004
-DEAL::
---------------------------------------------------------
-An error occurred in file <petsc_solver.cc> in function
-    void dealii::PETScWrappers::SolverBase::solve(const dealii::PETScWrappers::MatrixBase&, dealii::PETScWrappers::VectorBase&, const dealii::PETScWrappers::VectorBase&, const dealii::PETScWrappers::PreconditionerBase&)
-The violated condition was: 
-    false
-The name and call sequence of the exception was:
-    SolverControl::NoConvergence (solver_control.last_step(), solver_control.last_value())
-Additional Information: 
-Iterative method reported convergence failure in step 100. The residual in the last step was 4.00437.
-
-This error message can indicate that you have simply not allowed a sufficiently large number of iterations for your iterative solver to converge. This often happens when you increase the size of your problem. In such cases, the last residual will likely still be very small, and you can make the error go away by increasing the allowed number of iterations when setting up the SolverControl object that determines the maximal number of iterations you allow.
-
-The other situation where this error may occur is when your matrix is not invertible (e.g., your matrix has a null-space), or if you try to apply the wrong solver to a matrix (e.g., using CG for a matrix that is not symmetric or not positive definite). In these cases, the residual in the last iteration is likely going to be large.
---------------------------------------------------------
-
-DEAL::Solver stopped after 100 iterations
index 8d952c928573fa6031d7ee1072da1a31a6d5b696..8536e318f16c713b55ebf1013e313c5659afa54a 100644 (file)
@@ -45,11 +45,9 @@ check_solve( SOLVER &solver, const MATRIX &A,
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exception &e)
+  catch (dealii::SolverControl::NoConvergence &e)
     {
-      deallog << e.what() << std::endl;
-      // just like for Richardson: we end up
-      // here normally for this solver
+      deallog << "Exception: " << e.get_exc_name() << std::endl;
     }
 
   deallog << "Solver stopped after " << solver.control().last_step()
@@ -92,4 +90,3 @@ int main(int argc, char **argv)
   }
 
 }
-
index 0dc47c2a6c846f65618392ea523eb409ae73efcb..00c1e2226c669c55b2cdfe4fbf09011a659f140f 100644 (file)
@@ -3,20 +3,5 @@ DEAL::Size 32 Unknowns 961
 DEAL::Solver type: N6dealii13PETScWrappers15SolverChebychevE
 DEAL::Starting value 7.551
 DEAL::Failure step 100 value 2.937
-DEAL::
---------------------------------------------------------
-An error occurred in file <petsc_solver.cc> in function
-    void dealii::PETScWrappers::SolverBase::solve(const dealii::PETScWrappers::MatrixBase &, dealii::PETScWrappers::VectorBase &, const dealii::PETScWrappers::VectorBase &, const dealii::PETScWrappers::PreconditionerBase &)
-The violated condition was: 
-    false
-The name and call sequence of the exception was:
-    SolverControl::NoConvergence (solver_control.last_step(), solver_control.last_value())
-Additional Information: 
-Iterative method reported convergence failure in step 100. The residual in the last step was 2.9372.
-
-This error message can indicate that you have simply not allowed a sufficiently large number of iterations for your iterative solver to converge. This often happens when you increase the size of your problem. In such cases, the last residual will likely still be very small, and you can make the error go away by increasing the allowed number of iterations when setting up the SolverControl object that determines the maximal number of iterations you allow.
-
-The other situation where this error may occur is when your matrix is not invertible (e.g., your matrix has a null-space), or if you try to apply the wrong solver to a matrix (e.g., using CG for a matrix that is not symmetric or not positive definite). In these cases, the residual in the last iteration is likely going to be large.
---------------------------------------------------------
-
+DEAL::Exception: SolverControl::NoConvergence (solver_control.last_step(), solver_control.last_value())
 DEAL::Solver stopped after 100 iterations
diff --git a/tests/petsc_complex/solver_real_02.output.2 b/tests/petsc_complex/solver_real_02.output.2
deleted file mode 100644 (file)
index 66cb6ea..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-
-DEAL::Size 32 Unknowns 961
-DEAL::Solver type: N6dealii13PETScWrappers15SolverChebychevE
-DEAL::Starting value 7.551
-DEAL::Failure step 100 value 2.937
-DEAL::
---------------------------------------------------------
-An error occurred in file <petsc_solver.cc> in function
-    void dealii::PETScWrappers::SolverBase::solve(const dealii::PETScWrappers::MatrixBase&, dealii::PETScWrappers::VectorBase&, const dealii::PETScWrappers::VectorBase&, const dealii::PETScWrappers::PreconditionerBase&)
-The violated condition was: 
-    false
-The name and call sequence of the exception was:
-    SolverControl::NoConvergence (solver_control.last_step(), solver_control.last_value())
-Additional Information: 
-Iterative method reported convergence failure in step 100. The residual in the last step was 2.9372.
-
-This error message can indicate that you have simply not allowed a sufficiently large number of iterations for your iterative solver to converge. This often happens when you increase the size of your problem. In such cases, the last residual will likely still be very small, and you can make the error go away by increasing the allowed number of iterations when setting up the SolverControl object that determines the maximal number of iterations you allow.
-
-The other situation where this error may occur is when your matrix is not invertible (e.g., your matrix has a null-space), or if you try to apply the wrong solver to a matrix (e.g., using CG for a matrix that is not symmetric or not positive definite). In these cases, the residual in the last iteration is likely going to be large.
---------------------------------------------------------
-
-DEAL::Solver stopped after 100 iterations

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.