]> https://gitweb.dealii.org/ - dealii.git/commitdiff
PETScWrappers::NonlinearSolver: support strict error codes 15769/head
authorStefano Zampini <stefano.zampini@gmail.com>
Wed, 19 Jul 2023 17:18:42 +0000 (19:18 +0200)
committerLuca Heltai <luca.heltai@sissa.it>
Fri, 21 Jul 2023 10:31:12 +0000 (12:31 +0200)
include/deal.II/lac/petsc_snes.templates.h

index 6feeda5b5a33d0c80cfa8e890ffdf3f70d4bc0a0..cbe8d09f26b290f67297066ef3964b4af8928cb0 100644 (file)
@@ -364,7 +364,7 @@ namespace PETScWrappers
           PETSC_ERROR_INITIAL,
           "Failure in snes_function from dealii::PETScWrappers::NonlinearSolver");
       petsc_increment_state_counter(f);
-      PetscFunctionReturn(0);
+      PetscFunctionReturn(PETSC_SUCCESS);
     };
 
     const auto snes_jacobian =
@@ -408,7 +408,7 @@ namespace PETScWrappers
       else
         petsc_increment_state_counter(A);
 
-      PetscFunctionReturn(0);
+      PetscFunctionReturn(PETSC_SUCCESS);
     };
 
     const auto snes_jacobian_with_setup =
@@ -461,7 +461,7 @@ namespace PETScWrappers
         }
       else
         petsc_increment_state_counter(A);
-      PetscFunctionReturn(0);
+      PetscFunctionReturn(PETSC_SUCCESS);
     };
 
     const auto snes_monitor =
@@ -489,7 +489,7 @@ namespace PETScWrappers
           PETSC_ERR_LIB,
           PETSC_ERROR_INITIAL,
           "Failure in snes_monitor from dealii::PETScWrappers::NonlinearSolver");
-      PetscFunctionReturn(0);
+      PetscFunctionReturn(PETSC_SUCCESS);
     };
 
     const auto snes_objective =
@@ -519,7 +519,7 @@ namespace PETScWrappers
           PETSC_ERROR_INITIAL,
           "Failure in snes_objective from dealii::PETScWrappers::NonlinearSolver");
       *f = v;
-      PetscFunctionReturn(0);
+      PetscFunctionReturn(PETSC_SUCCESS);
     };
 
     AssertThrow(residual,
@@ -623,7 +623,7 @@ namespace PETScWrappers
     // a zero error code -- if so, just eat the exception and
     // continue on; otherwise, just rethrow the exception
     // and get outta here.
-    const int status = SNESSolve(snes, nullptr, x.petsc_vector());
+    const PetscErrorCode status = SNESSolve(snes, nullptr, x.petsc_vector());
     if (pending_exception)
       {
         try

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.