From 05695636b9a4be51f62b13cc63db5c50f6f9b870 Mon Sep 17 00:00:00 2001 From: Stefano Zampini Date: Wed, 19 Jul 2023 19:18:42 +0200 Subject: [PATCH] PETScWrappers::NonlinearSolver: support strict error codes --- include/deal.II/lac/petsc_snes.templates.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/deal.II/lac/petsc_snes.templates.h b/include/deal.II/lac/petsc_snes.templates.h index 6feeda5b5a..cbe8d09f26 100644 --- a/include/deal.II/lac/petsc_snes.templates.h +++ b/include/deal.II/lac/petsc_snes.templates.h @@ -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 -- 2.39.5