From d5179f1ca9b1ccd0a073d0b83ac7a1ae5e39ecd5 Mon Sep 17 00:00:00 2001 From: "David J. Gardner" Date: Mon, 23 Oct 2023 12:02:37 -0700 Subject: [PATCH] update example nls tolerances --- examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.c | 4 ++++ examples/arkode/C_parallel/ark_diurnal_kry_p.c | 4 ++++ examples/arkode/F2003_serial/ark_analytic_f2003.f90 | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.c b/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.c index 7c8bba1278..8143a128c0 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.c +++ b/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.c @@ -246,6 +246,10 @@ int main(int argc, char *argv[]) mukeep, mlkeep, ZERO, flocal, NULL); if(check_flag(&flag, "ARKBBDPrecInit", 1, my_pe)) MPI_Abort(comm, 1); + /* Tighten nonlinear solver tolerance */ + flag = ARKStepSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); + if(check_flag(&flag, "ARKStepSetNonlinConvCoef", 1, my_pe)) MPI_Abort(comm, 1); + /* Print heading */ if (my_pe == 0) PrintIntro(npes, mudq, mldq, mukeep, mlkeep); diff --git a/examples/arkode/C_parallel/ark_diurnal_kry_p.c b/examples/arkode/C_parallel/ark_diurnal_kry_p.c index 1946966c76..b17ed5f283 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_p.c +++ b/examples/arkode/C_parallel/ark_diurnal_kry_p.c @@ -262,6 +262,10 @@ int main(int argc, char *argv[]) flag = ARKStepSetPreconditioner(arkode_mem, Precond, PSolve); if (check_flag(&flag, "ARKStepSetPreconditioner", 1, my_pe)) MPI_Abort(comm, 1); + /* Tighten nonlinear solver tolerance */ + flag = ARKStepSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); + if(check_flag(&flag, "ARKStepSetNonlinConvCoef", 1, my_pe)) MPI_Abort(comm, 1); + /* Print heading */ if (my_pe == 0) printf("\n2-species diurnal advection-diffusion problem\n\n"); diff --git a/examples/arkode/F2003_serial/ark_analytic_f2003.f90 b/examples/arkode/F2003_serial/ark_analytic_f2003.f90 index 9de6e47616..d8603bb118 100644 --- a/examples/arkode/F2003_serial/ark_analytic_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_analytic_f2003.f90 @@ -192,6 +192,12 @@ program main stop 1 end if + ierr = FARKStepSetNonlinConvCoef(arkode_mem, 0.01d0) + if (ierr /= 0) then + write(*,*) 'Error in FARKStepSetNonlinConvCoef, ierr = ', ierr, '; halting' + stop 1 + end if + ! Start time stepping print *, ' ' print *, 'Finished initialization, starting time steps'