From d202111e4f47746966b02d3f2bfe31d1945c5402 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Mon, 6 Nov 2023 16:59:21 -0800 Subject: [PATCH 01/24] remove DFID --- examples/arkode/CXX_parallel/ark_brusselator1D.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/arkode/CXX_parallel/ark_brusselator1D.h b/examples/arkode/CXX_parallel/ark_brusselator1D.h index d1e0a83254..b59fda6390 100644 --- a/examples/arkode/CXX_parallel/ark_brusselator1D.h +++ b/examples/arkode/CXX_parallel/ark_brusselator1D.h @@ -196,7 +196,7 @@ typedef struct #define LOCAL_NLS(NLS) ( GET_NLS_CONTENT(NLS)->local_nls ) /* SUNNonlinearSolver constructor */ -SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y, FILE* DFID); +SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y); /* From f16bc3cdf5ec1c7a6315d01867c5e0e02e5d0f44 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Tue, 7 Nov 2023 14:22:48 -0800 Subject: [PATCH 02/24] remove KINInfoHandler --- .../kinLaplace_picard_kry_f2003.f90 | 8 - include/kinsol/kinsol.h | 6 +- src/kinsol/fmod/fkinsol_mod.c | 30 ---- src/kinsol/fmod/fkinsol_mod.f90 | 56 ------- src/kinsol/kinsol.c | 148 +++++++++--------- src/kinsol/kinsol_io.c | 50 ------ 6 files changed, 76 insertions(+), 222 deletions(-) diff --git a/examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90 b/examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90 index 21012626c8..b6cd3d643b 100644 --- a/examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90 +++ b/examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90 @@ -295,14 +295,6 @@ program main stop 1 end if - ! Set information file - - ierr = FKINSetPrintLevel(kmem, 3); - if (ierr /= 0) then - print *, 'Error in FKINSetPrintLevel, ierr = ', ierr, '; halting' - stop 1 - end if - ! ------------------------- ! Create a linear solver diff --git a/include/kinsol/kinsol.h b/include/kinsol/kinsol.h index 196b708def..5a306fc967 100644 --- a/include/kinsol/kinsol.h +++ b/include/kinsol/kinsol.h @@ -133,14 +133,10 @@ SUNDIALS_EXPORT int KINSetScaledStepTol(void *kinmem, realtype scsteptol); SUNDIALS_EXPORT int KINSetConstraints(void *kinmem, N_Vector constraints); SUNDIALS_EXPORT int KINSetSysFunc(void *kinmem, KINSysFn func); -/* Optional input functions for handling error/info/debug events */ +/* Optional input functions for handling error events */ SUNDIALS_EXPORT int KINSetErrHandlerFn(void *kinmem, KINErrHandlerFn ehfun, void *eh_data); SUNDIALS_EXPORT int KINSetErrFile(void *kinmem, FILE *errfp); -SUNDIALS_EXPORT int KINSetInfoHandlerFn(void *kinmem, KINInfoHandlerFn ihfun, - void *ih_data); -SUNDIALS_EXPORT int KINSetPrintLevel(void *kinmem, int printfl); - /* Optional output functions */ SUNDIALS_EXPORT int KINGetWorkSpace(void *kinmem, long int *lenrw, diff --git a/src/kinsol/fmod/fkinsol_mod.c b/src/kinsol/fmod/fkinsol_mod.c index 2836479531..11473b35fb 100644 --- a/src/kinsol/fmod/fkinsol_mod.c +++ b/src/kinsol/fmod/fkinsol_mod.c @@ -667,36 +667,6 @@ SWIGEXPORT int _wrap_FKINSetErrFile(void *farg1, void *farg2) { } -SWIGEXPORT int _wrap_FKINSetInfoHandlerFn(void *farg1, KINInfoHandlerFn farg2, void *farg3) { - int fresult ; - void *arg1 = (void *) 0 ; - KINInfoHandlerFn arg2 = (KINInfoHandlerFn) 0 ; - void *arg3 = (void *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (KINInfoHandlerFn)(farg2); - arg3 = (void *)(farg3); - result = (int)KINSetInfoHandlerFn(arg1,arg2,arg3); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FKINSetPrintLevel(void *farg1, int const *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - int arg2 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (int)(*farg2); - result = (int)KINSetPrintLevel(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FKINGetWorkSpace(void *farg1, long *farg2, long *farg3) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/kinsol/fmod/fkinsol_mod.f90 b/src/kinsol/fmod/fkinsol_mod.f90 index 4928d79822..325c4dd6c7 100644 --- a/src/kinsol/fmod/fkinsol_mod.f90 +++ b/src/kinsol/fmod/fkinsol_mod.f90 @@ -100,8 +100,6 @@ module fkinsol_mod public :: FKINSetSysFunc public :: FKINSetErrHandlerFn public :: FKINSetErrFile - public :: FKINSetInfoHandlerFn - public :: FKINSetPrintLevel public :: FKINGetWorkSpace public :: FKINGetNumNonlinSolvIters public :: FKINGetNumFuncEvals @@ -428,25 +426,6 @@ function swigc_FKINSetErrFile(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FKINSetInfoHandlerFn(farg1, farg2, farg3) & -bind(C, name="_wrap_FKINSetInfoHandlerFn") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_FUNPTR), value :: farg2 -type(C_PTR), value :: farg3 -integer(C_INT) :: fresult -end function - -function swigc_FKINSetPrintLevel(farg1, farg2) & -bind(C, name="_wrap_FKINSetPrintLevel") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - function swigc_FKINGetWorkSpace(farg1, farg2, farg3) & bind(C, name="_wrap_FKINGetWorkSpace") & result(fresult) @@ -1244,41 +1223,6 @@ function FKINSetErrFile(kinmem, errfp) & swig_result = fresult end function -function FKINSetInfoHandlerFn(kinmem, ihfun, ih_data) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: kinmem -type(C_FUNPTR), intent(in), value :: ihfun -type(C_PTR) :: ih_data -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_FUNPTR) :: farg2 -type(C_PTR) :: farg3 - -farg1 = kinmem -farg2 = ihfun -farg3 = ih_data -fresult = swigc_FKINSetInfoHandlerFn(farg1, farg2, farg3) -swig_result = fresult -end function - -function FKINSetPrintLevel(kinmem, printfl) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: kinmem -integer(C_INT), intent(in) :: printfl -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = kinmem -farg2 = printfl -fresult = swigc_FKINSetPrintLevel(farg1, farg2) -swig_result = fresult -end function - function FKINGetWorkSpace(kinmem, lenrw, leniw) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/kinsol/kinsol.c b/src/kinsol/kinsol.c index 10e200c49c..3f5171a88c 100644 --- a/src/kinsol/kinsol.c +++ b/src/kinsol/kinsol.c @@ -301,18 +301,9 @@ void *KINCreate(SUNContext sunctx) kin_mem->kin_omega_max = OMEGA_MAX; kin_mem->kin_errfp = stderr; - kin_mem->kin_infofp = stdout; - kin_mem->kin_debugfp = stdout; - kin_mem->kin_printfl = PRINTFL_DEFAULT; #if SUNDIALS_LOGGING_LEVEL > 0 kin_mem->kin_errfp = (KIN_LOGGER->error_fp) ? KIN_LOGGER->error_fp : stderr; #endif -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - kin_mem->kin_infofp = (KIN_LOGGER->info_fp) ? KIN_LOGGER->info_fp : stdout; -#endif -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - kin_mem->kin_debugfp = (KIN_LOGGER->debug_fp) ? KIN_LOGGER->debug_fp : stdout; -#endif /* initialize lrw and liw */ @@ -532,8 +523,10 @@ int KINSol(void *kinmem, N_Vector u, int strategy_in, return(KIN_ILL_INPUT); } - if (kin_mem->kin_printfl > 0) - KINPrintInfo(kin_mem, PRNT_TOL, "KINSOL", "KINSol", INFO_TOL, kin_mem->kin_scsteptol, kin_mem->kin_fnormtol); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_TOL, "KINSOL", "KINSol", INFO_TOL, kin_mem->kin_scsteptol, + kin_mem->kin_fnormtol); +#endif kin_mem->kin_nfe = kin_mem->kin_nnilset = kin_mem->kin_nnilset_sub = kin_mem->kin_nni = kin_mem->kin_nbcf = kin_mem->kin_nbktrk = 0; ret = KINFP(kin_mem); @@ -685,10 +678,12 @@ int KINSol(void *kinmem, N_Vector u, int strategy_in, kin_mem->kin_f1norm = f1normp; - /* print the current nni, fnorm, and nfe values if printfl > 0 */ + /* print the current nni, fnorm, and nfe values */ - if (kin_mem->kin_printfl > 0) - KINPrintInfo(kin_mem, PRNT_NNI, "KINSOL", "KINSol", INFO_NNI, kin_mem->kin_nni, kin_mem->kin_nfe, kin_mem->kin_fnorm); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_NNI, "KINSOL", "KINSol", INFO_NNI, kin_mem->kin_nni, kin_mem->kin_nfe, + kin_mem->kin_fnorm); +#endif if (ret != CONTINUE_ITERATIONS) break; @@ -697,9 +692,9 @@ int KINSol(void *kinmem, N_Vector u, int strategy_in, } /* end of loop; return */ - - if (kin_mem->kin_printfl > 0) - KINPrintInfo(kin_mem, PRNT_RETVAL, "KINSOL", "KINSol", INFO_RETVAL, ret); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_RETVAL, "KINSOL", "KINSol", INFO_RETVAL, ret); +#endif switch(ret) { case KIN_SYSFUNC_FAIL: @@ -1411,9 +1406,10 @@ static int KINSolInit(KINMem kin_mem) } /* all error checking is complete at this point */ - - if (kin_mem->kin_printfl > 0) - KINPrintInfo(kin_mem, PRNT_TOL, "KINSOL", "KINSolInit", INFO_TOL, kin_mem->kin_scsteptol, kin_mem->kin_fnormtol); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_TOL, "KINSOL", "KINSolInit", INFO_TOL, kin_mem->kin_scsteptol, + kin_mem->kin_fnormtol); +#endif /* calculate the default value for mxnewtstep (maximum Newton step) */ @@ -1472,8 +1468,9 @@ static int KINSolInit(KINMem kin_mem) return(KIN_INITIAL_GUESS_OK); } - if (kin_mem->kin_printfl > 1) - KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", "KINSolInit", INFO_FMAX, fmax); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", "KINSolInit", INFO_FMAX, fmax); +#endif /* initialize the linear solver if linit != NULL */ @@ -1490,10 +1487,10 @@ static int KINSolInit(KINMem kin_mem) kin_mem->kin_fnorm = N_VWL2Norm(kin_mem->kin_fval, kin_mem->kin_fscale); kin_mem->kin_f1norm = HALF * kin_mem->kin_fnorm * kin_mem->kin_fnorm; kin_mem->kin_fnorm_sub = kin_mem->kin_fnorm; - - if (kin_mem->kin_printfl > 0) +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO KINPrintInfo(kin_mem, PRNT_NNI, "KINSOL", "KINSolInit", INFO_NNI, kin_mem->kin_nni, kin_mem->kin_nfe, kin_mem->kin_fnorm); +#endif /* problem has now been successfully initialized */ @@ -1588,9 +1585,9 @@ static int KINFullNewton(KINMem kin_mem, realtype *fnormp, realtype *f1normp, N_VScale(ratio, kin_mem->kin_pp, kin_mem->kin_pp); pnorm = kin_mem->kin_mxnewtstep; } - - if (kin_mem->kin_printfl > 0) +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO KINPrintInfo(kin_mem, PRNT_PNORM, "KINSOL", "KINFullNewton", INFO_PNORM, pnorm); +#endif /* If constraints are active, then constrain the step accordingly */ @@ -1604,8 +1601,9 @@ static int KINFullNewton(KINMem kin_mem, realtype *fnormp, realtype *f1normp, N_VScale(kin_mem->kin_stepmul, kin_mem->kin_pp, kin_mem->kin_pp); pnorm *= kin_mem->kin_stepmul; kin_mem->kin_stepl = pnorm; - if (kin_mem->kin_printfl > 0) - KINPrintInfo(kin_mem, PRNT_PNORM, "KINSOL", "KINFullNewton", INFO_PNORM, pnorm); + #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_PNORM, "KINSOL", "KINFullNewton", INFO_PNORM, pnorm); + #endif if (pnorm <= kin_mem->kin_scsteptol) { N_VLinearSum(ONE, kin_mem->kin_uu, ONE, kin_mem->kin_pp, kin_mem->kin_unew); return(STEP_TOO_SMALL);} @@ -1651,8 +1649,9 @@ static int KINFullNewton(KINMem kin_mem, realtype *fnormp, realtype *f1normp, kin_mem->kin_sFdotJp *= ratio; kin_mem->kin_sJpnorm *= ratio; - if (kin_mem->kin_printfl > 1) - KINPrintInfo(kin_mem, PRNT_FNORM, "KINSOL", "KINFullNewton", INFO_FNORM, *fnormp); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_FNORM, "KINSOL", "KINFullNewton", INFO_FNORM, *fnormp); +#endif if (pnorm > (POINT99 * kin_mem->kin_mxnewtstep)) *maxStepTaken = SUNTRUE; @@ -1756,7 +1755,9 @@ static int KINLineSearch(KINMem kin_mem, realtype *fnormp, realtype *f1normp, pnorm *= kin_mem->kin_stepmul; rlmax = ONE; kin_mem->kin_stepl = pnorm; - if (kin_mem->kin_printfl > 0) KINPrintInfo(kin_mem, PRNT_PNORM1, "KINSOL", "KINLineSearch", INFO_PNORM1, pnorm); + #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_PNORM1, "KINSOL", "KINLineSearch", INFO_PNORM1, pnorm); + #endif if (pnorm <= kin_mem->kin_scsteptol) { N_VLinearSum(ONE, kin_mem->kin_uu, ONE, kin_mem->kin_pp, kin_mem->kin_unew); return(STEP_TOO_SMALL);} @@ -1806,8 +1807,9 @@ static int KINLineSearch(KINMem kin_mem, realtype *fnormp, realtype *f1normp, rlmin = (kin_mem->kin_scsteptol) / rlength; rl = ONE; - if (kin_mem->kin_printfl > 2) - KINPrintInfo(kin_mem, PRNT_LAM, "KINSOL", "KINLineSearch", INFO_LAM, rlmin, kin_mem->kin_f1norm, pnorm); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_LAM, "KINSOL", "KINLineSearch", INFO_LAM, rlmin, kin_mem->kin_f1norm, pnorm); +#endif /* Loop until the ALPHA condition is satisfied. Terminate if rl becomes too small */ @@ -1817,9 +1819,10 @@ static int KINLineSearch(KINMem kin_mem, realtype *fnormp, realtype *f1normp, alpha_cond = kin_mem->kin_f1norm + (alpha * slpi * rl); - if (kin_mem->kin_printfl > 2) - KINPrintInfo(kin_mem, PRNT_ALPHA, "KINSOL", "KINLinesearch", - INFO_ALPHA, *fnormp, *f1normp, alpha_cond, rl); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_ALPHA, "KINSOL", "KINLinesearch", + INFO_ALPHA, *fnormp, *f1normp, alpha_cond, rl); +#endif /* If ALPHA condition is satisfied, break out from loop */ @@ -1908,9 +1911,10 @@ static int KINLineSearch(KINMem kin_mem, realtype *fnormp, realtype *f1normp, alpha_cond = kin_mem->kin_f1norm + (alpha * slpi * rl); beta_cond = kin_mem->kin_f1norm + (beta * slpi * rl); - if (kin_mem->kin_printfl > 2) - KINPrintInfo(kin_mem, PRNT_BETA, "KINSOL", "KINLineSearch", - INFO_BETA, *f1normp, beta_cond, rl); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_BETA, "KINSOL", "KINLineSearch", + INFO_BETA, *f1normp, beta_cond, rl); +#endif } while (((*f1normp) <= alpha_cond) && ((*f1normp) < beta_cond) && (rl < rlmax)); @@ -1937,9 +1941,10 @@ static int KINLineSearch(KINMem kin_mem, realtype *fnormp, realtype *f1normp, alpha_cond = kin_mem->kin_f1norm + (alpha * slpi * rl); beta_cond = kin_mem->kin_f1norm + (beta * slpi * rl); - if (kin_mem->kin_printfl > 2) - KINPrintInfo(kin_mem, PRNT_ALPHABETA, "KINSOL", "KINLineSearch", - INFO_ALPHABETA, *f1normp, alpha_cond, beta_cond, rl); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_ALPHABETA, "KINSOL", "KINLineSearch", + INFO_ALPHABETA, *f1normp, alpha_cond, beta_cond, rl); +#endif if ((*f1normp) > alpha_cond) rldiff = rlinc; else if (*f1normp < beta_cond) { @@ -1976,8 +1981,9 @@ static int KINLineSearch(KINMem kin_mem, realtype *fnormp, realtype *f1normp, kin_mem->kin_nbktrk += nbktrk_l; - if (kin_mem->kin_printfl > 1) +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO KINPrintInfo(kin_mem, PRNT_ADJ, "KINSOL", "KINLineSearch", INFO_ADJ, nbktrk_l); +#endif /* scale sFdotJp and sJpnorm by rl * ratio for later use in KINForcingTerm */ @@ -2065,8 +2071,9 @@ static int KINStop(KINMem kin_mem, booleantype maxStepTaken, int sflag) fmax = KINScFNorm(kin_mem, kin_mem->kin_fval, kin_mem->kin_fscale); - if (kin_mem->kin_printfl > 1) - KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", "KINStop", INFO_FMAX, fmax); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", "KINStop", INFO_FMAX, fmax); +#endif if (fmax <= kin_mem->kin_fnormtol) return(KIN_SUCCESS); @@ -2375,17 +2382,7 @@ void KINInfoHandler(const char *module, const char *function, char *msg, void *data) { KINMem kin_mem; - - /* data points to kin_mem here */ - kin_mem = (KINMem) data; -#ifndef NO_FPRINTF_OUTPUT - if (kin_mem->kin_infofp != NULL && - kin_mem->kin_infofp != kin_mem->kin_sunctx->logger->info_fp) { - fprintf(kin_mem->kin_infofp,"\n[%s] %s\n",module, function); - fprintf(kin_mem->kin_infofp," %s\n",msg); - } -#endif #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO SUNLogger_QueueMsg(KIN_LOGGER, SUN_LOGLEVEL_INFO, "KINSOL::KINInfoHandler", function, "%s", msg); @@ -2578,14 +2575,16 @@ static int KINPicardAA(KINMem kin_mem) kin_mem->kin_fnorm = KINScFNorm(kin_mem, kin_mem->kin_fval, kin_mem->kin_fscale); - if (kin_mem->kin_printfl > 1) - KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", "KINPicardAA", INFO_FMAX, - kin_mem->kin_fnorm); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", "KINPicardAA", INFO_FMAX, + kin_mem->kin_fnorm); +#endif - /* print the current iter, fnorm, and nfe values if printfl > 0 */ - if (kin_mem->kin_printfl > 0) - KINPrintInfo(kin_mem, PRNT_NNI, "KINSOL", "KINPicardAA", INFO_NNI, - kin_mem->kin_nni, kin_mem->kin_nfe, kin_mem->kin_fnorm); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + /* print the current iter, fnorm, and nfe values */ + KINPrintInfo(kin_mem, PRNT_NNI, "KINSOL", "KINPicardAA", INFO_NNI, + kin_mem->kin_nni, kin_mem->kin_nfe, kin_mem->kin_fnorm); +#endif /* Check if the maximum number of iterations is reached */ if (kin_mem->kin_nni >= kin_mem->kin_mxiter) { @@ -2608,9 +2607,9 @@ static int KINPicardAA(KINMem kin_mem) fflush(kin_mem->kin_errfp); } /* end of loop; return */ - - if (kin_mem->kin_printfl > 0) +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO KINPrintInfo(kin_mem, PRNT_RETVAL, "KINSOL", "KINPicardAA", INFO_RETVAL, ret); +#endif return(ret); } @@ -2786,14 +2785,16 @@ static int KINFP(KINMem kin_mem) /* measure || g(x) - x || */ kin_mem->kin_fnorm = KINScFNorm(kin_mem, delta, kin_mem->kin_fscale); - if (kin_mem->kin_printfl > 1) - KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", "KINFP", INFO_FMAX, - kin_mem->kin_fnorm); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", "KINFP", INFO_FMAX, + kin_mem->kin_fnorm); +#endif - /* print the current iter, fnorm, and nfe values if printfl > 0 */ - if (kin_mem->kin_printfl > 0) - KINPrintInfo(kin_mem, PRNT_NNI, "KINSOL", "KINFP", INFO_NNI, - kin_mem->kin_nni, kin_mem->kin_nfe, kin_mem->kin_fnorm); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + /* print the current iter, fnorm, and nfe values */ + KINPrintInfo(kin_mem, PRNT_NNI, "KINSOL", "KINFP", INFO_NNI, + kin_mem->kin_nni, kin_mem->kin_nfe, kin_mem->kin_fnorm); +#endif /* Check if the maximum number of iterations is reached */ if (kin_mem->kin_nni >= kin_mem->kin_mxiter) { @@ -2814,8 +2815,9 @@ static int KINFP(KINMem kin_mem) } /* end of loop; return */ - if (kin_mem->kin_printfl > 0) - KINPrintInfo(kin_mem, PRNT_RETVAL, "KINSOL", "KINFP", INFO_RETVAL, ret); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_RETVAL, "KINSOL", "KINFP", INFO_RETVAL, ret); +#endif return(ret); } diff --git a/src/kinsol/kinsol_io.c b/src/kinsol/kinsol_io.c index 6645333d90..e46968053b 100644 --- a/src/kinsol/kinsol_io.c +++ b/src/kinsol/kinsol_io.c @@ -85,56 +85,6 @@ int KINSetErrFile(void *kinmem, FILE *errfp) return(KIN_SUCCESS); } -/* - * ----------------------------------------------------------------- - * Function : KINSetPrintLevel - * ----------------------------------------------------------------- - */ - -int KINSetPrintLevel(void *kinmem, int printfl) -{ - KINMem kin_mem; - - if (kinmem == NULL) { - KINProcessError(NULL, KIN_MEM_NULL, "KINSOL", "KINSetPrintLevel", MSG_NO_MEM); - return(KIN_MEM_NULL); - } - - kin_mem = (KINMem) kinmem; - - if ((printfl < 0) || (printfl > 3)) { - KINProcessError(NULL, KIN_ILL_INPUT, "KINSOL", "KINSetPrintLevel", MSG_BAD_PRINTFL); - return(KIN_ILL_INPUT); - } - - kin_mem->kin_printfl = printfl; - - return(KIN_SUCCESS); -} - -/* - * ----------------------------------------------------------------- - * KINSetInfoHandlerFn - * ----------------------------------------------------------------- - */ - -int KINSetInfoHandlerFn(void *kinmem, KINInfoHandlerFn ihfun, void *ih_data) -{ - KINMem kin_mem; - - if (kinmem == NULL) { - KINProcessError(NULL, KIN_MEM_NULL, "KINSOL", "KINSetInfoHandlerFn", MSG_NO_MEM); - return(KIN_MEM_NULL); - } - - kin_mem = (KINMem) kinmem; - - kin_mem->kin_ihfun = ihfun; - kin_mem->kin_ih_data = ih_data; - - return(KIN_SUCCESS); -} - /* * ----------------------------------------------------------------- * Function : KINSetUserData From da23565f8240a78999e8c0e253afb8f3fab85b77 Mon Sep 17 00:00:00 2001 From: David Gardner Date: Tue, 7 Nov 2023 19:52:47 -0500 Subject: [PATCH 03/24] Feature: Update Full RHS Calls (#324) Fixed a bug in ERKStep where methods with `c[s-1] = 1` but `a[s-1,j] != b[j]` were incorrectly treated as having the first same as last (FSAL) property. Fixed a bug in `MRIStepCoupling_Write` where explicit coupling tables were not written to the output file pointer. ARKStep, ERKStep, MRIStep, and SPRKStep were updated to remove a potentially unnecessary right-hand side evaluation at the end of an integration. ARKStep was additionally updated to remove extra right-hand side evaluations when using an explicit method or an implicit method with an explicit first stage. The `MRIStepInnerStepper` class in MRIStep was updated to make supplying an `MRIStepInnerFullRhsFn` optional. --------- Co-authored-by: Daniel R. Reynolds Co-authored-by: Cody Balos --- CHANGELOG.md | 14 + doc/README.md | 10 + .../guide/source/ARKodeButcherTable.rst | 69 +- doc/arkode/guide/source/Introduction.rst | 15 + doc/arkode/guide/source/Mathematics.rst | 69 +- .../Custom_Inner_Stepper/Description.rst | 11 +- .../Usage/SPRKStep_c_interface/index.rst | 8 +- doc/sundials_developers/source/conf.py | 3 +- doc/sundials_developers/source/index.rst | 1 + .../source/packages/ARKODE.rst | 283 +++ .../source/packages/index.rst | 23 + .../source/style_guide/Documentation.rst | 2 +- .../CXX_parallel/ark_diffusion_reaction_p.cpp | 2 +- ...k_diffusion_reaction_p_--np_2_2_--imex.out | 64 +- ...sion_reaction_p_--np_2_2_--mri-arkstep.out | 62 +- ...reaction_p_--np_2_2_--mri-cvode-global.out | 60 +- ..._reaction_p_--np_2_2_--mri-cvode-local.out | 56 +- examples/arkode/CXX_parallel/ark_heat2D_p.cpp | 2 +- .../CXX_parallel/ark_heat2D_p_--np_2_2.out | 70 +- .../ark_heat2D_hypre_ls_--np_2_2.out | 44 +- .../ark_heat2D_hypre_pfmg_--np_2_2.out | 44 +- .../ark_heat2D_hypre_pfmg_imex_--np_2_2.out | 20 +- .../ark_heat2D_hypre_pfmg_mri_--np_2_2.out | 24 +- .../ark_advection_diffusion_reaction.out | 22 +- examples/arkode/CXX_serial/ark_heat2D.cpp | 2 +- examples/arkode/CXX_serial/ark_heat2D.out | 70 +- examples/arkode/CXX_serial/ark_kpr_Mt.cpp | 2 + .../arkode/CXX_serial/ark_kpr_Mt_0_-4.out | 8 +- .../CXX_serial/ark_kpr_Mt_0_3_0_-10_0.out | 216 +- .../ark_kpr_Mt_0_4_0_-10_0_10_1.out | 216 +- .../ark_kpr_Mt_0_4_0_-10_1_10_1.out | 222 +- .../arkode/CXX_serial/ark_kpr_Mt_0_4_1.out | 208 +- examples/arkode/CXX_serial/ark_kpr_Mt_0_5.out | 222 +- .../CXX_serial/ark_kpr_Mt_1_-3_0_-10_0.out | 2 +- .../arkode/CXX_serial/ark_kpr_Mt_1_-5.out | 14 +- examples/arkode/CXX_serial/ark_kpr_Mt_1_4.out | 220 +- .../CXX_serial/ark_kpr_Mt_2_4_0_-10_0.out | 6 +- .../CXX_serial/ark_kpr_Mt_2_8_0_-10.out | 206 +- examples/arkode/CXX_serial/ark_pendulum.cpp | 3 + examples/arkode/CXX_serial/ark_pendulum.out | 34 +- .../ark_brusselator1D_FEM_sludist.out | 116 +- ...mg_xbraid_--np_2_1_2_--x_print_level_0.out | 4 +- ..._p_xbraid_--np_2_1_2_--x_print_level_0.out | 14 +- .../ark_heat2D_xbraid_--x_print_level_0.out | 14 +- .../ark_brusselator1D_manyvec.out | 24 +- .../arkode/C_openmp/ark_brusselator1D_omp.out | 88 +- .../arkode/C_parallel/ark_diurnal_kry_bbd_p.c | 4 + .../C_parallel/ark_diurnal_kry_bbd_p.out | 126 +- .../arkode/C_parallel/ark_diurnal_kry_p.c | 4 + .../arkode/C_parallel/ark_diurnal_kry_p.out | 62 +- .../arkode/C_parhyp/ark_diurnal_kry_ph.out | 60 +- .../arkode/C_serial/ark_KrylovDemo_prec.out | 322 +-- .../arkode/C_serial/ark_KrylovDemo_prec_1.out | 326 +-- .../arkode/C_serial/ark_KrylovDemo_prec_2.out | 328 +-- .../arkode/C_serial/ark_brusselator1D.out | 88 +- .../C_serial/ark_brusselator1D_FEM_slu.out | 116 +- .../ark_brusselator1D_imexmri_0_0.001.out | 2 +- .../ark_brusselator1D_imexmri_2_0.001.out | 2 +- .../ark_brusselator1D_imexmri_3_0.001.out | 2 +- .../ark_brusselator1D_imexmri_4_0.001.out | 2 +- .../ark_brusselator1D_imexmri_5_0.001.out | 2 +- .../ark_brusselator1D_imexmri_6_0.001.out | 2 +- .../ark_brusselator1D_imexmri_7_0.001.out | 2 +- .../arkode/C_serial/ark_brusselator1D_klu.out | 10 +- .../C_serial/ark_brusselator_1D_mri.out | 58 +- .../arkode/C_serial/ark_brusselator_fp.out | 6 +- .../arkode/C_serial/ark_brusselator_fp_1.out | 6 +- .../arkode/C_serial/ark_brusselator_mri.out | 2 +- .../C_serial/ark_conserved_exp_entropy_ark.c | 4 + .../ark_conserved_exp_entropy_ark_1_0.out | 18 +- .../ark_conserved_exp_entropy_ark_1_1.out | 72 +- .../ark_conserved_exp_entropy_erk_1.out | 18 +- .../ark_damped_harmonic_symplectic.out | 4 +- .../C_serial/ark_dissipated_exp_entropy.c | 4 + .../ark_dissipated_exp_entropy_1_0.out | 8 +- .../ark_dissipated_exp_entropy_1_1.out | 83 +- .../C_serial/ark_harmonic_symplectic.out | 4 +- examples/arkode/C_serial/ark_heat1D.out | 10 +- examples/arkode/C_serial/ark_heat1D_adapt.out | 277 +-- examples/arkode/C_serial/ark_kepler.out | 4 +- ...kepler_--stepper_ERK_--step-mode_adapt.out | 2 +- ...r_ERK_--step-mode_fixed_--count-orbits.out | 2 +- ..._--count-orbits_--use-compensated-sums.out | 4 +- ...LER_1_1_--tf_50_--check-order_--nout_1.out | 34 +- ...ROG_2_2_--tf_50_--check-order_--nout_1.out | 34 +- ...LAN_2_2_--tf_50_--check-order_--nout_1.out | 34 +- ...LAN_3_3_--tf_50_--check-order_--nout_1.out | 34 +- ...LAN_4_4_--tf_50_--check-order_--nout_1.out | 34 +- ...LAN_5_6_--tf_50_--check-order_--nout_1.out | 34 +- ...ROG_2_2_--tf_50_--check-order_--nout_1.out | 34 +- ...UTH_3_3_--tf_50_--check-order_--nout_1.out | 34 +- ...IDA_6_8_--tf_50_--check-order_--nout_1.out | 34 +- examples/arkode/C_serial/ark_kpr_mri.out | 2 +- .../arkode/C_serial/ark_kpr_mri_0_0.002.out | 4 +- .../arkode/C_serial/ark_kpr_mri_1_0.002.out | 2 +- .../arkode/C_serial/ark_kpr_mri_3_0.01.out | 2 +- .../arkode/C_serial/ark_kpr_mri_4_0.002.out | 2 +- .../arkode/C_serial/ark_kpr_mri_5_0.002.out | 66 +- .../arkode/C_serial/ark_kpr_mri_6_0.005.out | 20 +- .../arkode/C_serial/ark_kpr_mri_7_0.001.out | 2 +- .../ark_kpr_mri_7_0.001_-100_100_0.5_1.out | 6 +- .../arkode/C_serial/ark_kpr_mri_8_0.001.out | 14 +- .../ark_kpr_mri_8_0.001_-100_100_0.5_1.out | 6 +- .../arkode/C_serial/ark_kpr_mri_9_0.001.out | 94 +- .../ark_kpr_mri_9_0.001_-100_100_0.5_1.out | 88 +- .../arkode/C_serial/ark_onewaycouple_mri.out | 2 +- .../C_serial/ark_reaction_diffusion_mri.out | 2 +- examples/arkode/C_serial/ark_robertson.out | 228 +- .../C_serial/ark_robertson_constraints.out | 218 +- .../arkode/C_serial/ark_robertson_root.out | 38 +- .../arkode/C_serial/ark_twowaycouple_mri.out | 2 +- .../ark_analytic_complex_f2003.out | 2 +- .../F2003_custom/ark_brusselator1D_f2003.out | 4 +- .../F2003_serial/ark_analytic_f2003.f90 | 6 + .../F2003_serial/ark_analytic_f2003.out | 20 +- .../arkode/F2003_serial/ark_kpr_mri_f2003.out | 116 +- .../ark_kpr_mri_f2003_0_0.002.out | 106 +- .../ark_kpr_mri_f2003_1_0.002.out | 106 +- .../F2003_serial/ark_kpr_mri_f2003_3_0.01.out | 106 +- .../ark_kpr_mri_f2003_4_0.002.out | 106 +- .../ark_kpr_mri_f2003_5_0.002.out | 106 +- .../ark_kpr_mri_f2003_6_0.005.out | 106 +- .../ark_kpr_mri_f2003_7_0.001.out | 106 +- .../ark_kpr_mri_f2003_8_0.001.out | 106 +- .../ark_kpr_mri_f2003_9_0.001.out | 106 +- examples/nvector/test_nvector.c | 2 +- include/arkode/arkode_butcher.h | 1 + scripts/updateOutFiles.py | 62 +- src/arkode/arkode.c | 131 +- src/arkode/arkode_arkstep.c | 967 +++++--- src/arkode/arkode_arkstep_impl.h | 7 +- src/arkode/arkode_arkstep_io.c | 4 +- src/arkode/arkode_butcher.c | 14 + src/arkode/arkode_erkstep.c | 170 +- src/arkode/arkode_erkstep_impl.h | 1 - src/arkode/arkode_erkstep_io.c | 4 +- src/arkode/arkode_impl.h | 43 +- src/arkode/arkode_interp.c | 67 +- src/arkode/arkode_interp_impl.h | 4 - src/arkode/arkode_io.c | 14 +- src/arkode/arkode_mri_tables.c | 10 +- src/arkode/arkode_mristep.c | 286 ++- src/arkode/arkode_relaxation.c | 36 +- src/arkode/arkode_relaxation_impl.h | 15 +- src/arkode/arkode_root.c | 21 +- src/arkode/arkode_sprkstep.c | 48 +- src/sundials/sundials_context.c | 2 +- test/answers | 2 +- .../arkode/CXX_parallel/CMakeLists.txt | 63 +- .../CXX_parallel/ark_test_heat2D_mri.cpp | 18 +- .../CXX_parallel/ark_test_heat2D_mri_0.out | 40 + .../CXX_parallel/ark_test_heat2D_mri_1.out | 40 + .../arkode/CXX_serial/CMakeLists.txt | 8 + .../CXX_serial/ark_test_analytic_sys_mri.cpp | 14 +- .../ark_test_analytic_sys_mri_0.out | 2 +- .../ark_test_analytic_sys_mri_1.out | 2 +- .../CXX_serial/ark_test_dahlquist_ark.cpp | 956 ++++++++ .../CXX_serial/ark_test_dahlquist_ark.out | 1972 +++++++++++++++ .../CXX_serial/ark_test_dahlquist_ark_0_0.out | 2182 +++++++++++++++++ .../CXX_serial/ark_test_dahlquist_ark_0_1.out | 2182 +++++++++++++++++ .../CXX_serial/ark_test_dahlquist_ark_1_0.out | 2182 +++++++++++++++++ .../CXX_serial/ark_test_dahlquist_ark_1_1.out | 2182 +++++++++++++++++ .../CXX_serial/ark_test_dahlquist_ark_2_0.out | 2182 +++++++++++++++++ .../CXX_serial/ark_test_dahlquist_ark_2_1.out | 2182 +++++++++++++++++ .../CXX_serial/ark_test_dahlquist_erk.cpp | 529 ++++ .../CXX_serial/ark_test_dahlquist_erk.out | 609 +++++ .../CXX_serial/ark_test_dahlquist_erk_0.out | 819 +++++++ .../CXX_serial/ark_test_dahlquist_erk_1.out | 819 +++++++ .../CXX_serial/ark_test_dahlquist_mri.cpp | 31 +- .../CXX_serial/ark_test_dahlquist_mri.out | 319 ++- .../unit_tests/arkode/C_serial/CMakeLists.txt | 1 + .../arkode/C_serial/ark_test_innerstepper.c | 155 ++ 172 files changed, 24263 insertions(+), 4278 deletions(-) create mode 100644 doc/README.md create mode 100644 doc/sundials_developers/source/packages/ARKODE.rst create mode 100644 doc/sundials_developers/source/packages/index.rst create mode 100644 test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri_0.out create mode 100644 test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri_1.out create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark.cpp create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark.out create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_0.out create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_1.out create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_0.out create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_1.out create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_0.out create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_1.out create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk.cpp create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk.out create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk_0.out create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk_1.out create mode 100644 test/unit_tests/arkode/C_serial/ark_test_innerstepper.c diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d41c15931..f7e7870f60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,20 @@ the stop time. Additionally, with ARKODE, CVODE, and CVODES this fix removes an unnecessary interpolation of the solution at the stop time that could occur in this case. +Fixed a bug in ERKStep where methods with `c[s-1] = 1` but `a[s-1,j] != b[j]` +were incorrectly treated as having the first same as last (FSAL) property. + +Fixed a bug in `MRIStepCoupling_Write` where explicit coupling tables were not +written to the output file pointer. + +ARKStep, ERKStep, MRIStep, and SPRKStep were updated to remove a potentially +unnecessary right-hand side evaluation at the end of an integration. ARKStep was +additionally updated to remove extra right-hand side evaluations when using an +explicit method or an implicit method with an explicit first stage. + +The `MRIStepInnerStepper` class in MRIStep was updated to make supplying an +`MRIStepInnerFullRhsFn` optional. + ## Changes to SUNDIALS in release 6.6.0 A new time-stepping module, `SPRKStep`, was added to ARKODE. This time-stepper diff --git a/doc/README.md b/doc/README.md new file mode 100644 index 0000000000..3fe743f033 --- /dev/null +++ b/doc/README.md @@ -0,0 +1,10 @@ +# SUNDIALS Documentation + +The SUNDIALS documentation is written using reStructuredText and +[Sphinx](https://www.sphinx-doc.org/). + +To build the documentation with Sphinx you will need Python 3.9+. Sphinx and the +necessary extensions can be installed using the requirements file i.e., +`pip install -r requirements.txt`. Additionally, building the developer +documentation requires [Graphviz](https://graphviz.org/) for generating +flowcharts. diff --git a/doc/arkode/guide/source/ARKodeButcherTable.rst b/doc/arkode/guide/source/ARKodeButcherTable.rst index 8e6ea6acbc..86a13a15e4 100644 --- a/doc/arkode/guide/source/ARKodeButcherTable.rst +++ b/doc/arkode/guide/source/ARKodeButcherTable.rst @@ -76,33 +76,35 @@ ARKodeButcherTable functions .. _ARKodeButcherTable.FunctionsTable: .. table:: ARKodeButcherTable functions - +----------------------------------------------+------------------------------------------------------------+ - | **Function name** | **Description** | - +----------------------------------------------+------------------------------------------------------------+ - | :c:func:`ARKodeButcherTable_LoadERK()` | Retrieve a given explicit Butcher table by its unique ID | - +----------------------------------------------+------------------------------------------------------------+ - | :c:func:`ARKodeButcherTable_LoadERKByName()` | Retrieve a given explicit Butcher table by its unique name | - +----------------------------------------------+------------------------------------------------------------+ - | :c:func:`ARKodeButcherTable_LoadDIRK()` | Retrieve a given implicit Butcher table by its unique ID | - +----------------------------------------------+------------------------------------------------------------+ - | :c:func:`ARKodeButcherTable_LoadDIRKByName()`| Retrieve a given implicit Butcher table by its unique name | - +----------------------------------------------+------------------------------------------------------------+ - | :c:func:`ARKodeButcherTable_Alloc()` | Allocate an empty Butcher table | - +----------------------------------------------+------------------------------------------------------------+ - | :c:func:`ARKodeButcherTable_Create()` | Create a new Butcher table | - +----------------------------------------------+------------------------------------------------------------+ - | :c:func:`ARKodeButcherTable_Copy()` | Create a copy of a Butcher table | - +----------------------------------------------+------------------------------------------------------------+ - | :c:func:`ARKodeButcherTable_Space()` | Get the Butcher table real and integer workspace size | - +----------------------------------------------+------------------------------------------------------------+ - | :c:func:`ARKodeButcherTable_Free()` | Deallocate a Butcher table | - +----------------------------------------------+------------------------------------------------------------+ - | :c:func:`ARKodeButcherTable_Write()` | Write the Butcher table to an output file | - +----------------------------------------------+------------------------------------------------------------+ - | :c:func:`ARKodeButcherTable_CheckOrder()` | Check the order of a Butcher table | - +----------------------------------------------+------------------------------------------------------------+ - | :c:func:`ARKodeButcherTable_CheckARKOrder()` | Check the order of an ARK pair of Butcher tables | - +----------------------------------------------+------------------------------------------------------------+ + +--------------------------------------------------+------------------------------------------------------------+ + | **Function name** | **Description** | + +--------------------------------------------------+------------------------------------------------------------+ + | :c:func:`ARKodeButcherTable_LoadERK()` | Retrieve a given explicit Butcher table by its unique ID | + +--------------------------------------------------+------------------------------------------------------------+ + | :c:func:`ARKodeButcherTable_LoadERKByName()` | Retrieve a given explicit Butcher table by its unique name | + +--------------------------------------------------+------------------------------------------------------------+ + | :c:func:`ARKodeButcherTable_LoadDIRK()` | Retrieve a given implicit Butcher table by its unique ID | + +--------------------------------------------------+------------------------------------------------------------+ + | :c:func:`ARKodeButcherTable_LoadDIRKByName()` | Retrieve a given implicit Butcher table by its unique name | + +--------------------------------------------------+------------------------------------------------------------+ + | :c:func:`ARKodeButcherTable_Alloc()` | Allocate an empty Butcher table | + +--------------------------------------------------+------------------------------------------------------------+ + | :c:func:`ARKodeButcherTable_Create()` | Create a new Butcher table | + +--------------------------------------------------+------------------------------------------------------------+ + | :c:func:`ARKodeButcherTable_Copy()` | Create a copy of a Butcher table | + +--------------------------------------------------+------------------------------------------------------------+ + | :c:func:`ARKodeButcherTable_Space()` | Get the Butcher table real and integer workspace size | + +--------------------------------------------------+------------------------------------------------------------+ + | :c:func:`ARKodeButcherTable_Free()` | Deallocate a Butcher table | + +--------------------------------------------------+------------------------------------------------------------+ + | :c:func:`ARKodeButcherTable_Write()` | Write the Butcher table to an output file | + +--------------------------------------------------+------------------------------------------------------------+ + | :c:func:`ARKodeButcherTable_IsStifflyAccurate()` | Determine if ``A[stages - 1][i] == b[i]`` | + +--------------------------------------------------+------------------------------------------------------------+ + | :c:func:`ARKodeButcherTable_CheckOrder()` | Check the order of a Butcher table | + +--------------------------------------------------+------------------------------------------------------------+ + | :c:func:`ARKodeButcherTable_CheckARKOrder()` | Check the order of an ARK pair of Butcher tables | + +--------------------------------------------------+------------------------------------------------------------+ .. c:function:: ARKodeButcherTable ARKodeButcherTable_LoadERK(ARKODE_ERKTableID emethod) @@ -252,6 +254,19 @@ ARKodeButcherTable functions The *outfile* argument can be ``stdout`` or ``stderr``, or it may point to a specific file created using ``fopen``. +.. c:function:: void ARKodeButcherTable_IsStifflyAccurate(ARKodeButcherTable B) + + Determine if the table satisfies ``A[stages - 1][i] == b[i]`` + + **Arguments:** + * *B* -- the Butcher table. + + **Returns** + * ``SUNTRUE`` if the method is "stiffly accurate", otherwise returns + ``SUNFALSE`` + + .. versionadded:: vX.X.X + .. c:function:: int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, FILE* outfile) Determine the analytic order of accuracy for the specified Butcher diff --git a/doc/arkode/guide/source/Introduction.rst b/doc/arkode/guide/source/Introduction.rst index dd4e67ae9d..736b7ddc18 100644 --- a/doc/arkode/guide/source/Introduction.rst +++ b/doc/arkode/guide/source/Introduction.rst @@ -180,6 +180,21 @@ requested output time is the same as the stop time. Additionally, this fix removes an unnecessary interpolation of the solution at the stop time that could occur in this case. +Fixed a bug in ERKStep where methods with :math:`c_s = 1` but +:math:`a_{s,j} \neq b_j` were incorrectly treated as having the first same as +last (FSAL) property. + +Fixed a bug in :c:func:`MRIStepCoupling_Write` where explicit coupling tables +were not written to the output file pointer. + +ARKStep, ERKStep, MRIStep, and SPRKStep were updated to remove a potentially +unnecessary right-hand side evaluation at the end of an integration. ARKStep was +additionally updated to remove extra right-hand side evaluations when using an +explicit method or an implicit method with an explicit first stage. + +The :c:type:`MRIStepInnerStepper` class in MRIStep was updated to make supplying +an :c:func:`MRIStepInnerFullRhsFn` optional. + Changes in v5.6.0 ----------------- diff --git a/doc/arkode/guide/source/Mathematics.rst b/doc/arkode/guide/source/Mathematics.rst index 6c9b7ec4e2..135bf33f4c 100644 --- a/doc/arkode/guide/source/Mathematics.rst +++ b/doc/arkode/guide/source/Mathematics.rst @@ -466,39 +466,41 @@ than the more general form :eq:`ARKODE_IVP_simple_explicit`. SPRKStep -- Symplectic Partitioned Runge--Kutta methods ======================================================= -The SPRKStep time-stepping module in ARKODE is designed for IVPs of the form +The SPRKStep time-stepping module in ARKODE is designed for problems where the +state vector is partitioned as .. math:: - \dot{p} = f_1(t, q) = \frac{\partial V(t, q)}{\partial q}, \quad - \dot{q} = f_2(t, p) = \frac{\partial T(t, p)}{\partial p}, - \qquad p(t_0) = p_0,\quad q(t_0) = q_0, - :label: ARKODE_IVP_Hamiltonian + y(t) = + \begin{bmatrix} + p(t) \\ + q(t) + \end{bmatrix} -where the system Hamiltonian +and the component partitioned IVP is given by .. math:: - H(t, p, q) = T(t, p) + V(t, q) + \dot{p} &= f_1(t, q), \qquad p(t_0) = p_0 \\ + \dot{q} &= f_2(t, p), \qquad q(t_0) = q_0. + :label: ARKODE_IVP_SPRK -**is separable**. When *H* is autonomous, then *H* is a conserved quantity. -Often this correponds to the conservation of energy (for example, in *n*-body -problems). For non-autonomous *H*, the invariants are no longer directly -obtainable from the Hamiltonian :cite:p:`Struckmeier:02`. +The right-hand side functions :math:`f_1(t,p)` and :math:`f_2(t,q)` typically +arise from the **separable** Hamiltonian system -In solving the IVP :eq:`ARKODE_IVP_Hamiltonian`, we consider the problem in the form +.. math:: + H(t, p, q) = T(t, p) + V(t, q) + +where .. math:: - \dot{y} = - \begin{bmatrix} - f_1(t, q) \\ - f_2(t, p) - \end{bmatrix}, \qquad - y(t_0) = - \begin{bmatrix} - p_0\\ - q_0 - \end{bmatrix}. + f_1(t, q) \equiv \frac{\partial V(t, q)}{\partial q}, \qquad + f_2(t, p) \equiv \frac{\partial T(t, p)}{\partial p}. + +When *H* is autonomous, then *H* is a conserved quantity. Often this corresponds +to the conservation of energy (for example, in *n*-body problems). For +non-autonomous *H*, the invariants are no longer directly obtainable from the +Hamiltonian :cite:p:`Struckmeier:02`. -In practice, the ordering of the variables does not matter and is determined by the user. +In practice, the ordering of the variables does not matter and is determined by the user. SPRKStep utilizes Symplectic Partitioned Runge-Kutta (SPRK) methods represented by the pair of explicit and diagonally implicit Butcher tableaux, @@ -529,17 +531,18 @@ schemes with order of accuracy and conservation equal to the default methods used are given in the section :numref:`Butcher.sprk`. In the default case, the algorithm for a single time-step is as follows -(for autonomous Hamiltonian systems the times provided to :math:`f1` and :math:`f2` +(for autonomous Hamiltonian systems the times provided to :math:`f_1` and +:math:`f_2` can be ignored). -#. Set :math:`P_0 = p_n, Q_1 = q_n` +#. Set :math:`P_0 = p_{n-1}, Q_1 = q_{n-1}` #. For :math:`i = 1,\ldots,s` do: - #. :math:`P_i = P_{i-1} + h_{n+1} \hat{a}_i f_1(t_n + \hat{c}_i h, Q_i)` - #. :math:`Q_{i+1} = Q_i + h_{n+1} a_i f_2(t_n + c_i h, P_i)` + #. :math:`P_i = P_{i-1} + h_n \hat{a}_i f_1(t_{n-1} + \hat{c}_i h_n, Q_i)` + #. :math:`Q_{i+1} = Q_i + h_n a_i f_2(t_{n-1} + c_i h_n, P_i)` -#. Set :math:`p_{n+1} = P_s, q_{n+1} = Q_{s+1}` +#. Set :math:`p_n = P_s, q_n = Q_{s+1}` .. _ARKODE.Mathematics.SPRKStep.Compensated: @@ -554,12 +557,12 @@ form is used to compute a time step: #. For :math:`i = 1,\ldots,s` do: - #. :math:`\Delta P_i = \Delta P_{i-1} + h_{n+1} \hat{a}_i f_1(t_n + \hat{c}_i h, q_n + \Delta Q_i)` - #. :math:`\Delta Q_{i+1} = \Delta Q_i + h_{n+1} a_i f_2(t_n + c_i h, p_n + \Delta P_i)` + #. :math:`\Delta P_i = \Delta P_{i-1} + h_n \hat{a}_i f_1(t_{n-1} + \hat{c}_i h_n, q_{n-1} + \Delta Q_i)` + #. :math:`\Delta Q_{i+1} = \Delta Q_i + h_n a_i f_2(t_{n-1} + c_i h_n, p_{n-1} + \Delta P_i)` -#. Set :math:`\Delta p_{n+1} = \Delta P_s, \Delta q_{n+1} = \Delta Q_{s+1}` +#. Set :math:`\Delta p_n = \Delta P_s, \Delta q_n = \Delta Q_{s+1}` -#. Using compensated summation, set :math:`p_{n+1} = p_n + \Delta p_{n+1}, q_{n+1} = q_n + \Delta Q_{s+1}` +#. Using compensated summation, set :math:`p_n = p_{n-1} + \Delta p_n, q_n = q_{n-1} + \Delta q_n` Since temporal error based adaptive time-stepping is known to ruin the conservation property :cite:p:`HaWa:06`, SPRKStep employs a fixed time-step size. @@ -706,7 +709,7 @@ characterized by nonzero values on or above the diagonal of the matrices :math:`\Gamma^{\{k\}}`. Typically, MRI-GARK and IMEX-MRI-GARK methods are at most diagonally-implicit (i.e., :math:`\gamma_{i,j}^{\{k\}}=0` for all :math:`j>i`). Furthermore, diagonally-implicit stages are characterized as being -"solve-decoupled" if :math:`\Delta c_i^S = 0` when `\gamma_{i,i}^{\{k\}} \ne 0`, +"solve-decoupled" if :math:`\Delta c_i^S = 0` when :math:`\gamma_{i,i}^{\{k\}} \ne 0`, in which case the stage is computed as standard ARK or DIRK update. Alternately, a diagonally-implicit stage :math:`i` is considered "solve-coupled" if :math:`\Delta c^S_i \gamma_{i,j}^{\{k\}} \ne 0`, in which diff --git a/doc/arkode/guide/source/Usage/MRIStep_c_interface/Custom_Inner_Stepper/Description.rst b/doc/arkode/guide/source/Usage/MRIStep_c_interface/Custom_Inner_Stepper/Description.rst index 4fd6f14b53..33fa9edbc7 100644 --- a/doc/arkode/guide/source/Usage/MRIStep_c_interface/Custom_Inner_Stepper/Description.rst +++ b/doc/arkode/guide/source/Usage/MRIStep_c_interface/Custom_Inner_Stepper/Description.rst @@ -365,6 +365,11 @@ member functions: **Example codes:** * ``examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp`` +Optional Member Functions +""""""""""""""""""""""""" + +An :c:type:`MRIStepInnerStepper` *may* provide implementations of any of the +following member functions: .. c:type:: int (*MRIStepInnerFullRhsFn)(MRIStepInnerStepper stepper, realtype t, N_Vector v, N_Vector f, int mode) @@ -393,11 +398,9 @@ member functions: **Example codes:** * ``examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp`` -Optional Member Functions -""""""""""""""""""""""""" + .. versionchanged:: vX.X.X -An :c:type:`MRIStepInnerStepper` *may* provide implementations of any of the -following member functions: + Supplying a full right-hand side function was made optional. .. c:type:: int (*MRIStepInnerResetFn)(MRIStepInnerStepper stepper, realtype tR, N_Vector vR) diff --git a/doc/arkode/guide/source/Usage/SPRKStep_c_interface/index.rst b/doc/arkode/guide/source/Usage/SPRKStep_c_interface/index.rst index dc35fb2030..ed65b70324 100644 --- a/doc/arkode/guide/source/Usage/SPRKStep_c_interface/index.rst +++ b/doc/arkode/guide/source/Usage/SPRKStep_c_interface/index.rst @@ -17,19 +17,19 @@ Using the SPRKStep time-stepping module ========================================== This chapter is concerned with the use of the SPRKStep time-stepping module for -the solution of Hamiltonian initial value problems (IVPs) of the form -:eq:`ARKODE_IVP_Hamiltonian` in a C or C++ language setting. The following sections +the solution of initial value problems (IVPs) of the form +:eq:`ARKODE_IVP_SPRK` in a C or C++ language setting. The following sections discuss the header files and the layout of the user's main program, and provide descriptions of the SPRKStep user-callable functions and user-supplied functions. -The example programs located in the source code ``examples/arkode`` folder, may +The example programs located in the source code ``examples/arkode`` folder, may be helpful as templates for new codes. In particular, * ``examples/arkode/C_serial/ark_harmonic_symplectic.c`` * ``examples/arkode/C_serial/ark_damped_harmonic_symplectic.c``, and * ``examples/arkode/C_serial/ark_kepler.c`` -demonstrate ``SPRKStep`` usage. +demonstrate ``SPRKStep`` usage. SPRKStep uses the input and output constants from the shared ARKODE infrastructure. These are defined as needed in this chapter, but for convenience the full list is diff --git a/doc/sundials_developers/source/conf.py b/doc/sundials_developers/source/conf.py index 24e5e80f31..05d04cde08 100644 --- a/doc/sundials_developers/source/conf.py +++ b/doc/sundials_developers/source/conf.py @@ -34,7 +34,8 @@ def setup(app: Sphinx): # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx_rtd_theme', 'sphinx.ext.ifconfig', 'sphinx.ext.mathjax', - 'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex', 'sphinx_copybutton'] + 'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex', + 'sphinx_copybutton', 'sphinx.ext.graphviz'] # References bibtex_bibfiles = ['../../shared/sundials.bib'] diff --git a/doc/sundials_developers/source/index.rst b/doc/sundials_developers/source/index.rst index 901544a729..6fb64c1b28 100644 --- a/doc/sundials_developers/source/index.rst +++ b/doc/sundials_developers/source/index.rst @@ -28,5 +28,6 @@ SUNDIALS Developers Guide benchmarks/index pull_requests/index releases/index + packages/index appendix/index references diff --git a/doc/sundials_developers/source/packages/ARKODE.rst b/doc/sundials_developers/source/packages/ARKODE.rst new file mode 100644 index 0000000000..7f51198df8 --- /dev/null +++ b/doc/sundials_developers/source/packages/ARKODE.rst @@ -0,0 +1,283 @@ +.. + Author(s): David J. Gardner @ LLNL + ----------------------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2023, Lawrence Livermore National Security + and Southern Methodist University. + All rights reserved. + + See the top-level LICENSE and NOTICE files for details. + + SPDX-License-Identifier: BSD-3-Clause + SUNDIALS Copyright End + ----------------------------------------------------------------------------- + +.. _ARKODE.ERKFullRHS: + +ERKStep Full RHS +================ + +.. digraph:: erk_fullrhs + + node [shape=box] + splines=ortho + + // ----------------- + // Before first step + // ----------------- + + init [label="Initialize integrator\lCopy t0, y0 to tn, yn\l"] + f0cur [label="Set fn_is_current to False", style=filled, fillcolor=tomato1] + h0 [label="Is h0 provided?", target="_top"] + f0_q1 [label="Has f(tn, yn) been computed?"] + eval1 [label="Evaluate f(tn, yn)\lStore in F[0]\lCopy F[0] to fn\l", style=filled, fillcolor=lightskyblue] + fcur1 [label="Set fn_is_current to True", style=filled, fillcolor=lightgreen] + h0_comp [label="Compute h0"] + start [label="Start Step"] + + init -> f0cur -> h0 + h0 -> start [taillabel="Yes", labeldistance=2, labelangle=45] + h0 -> f0_q1 [taillabel="No", labeldistance=2, labelangle=-45] + f0_q1 -> h0_comp [taillabel="Yes", labeldistance=2, labelangle=-45] + f0_q1 -> eval1 [taillabel="No", labeldistance=2, labelangle=-45] + eval1 -> fcur1 + fcur1 -> h0_comp + h0_comp -> start + + // ---------- + // First step + // ---------- + + f0q2 [label="Has f(tn, yn) been computed?"] + step_q [label="Is this the first step after initial setup?"] + eval2 [label="Evaluate f(tn, yn)\lStore in F[0]\lCopy F[0] to fn\l", style=filled, fillcolor=lightskyblue] + fsal [label="Is the method FSAL?", style=filled, fillcolor=slateblue1] + eval3 [label="Evaluate f(tn, yn)\lStore in F[0]\lCopy F[0] to fn\l", style=filled, fillcolor=slateblue1] + copy1 [label="Copy F[s-1] to F[0]\lCopy F[0] to fn\l", style=filled, fillcolor=slateblue1] + fcur2 [label="Set fn_is_current to True", style=filled, fillcolor=lightgreen] + stages1 [label="Compute Stages"] + complete [label="Complete Step"] + + start -> f0q2 + f0q2 -> stages1 [taillabel="Yes", labeldistance=2, labelangle=45] + f0q2 -> step_q [taillabel="No", labeldistance=2, labelangle=-45] + step_q -> eval2 [taillabel="Yes", labeldistance=2, labelangle=45] + eval2 -> fcur2 + step_q -> fsal [taillabel="No", labeldistance=2, labelangle=-45] + fsal -> eval3 [taillabel="No", labeldistance=2, labelangle=-45] + eval3 -> fcur2 + fsal -> copy1 [taillabel="Yes", labeldistance=2, labelangle=45] + copy1 -> fcur2 + fcur2 -> stages1 -> complete + + // ------------- + // Complete step + // ------------- + + interp_update [label="Interpolation enabled?"] + interp_type1 [label="Using Hermite interpolation?"] + f0q3 [label="Has f(tn, yn) been computed?"] + update_yn [label="Copy tcur, ycur to tn, yn"] + fcur3 [label="Set fn_is_current to False", style=filled, fillcolor=tomato1] + + complete -> interp_update + interp_update -> update_yn [taillabel="No", labeldistance=2, labelangle=45] + interp_update -> interp_type1 [taillabel="Yes", labeldistance=2, labelangle=-45] + interp_type1 -> update_yn [taillabel="No", labeldistance=2, labelangle=45] + interp_type1 -> f0q3 [taillabel="Yes", labeldistance=2, labelangle=-45] + f0q3 -> update_yn [taillabel="Yes", labeldistance=2, labelangle=45] + update_yn -> fcur3 + + // ---------- + // After step + // ---------- + + interp_eval [label="Evaluate interpolant?"] + interp_type2 [label="Using Hermite interpolation?"] + f1q1 [label="Has f(tn, yn) been computed?"] + fsal1 [label="Is the method FSAL?", style=filled, fillcolor=slateblue1] + eval4 [label="Evaluate f(tn, yn)\lStore in F[0]\lCopy F[0] to fn\l", style=filled, fillcolor=slateblue1] + copy2 [label="Copy F[s-1] to F[0]\lCopy F[0] to fn\l", style=filled, fillcolor=slateblue1] + fcur4 [label="Set fn_is_current to True", style=filled, fillcolor=lightgreen] + interp_yout [label="Compute yout"] + step2 [label="Start Next Step"] + + fcur3 -> interp_eval + interp_eval -> step2 [taillabel="No", labeldistance=2, labelangle=45] + interp_eval -> interp_type2 [taillabel="Yes", labeldistance=2, labelangle=-45] + interp_type2 -> interp_yout [taillabel="No", labeldistance=2, labelangle=45] + interp_type2 -> f1q1 [taillabel="Yes", labeldistance=2, labelangle=-45] + f1q1 -> fsal1 [taillabel="No", labeldistance=2, labelangle=45] + fsal1 -> eval4 [taillabel="No", labeldistance=2, labelangle=-45] + eval4 -> fcur4 + fsal1 -> copy2 [taillabel="Yes", labeldistance=2, labelangle=45] + copy2 -> fcur4 + fcur4 -> interp_yout -> step2 + + +ARKStep Full RHS +================ + +.. digraph:: ark_fullrhs_start + :caption: ARKStep Full RHS Start + + node [shape=box, style=filled, fillcolor=white] + splines=ortho + bgcolor=lightskyblue + + // -------------- + // Full RHS Start + // -------------- + + fcur [label="Has f(tn, yn) been computed?"] + eval [label="Evaluate fe(tn, yn), fi(tn,yn)\lStore in Fe[0], Fi[0]\l"] + mass_a [label="Is there a mass matrix?"] + mass_b [label="Is M time dependent?"] + mass_c [label="Solve M(t) u = Fe[0], M(t) v = Fi[0]\lStore u, v in Fe[0], Fi[0]\lCopy Fe[0] + Fi[0] to f\l"] + mass_d [label="Copy Fe[0] + Fi[0] to f\lSolve M x = f\lCopy x to f\l"] + copy [label="Copy Fe[0] + Fi[0] to f"] + return [label="Set fn_is_current to True", style=filled, fillcolor=lightgreen] + + fcur -> copy [taillabel="Yes", labeldistance=2, labelangle=45] + fcur -> eval [taillabel="No", labeldistance=2, labelangle=45] + eval -> mass_a + mass_a -> copy [taillabel="No", labeldistance=2, labelangle=45] + copy -> return + mass_a -> mass_b [taillabel="Yes", labeldistance=2, labelangle=-45] + mass_b -> mass_c [taillabel="Yes", labeldistance=2, labelangle=-45] + mass_c -> return + mass_b -> mass_d [taillabel="No", labeldistance=2, labelangle=45] + mass_d -> return + +.. digraph:: ark_fullrhs_start + :caption: ARKStep Full RHS End + + node [shape=box, style=filled, fillcolor=white] + splines=ortho + bgcolor=slateblue1 + + // ------------ + // Full RHS End + // ------------ + + fcur [label="Has f(tn, yn) been computed?"] + sa [label="Is the method stiffly accurate?"] + eval [label="Evaluate fe(tn, yn), fi(tn, yn)\lStore in Fe[0], Fi[0]\l"] + mass_a1 [label="Is there a mass matrix?"] + mass_a2 [label="Is there a mass matrix?"] + mass_b1 [label="Is M time dependent?"] + mass_b2 [label="Is M time dependent?"] + mass_c [label="Solve M(t) u = Fe[0], M(t) v = Fi[0]\lStore u, v in Fe[0], Fi[0]\lCopy Fe[0] + Fi[0] to fn\l"] + mass_d1 [label="Solve M x = fn\lCopy x to fn\l"] + mass_d2 [label="Copy Fe[0] + Fi[0] to fn\lSolve M x = fn\lCopy x to fn\l"] + copy_1 [label="Copy Fe[0] + Fi[0] to fn"] + copy_2 [label="Copy Fe[s-1], Fi[s-1] to Fe[0], Fi[0]\lCopy Fe[0] + Fi[0] to fn\l"] + return [label="Set fn_is_current to True", style=filled, fillcolor=lightgreen] + + fcur -> copy_1 [taillabel="Yes", labeldistance=2, labelangle=45] + fcur -> sa [taillabel="No", labeldistance=2, labelangle=45] + sa -> copy_2 [taillabel="Yes", labeldistance=2, labelangle=45] + copy_2 -> mass_a1 + mass_a1 -> return [taillabel="No", labeldistance=2, labelangle=-45] + mass_a1 -> mass_b1 [taillabel="Yes", labeldistance=2, labelangle=45] + mass_b1 -> mass_d1 [taillabel="No", labeldistance=2, labelangle=-45] + mass_d1 -> return + mass_b1 -> return [taillabel="Yes", labeldistance=2, labelangle=45] + sa -> eval [taillabel="No", labeldistance=2, labelangle=-45] + eval -> mass_a2 + mass_a2 -> copy_1 [taillabel="No", labeldistance=2, labelangle=45] + copy_1 -> return + mass_a2 -> mass_b2 [taillabel="Yes", labeldistance=2, labelangle=-45] + mass_b2 -> mass_c [taillabel="Yes", labeldistance=2, labelangle=-45] + mass_c -> return + mass_b2 -> mass_d2 [taillabel="No", labeldistance=2, labelangle=45] + mass_d2 -> return + + +.. digraph:: ark_fullrhs + + node [shape=box] + splines=ortho + + // ----------------- + // Before first step + // ----------------- + + init [label="Initialize integrator\lCopy t0, y0 to tn, yn\l"] + f0cur [label="Set fn_is_current to False", style=filled, fillcolor=tomato1] + h0 [label="Is h0 provided?"] + f0_q [label="Has f(tn, yn) been computed?"] + rhs_1 [label="Call Full RHS Start", style=filled, fillcolor=lightskyblue] + h0_comp [label="Compute h0"] + start [label="Start Step"] + + init -> f0cur -> h0 + h0 -> start [taillabel="Yes", labeldistance=2, labelangle=45] + h0 -> f0_q [taillabel="No", labeldistance=2, labelangle=-45] + f0_q -> h0_comp [taillabel="Yes", labeldistance=2, labelangle=45] + f0_q -> rhs_1 [taillabel="No", labeldistance=2, labelangle=-45] + rhs_1 -> h0_comp + h0_comp -> start + + // ---------- + // Start step + // ---------- + + method_q [label="Is the first stage explicit?\nor\nIs the method stiffly accurate and Hermite interpolation is used?"] + step_q [label="Is this the first step after initial setup?"] + fn_q [label="Has f(tn, yn) been computed?"] + rhs_2 [label="Call Full RHS Start", style=filled, fillcolor=lightskyblue] + rhs_3 [label="Call Full RHS End", style=filled, fillcolor=slateblue1] + stages [label="Compute Stages"] + complete [label="Complete Step"] + + start -> method_q + method_q -> stages [taillabel="No", labeldistance=2, labelangle=45] + method_q -> fn_q [taillabel="Yes", labeldistance=2, labelangle=-45] + fn_q -> stages [taillabel="Yes", labeldistance=2, labelangle=-45] + fn_q -> step_q [taillabel="No", labeldistance=2, labelangle=-45] + step_q -> rhs_2 [taillabel="Yes", labeldistance=2, labelangle=-45] + step_q -> rhs_3 [taillabel="No", labeldistance=2, labelangle=-45] + rhs_2 -> stages + rhs_3 -> stages + stages -> complete + + // ------------- + // Complete step + // ------------- + + interp_update [label="Interpolation enabled?"] + interp_type1 [label="Using Hermite interpolation?"] + f0q3 [label="Has f(tn, yn) been computed?"] + rhs3 [label="Call Full RHS Start", style=filled, fillcolor=lightskyblue] + update_yn [label="Copy tcur, ycur to tn, yn"] + fcur1 [label="Set fn_is_current to False", style=filled, fillcolor=tomato1] + + complete -> interp_update + interp_update -> update_yn [taillabel="No", labeldistance=2, labelangle=45] + interp_update -> interp_type1 [taillabel="Yes", labeldistance=2, labelangle=-45] + interp_type1 -> update_yn [taillabel="No", labeldistance=2, labelangle=45] + interp_type1 -> f0q3 [taillabel="Yes", labeldistance=2, labelangle=-45] + f0q3 -> update_yn [taillabel="Yes", labeldistance=2, labelangle=45] + f0q3 -> rhs3 [taillabel="No", labeldistance=2, labelangle=-45] + rhs3 -> update_yn -> fcur1 + + // ---------- + // After step + // ---------- + + interp_eval [label="Evaluate interpolant?"] + interp_type2 [label="Using Hermite interpolation?"] + f1q1 [label="Has f(tn, yn) been computed?"] + rhs4 [label="Call Full RHS End", style=filled, fillcolor=slateblue1] + interp_yout [label="Compute yout"] + return [label="Start Next Step"] + + fcur1 -> interp_eval + interp_eval -> return [taillabel="No", labeldistance=2, labelangle=45] + interp_eval -> interp_type2 [taillabel="Yes", labeldistance=2, labelangle=-45] + interp_type2 -> interp_yout [taillabel="No", labeldistance=2, labelangle=45] + interp_type2 -> f1q1 [taillabel="Yes", labeldistance=2, labelangle=-45] + f1q1 -> interp_yout [taillabel="Yes", labeldistance=2, labelangle=45] + f1q1 -> rhs4 [taillabel="No", labeldistance=2, labelangle=45] + rhs4 -> interp_yout -> return diff --git a/doc/sundials_developers/source/packages/index.rst b/doc/sundials_developers/source/packages/index.rst new file mode 100644 index 0000000000..372543ead6 --- /dev/null +++ b/doc/sundials_developers/source/packages/index.rst @@ -0,0 +1,23 @@ +.. + Author(s): David J. Gardner @ LLNL + ----------------------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2023, Lawrence Livermore National Security + and Southern Methodist University. + All rights reserved. + + See the top-level LICENSE and NOTICE files for details. + + SPDX-License-Identifier: BSD-3-Clause + SUNDIALS Copyright End + ----------------------------------------------------------------------------- + +.. _Packages: + +Packages +=========== + +.. toctree:: + :maxdepth: 2 + + ARKODE diff --git a/doc/sundials_developers/source/style_guide/Documentation.rst b/doc/sundials_developers/source/style_guide/Documentation.rst index 9aae3bfdc7..2041405fb6 100644 --- a/doc/sundials_developers/source/style_guide/Documentation.rst +++ b/doc/sundials_developers/source/style_guide/Documentation.rst @@ -18,7 +18,7 @@ Documentation Style ******************* -Style guide for RestructuredText with Sphinx. For the most part, we attempt +Style guide for reStructuredText with Sphinx. For the most part, we attempt to follow the Python developer's guide commentary on documentation (where relevant): https://devguide.python.org/documenting/#style-guide. diff --git a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp index 15fac77098..1a5c98eeab 100644 --- a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp +++ b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp @@ -307,7 +307,7 @@ struct UserData bool pcg = true; // use PCG (true) or GMRES (false) bool prec = true; // preconditioner on/off bool lsinfo = false; // output residual history - int liniters = 5; // number of linear iterations + int liniters = 10; // number of linear iterations int msbp = 0; // preconditioner setup frequency (0 = default) realtype epslin = ZERO; // linear solver tolerance factor (ZERO = default) N_Vector diag = NULL; // inverse of Jacobian diagonal diff --git a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p_--np_2_2_--imex.out b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p_--np_2_2_--imex.out index b7c7a5805c..06735a9ae5 100644 --- a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p_--np_2_2_--imex.out +++ b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p_--np_2_2_--imex.out @@ -37,7 +37,7 @@ linear = 1 --------------------------------- linear solver = PCG - lin iters = 5 + lin iters = 10 eps lin = 0 prec = 1 msbp = 0 @@ -48,45 +48,45 @@ t ||u||_rms ---------------------------------------------- 0.000000000000000e+00 3.172144385112383e+00 - 5.000000000000000e-01 3.136781978966371e+00 - 1.000000000000000e+00 3.125095500559746e+00 - 1.500000000000000e+00 3.152620956520280e+00 - 2.000000000000000e+00 3.252033049944731e+00 - 2.500000000000000e+00 3.404813950977549e+00 - 3.000000000000000e+00 3.570162567428832e+00 - 3.500000000000000e+00 3.699962132487487e+00 - 4.000000000000000e+00 3.694761763072449e+00 - 4.500000000000000e+00 3.628565769394313e+00 - 5.000000000000000e+00 3.475500510795411e+00 - 5.500000000000000e+00 3.344032274118367e+00 - 6.000000000000000e+00 3.233949925729428e+00 - 6.500000000000000e+00 3.082058120794513e+00 - 7.000000000000000e+00 2.890442427981788e+00 - 7.500000000000000e+00 2.837091032458512e+00 - 8.000000000000000e+00 2.898054545259084e+00 - 8.500000000000000e+00 3.139933622385019e+00 - 9.000000000000000e+00 3.442183323454377e+00 - 9.500000000000000e+00 3.740380013622370e+00 - 1.000000000000000e+01 4.014473424455050e+00 + 5.000000000000000e-01 3.136697189650961e+00 + 1.000000000000000e+00 3.125045556354785e+00 + 1.500000000000000e+00 3.152624763885952e+00 + 2.000000000000000e+00 3.252110216645144e+00 + 2.500000000000000e+00 3.404844617318184e+00 + 3.000000000000000e+00 3.570312084328844e+00 + 3.500000000000000e+00 3.700253327108766e+00 + 4.000000000000000e+00 3.694878484122721e+00 + 4.500000000000000e+00 3.628319195038670e+00 + 5.000000000000000e+00 3.475278388464473e+00 + 5.500000000000000e+00 3.343897893358916e+00 + 6.000000000000000e+00 3.233978972947007e+00 + 6.500000000000000e+00 3.082324512637206e+00 + 7.000000000000000e+00 2.890530860599866e+00 + 7.500000000000000e+00 2.837258314564151e+00 + 8.000000000000000e+00 2.898203339016268e+00 + 8.500000000000000e+00 3.140063067933301e+00 + 9.000000000000000e+00 3.442273509340489e+00 + 9.500000000000000e+00 3.740451074463314e+00 + 1.000000000000000e+01 4.014529388100347e+00 ---------------------------------------------- Final integrator statistics: Steps = 105 - Step attempts = 111 - Error test fails = 6 - RHS reaction = 447 - RHS diffusion = 780 - NLS iters = 333 + Step attempts = 112 + Error test fails = 7 + RHS reaction = 443 + RHS diffusion = 779 + NLS iters = 336 NLS fails = 0 - LS iters = 1638 - LS fails = 300 + LS iters = 2697 + LS fails = 87 LS setups = 0 - LS RHS evals = 1638 - Jv products = 1638 + LS RHS evals = 2697 + Jv products = 2697 Avg NLS iters per step attempt = 3.000000 - Avg LS iters per NLS iter = 4.918919 + Avg LS iters per NLS iter = 8.026786 Preconditioner setups = 0 - Preconditioner solves = 1638 + Preconditioner solves = 2697 diff --git a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p_--np_2_2_--mri-arkstep.out b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p_--np_2_2_--mri-arkstep.out index 44e9ca39ad..ae206aafd4 100644 --- a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p_--np_2_2_--mri-arkstep.out +++ b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p_--np_2_2_--mri-arkstep.out @@ -40,7 +40,7 @@ linear = 1 --------------------------------- linear solver = PCG - lin iters = 5 + lin iters = 10 eps lin = 0 prec = 1 msbp = 0 @@ -51,49 +51,49 @@ t ||u||_rms ---------------------------------------------- 0.000000000000000e+00 3.172144385112383e+00 - 5.000000000000000e-01 3.136741760177363e+00 - 1.000000000000000e+00 3.125063288126960e+00 - 1.500000000000000e+00 3.152612100930424e+00 - 2.000000000000000e+00 3.252042400952964e+00 - 2.500000000000000e+00 3.404761539326434e+00 - 3.000000000000000e+00 3.570183798164206e+00 - 3.500000000000000e+00 3.699958243267201e+00 - 4.000000000000000e+00 3.694644394786519e+00 - 4.500000000000000e+00 3.628182390566946e+00 - 5.000000000000000e+00 3.475214313463735e+00 - 5.500000000000000e+00 3.343937480671038e+00 - 6.000000000000000e+00 3.234080840699362e+00 - 6.500000000000000e+00 3.082501265216459e+00 - 7.000000000000000e+00 2.890793620590566e+00 - 7.500000000000000e+00 2.837373326530296e+00 - 8.000000000000000e+00 2.898190808646831e+00 - 8.500000000000000e+00 3.139962981781891e+00 - 9.000000000000000e+00 3.442134760530028e+00 - 9.500000000000000e+00 3.740312877536207e+00 - 1.000000000000000e+01 4.014396629231554e+00 + 5.000000000000000e-01 3.136741760652088e+00 + 1.000000000000000e+00 3.125063175301122e+00 + 1.500000000000000e+00 3.152612863029649e+00 + 2.000000000000000e+00 3.252046438757223e+00 + 2.500000000000000e+00 3.404770336275880e+00 + 3.000000000000000e+00 3.570197843463192e+00 + 3.500000000000000e+00 3.699979298705992e+00 + 4.000000000000000e+00 3.694673743577147e+00 + 4.500000000000000e+00 3.628192807357139e+00 + 5.000000000000000e+00 3.475181871691853e+00 + 5.500000000000000e+00 3.343883541753708e+00 + 6.000000000000000e+00 3.234020189727759e+00 + 6.500000000000000e+00 3.082396969215168e+00 + 7.000000000000000e+00 2.890645348225157e+00 + 7.500000000000000e+00 2.837264086636537e+00 + 8.000000000000000e+00 2.898204389104409e+00 + 8.500000000000000e+00 3.140043837970826e+00 + 9.000000000000000e+00 3.442234882231944e+00 + 9.500000000000000e+00 3.740410418605710e+00 + 1.000000000000000e+01 4.014486526389547e+00 ---------------------------------------------- Final integrator statistics: Slow Integrator: Steps = 132 - RHS diffusion = 793 + RHS diffusion = 792 NLS iters = 396 NLS fails = 0 - LS iters = 1958 - LS fails = 360 + LS iters = 2633 + LS fails = 1 LS setups = 0 - LS RHS evals = 1958 - Jv products = 1958 + LS RHS evals = 2633 + Jv products = 2633 Avg NLS iters per step attempt = 3.000000 - Avg LS iters per NLS iter = 4.944444 + Avg LS iters per NLS iter = 6.648990 Preconditioner setups = 0 - Preconditioner solves = 1958 + Preconditioner solves = 2633 Fast Integrator: - Steps = 472 - Step attempts = 472 + Steps = 470 + Step attempts = 470 Error test fails = 0 - RHS reaction = 2419 + RHS reaction = 1827 diff --git a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p_--np_2_2_--mri-cvode-global.out b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p_--np_2_2_--mri-cvode-global.out index 7db0c6bb47..eb6c3b2f7a 100644 --- a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p_--np_2_2_--mri-cvode-global.out +++ b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p_--np_2_2_--mri-cvode-global.out @@ -40,7 +40,7 @@ linear = 1 --------------------------------- linear solver = PCG - lin iters = 5 + lin iters = 10 eps lin = 0 prec = 1 msbp = 0 @@ -52,50 +52,50 @@ ---------------------------------------------- 0.000000000000000e+00 3.172144385112383e+00 5.000000000000000e-01 3.136722629465066e+00 - 1.000000000000000e+00 3.125057666159531e+00 - 1.500000000000000e+00 3.152636290021100e+00 - 2.000000000000000e+00 3.252083347119256e+00 - 2.500000000000000e+00 3.404787326260405e+00 - 3.000000000000000e+00 3.570169612064414e+00 - 3.500000000000000e+00 3.699861041719807e+00 - 4.000000000000000e+00 3.694342711292659e+00 - 4.500000000000000e+00 3.627870941932435e+00 - 5.000000000000000e+00 3.474902190560723e+00 - 5.500000000000000e+00 3.343695434939634e+00 - 6.000000000000000e+00 3.233894498163541e+00 - 6.500000000000000e+00 3.082341713678574e+00 - 7.000000000000000e+00 2.890723917928596e+00 - 7.500000000000000e+00 2.837417967150272e+00 - 8.000000000000000e+00 2.898409418371463e+00 - 8.500000000000000e+00 3.140209829663979e+00 - 9.000000000000000e+00 3.442357276093309e+00 - 9.500000000000000e+00 3.740503273636440e+00 - 1.000000000000000e+01 4.014544572497562e+00 + 1.000000000000000e+00 3.125057552024107e+00 + 1.500000000000000e+00 3.152636979017849e+00 + 2.000000000000000e+00 3.252085784090209e+00 + 2.500000000000000e+00 3.404791619294692e+00 + 3.000000000000000e+00 3.570175845435155e+00 + 3.500000000000000e+00 3.699871659893790e+00 + 4.000000000000000e+00 3.694354186527817e+00 + 4.500000000000000e+00 3.627867393042675e+00 + 5.000000000000000e+00 3.474857085470333e+00 + 5.500000000000000e+00 3.343640002216232e+00 + 6.000000000000000e+00 3.233844046127571e+00 + 6.500000000000000e+00 3.082251062694838e+00 + 7.000000000000000e+00 2.890585369424622e+00 + 7.500000000000000e+00 2.837315452756236e+00 + 8.000000000000000e+00 2.898424893363213e+00 + 8.500000000000000e+00 3.140291028418725e+00 + 9.000000000000000e+00 3.442457327275146e+00 + 9.500000000000000e+00 3.740600281636448e+00 + 1.000000000000000e+01 4.014633157708740e+00 ---------------------------------------------- Final integrator statistics: Slow Integrator: Steps = 132 - RHS diffusion = 793 + RHS diffusion = 792 NLS iters = 396 NLS fails = 0 - LS iters = 1958 - LS fails = 361 + LS iters = 2640 + LS fails = 0 LS setups = 0 - LS RHS evals = 1958 - Jv products = 1958 + LS RHS evals = 2640 + Jv products = 2640 Avg NLS iters per step attempt = 3.000000 - Avg LS iters per NLS iter = 4.944444 + Avg LS iters per NLS iter = 6.666667 Preconditioner setups = 0 - Preconditioner solves = 1958 + Preconditioner solves = 2640 Fast Integrator: - Steps = 2058 + Steps = 2057 Error test fails = 392 - RHS reaction = 4992 - NLS iters = 3804 + RHS reaction = 4991 + NLS iters = 3803 NLS fails = 0 diff --git a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p_--np_2_2_--mri-cvode-local.out b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p_--np_2_2_--mri-cvode-local.out index f2aee774c9..2069d3daf0 100644 --- a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p_--np_2_2_--mri-cvode-local.out +++ b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p_--np_2_2_--mri-cvode-local.out @@ -40,7 +40,7 @@ linear = 1 --------------------------------- linear solver = PCG - lin iters = 5 + lin iters = 10 eps lin = 0 prec = 1 msbp = 0 @@ -51,46 +51,46 @@ t ||u||_rms ---------------------------------------------- 0.000000000000000e+00 3.172144385112383e+00 - 5.000000000000000e-01 3.136728159494494e+00 - 1.000000000000000e+00 3.125054277650959e+00 - 1.500000000000000e+00 3.152604392883360e+00 - 2.000000000000000e+00 3.252018267648228e+00 - 2.500000000000000e+00 3.404688232954761e+00 - 3.000000000000000e+00 3.570039091260456e+00 - 3.500000000000000e+00 3.699700617638115e+00 - 4.000000000000000e+00 3.694127992765750e+00 - 4.500000000000000e+00 3.627693732995581e+00 - 5.000000000000000e+00 3.474745808958595e+00 - 5.500000000000000e+00 3.343638848927724e+00 - 6.000000000000000e+00 3.233956510132078e+00 - 6.500000000000000e+00 3.082497090887950e+00 - 7.000000000000000e+00 2.890880779320601e+00 - 7.500000000000000e+00 2.837548720834195e+00 - 8.000000000000000e+00 2.898444607824460e+00 - 8.500000000000000e+00 3.140194708467158e+00 - 9.000000000000000e+00 3.442324814047467e+00 - 9.500000000000000e+00 3.740458273532059e+00 - 1.000000000000000e+01 4.014484356709024e+00 + 5.000000000000000e-01 3.136728141568442e+00 + 1.000000000000000e+00 3.125054078969537e+00 + 1.500000000000000e+00 3.152605475501787e+00 + 2.000000000000000e+00 3.252022913428429e+00 + 2.500000000000000e+00 3.404698680378851e+00 + 3.000000000000000e+00 3.570053730764652e+00 + 3.500000000000000e+00 3.699720763396807e+00 + 4.000000000000000e+00 3.694157931241854e+00 + 4.500000000000000e+00 3.627712125668464e+00 + 5.000000000000000e+00 3.474734466021550e+00 + 5.500000000000000e+00 3.343606933034505e+00 + 6.000000000000000e+00 3.233915506336244e+00 + 6.500000000000000e+00 3.082406527906669e+00 + 7.000000000000000e+00 2.890736516064352e+00 + 7.500000000000000e+00 2.837432528460552e+00 + 8.000000000000000e+00 2.898441248594821e+00 + 8.500000000000000e+00 3.140256919387213e+00 + 9.000000000000000e+00 3.442407086783334e+00 + 9.500000000000000e+00 3.740539247790086e+00 + 1.000000000000000e+01 4.014559182532612e+00 ---------------------------------------------- Final integrator statistics: Slow Integrator: Steps = 132 - RHS diffusion = 793 + RHS diffusion = 792 NLS iters = 396 NLS fails = 0 - LS iters = 1965 - LS fails = 358 + LS iters = 2630 + LS fails = 0 LS setups = 0 - LS RHS evals = 1965 - Jv products = 1965 + LS RHS evals = 2630 + Jv products = 2630 Avg NLS iters per step attempt = 3.000000 - Avg LS iters per NLS iter = 4.962121 + Avg LS iters per NLS iter = 6.641414 Preconditioner setups = 0 - Preconditioner solves = 1965 + Preconditioner solves = 2630 Fast Integrator: Steps = 2002 diff --git a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp index 32623f530c..485c1115ff 100644 --- a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp +++ b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp @@ -1347,7 +1347,7 @@ static int InitUserData(UserData *udata) udata->pcg = true; // use PCG (true) or GMRES (false) udata->prec = true; // enable preconditioning udata->lsinfo = false; // output residual history - udata->liniters = 20; // max linear iterations + udata->liniters = 40; // max linear iterations udata->msbp = 0; // use default (20 steps) udata->epslin = ZERO; // use default (0.05) diff --git a/examples/arkode/CXX_parallel/ark_heat2D_p_--np_2_2.out b/examples/arkode/CXX_parallel/ark_heat2D_p_--np_2_2.out index 5a9b81eb98..7ab208a80b 100644 --- a/examples/arkode/CXX_parallel/ark_heat2D_p_--np_2_2.out +++ b/examples/arkode/CXX_parallel/ark_heat2D_p_--np_2_2.out @@ -26,7 +26,7 @@ linear = 1 --------------------------------- linear solver = PCG - lin iters = 20 + lin iters = 40 eps lin = 0 prec = 1 msbp = 0 @@ -37,45 +37,45 @@ t ||u||_rms max error ----------------------------------------------------------------------- 0.000000000000000e+00 3.632812500000001e-01 0.000000000000000e+00 - 5.000000000000000e-02 3.551986504206954e-01 2.454704268845198e-03 - 1.000000000000000e-01 3.296221522563136e-01 2.894351312350718e-03 - 1.500000000000000e-01 2.894445052045986e-01 2.833234860738609e-03 - 2.000000000000000e-01 2.387097405487202e-01 2.521351471365452e-03 - 2.500000000000000e-01 1.824253004688915e-01 2.077548067353219e-03 - 3.000000000000000e-01 1.261158186733340e-01 1.577622926918210e-03 - 3.500000000000000e-01 7.529892942993587e-02 1.082586631952070e-03 - 4.000000000000000e-01 3.495153500642601e-02 6.466745969102711e-04 - 4.500000000000000e-01 9.023447459645315e-03 3.130355812321628e-04 - 4.999999999999999e-01 5.513862655620992e-05 1.155536642670245e-04 - 5.499999999999999e-01 8.918873554259306e-03 7.364539806451950e-05 - 6.000000000000000e-01 3.475277433850531e-02 1.915331682145610e-04 - 6.500000000000000e-01 7.502605966973638e-02 4.576681070362631e-04 - 7.000000000000001e-01 1.257964113977601e-01 8.457898377413064e-04 - 7.500000000000001e-01 1.820944185535271e-01 1.318767636581897e-03 - 8.000000000000002e-01 2.384087203852070e-01 1.828962145097535e-03 - 8.500000000000002e-01 2.892272171327287e-01 2.327446157641688e-03 - 9.000000000000002e-01 3.295754296203942e-01 2.765080717683888e-03 - 9.500000000000003e-01 3.555038632193712e-01 3.099435546668361e-03 - 1.000000000000000e+00 3.644741937247666e-01 3.297054597400817e-03 + 5.000000000000000e-02 3.551988422773351e-01 2.455482033533629e-03 + 1.000000000000000e-01 3.296234292363186e-01 2.897896070159778e-03 + 1.500000000000000e-01 2.894441908882201e-01 2.832303715537221e-03 + 2.000000000000000e-01 2.387114782162635e-01 2.525801964766261e-03 + 2.500000000000000e-01 1.824256478587985e-01 2.078269197756610e-03 + 3.000000000000000e-01 1.261168083661019e-01 1.580109403207297e-03 + 3.500000000000000e-01 7.529981277589509e-02 1.084790395311314e-03 + 4.000000000000000e-01 3.495180900127044e-02 6.472682226835030e-04 + 4.500000000000000e-01 9.023693954928847e-03 3.135810291332412e-04 + 4.999999999999999e-01 5.528701553701492e-05 1.158664422041093e-04 + 5.499999999999999e-01 8.918915917846342e-03 7.372606743541107e-05 + 6.000000000000000e-01 3.475275192986246e-02 1.914158585883952e-04 + 6.500000000000000e-01 7.502609251530372e-02 4.577116765183409e-04 + 7.000000000000001e-01 1.257965751119296e-01 8.461653253856172e-04 + 7.500000000000001e-01 1.820941861384917e-01 1.318095298729283e-03 + 8.000000000000002e-01 2.384093995726680e-01 1.830603288722976e-03 + 8.500000000000002e-01 2.892274536259308e-01 2.327914434912759e-03 + 9.000000000000002e-01 3.295751200296289e-01 2.764242715472154e-03 + 9.500000000000003e-01 3.555039203503529e-01 3.099492697821171e-03 + 1.000000000000000e+00 3.644737419510748e-01 3.296010382116465e-03 ----------------------------------------------------------------------- Final integrator statistics: - Steps = 201 - Step attempts = 225 - Error test fails = 24 - RHS evals = 1578 - NLS iters = 675 + Steps = 124 + Step attempts = 125 + Error test fails = 1 + RHS evals = 753 + NLS iters = 375 NLS fails = 0 - LS iters = 13075 - LS fails = 623 - LS setups = 82 - LS RHS evals = 13075 - Jv products = 13075 + LS iters = 12925 + LS fails = 36 + LS setups = 56 + LS RHS evals = 12925 + Jv products = 12925 Avg NLS iters per step attempt = 3.000000 - Avg LS iters per NLS iter = 19.370370 + Avg LS iters per NLS iter = 34.466667 - Preconditioner setups = 26 - Preconditioner solves = 13075 + Preconditioner setups = 4 + Preconditioner solves = 12925 - Max error = 3.297054597400817e-03 + Max error = 3.296010382116465e-03 diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls_--np_2_2.out b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls_--np_2_2.out index 995ecf1103..caced8662d 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls_--np_2_2.out +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls_--np_2_2.out @@ -39,33 +39,33 @@ t ||u||_rms max error ----------------------------------------------------------------------- 0.000000000000000e+00 3.691406249999997e-01 0.000000000000000e+00 - 5.000000000000000e-02 3.603048616851151e-01 5.947581797283163e-04 - 1.000000000000000e-01 3.341442212572840e-01 7.029487839260717e-04 - 1.500000000000000e-01 2.933129364211772e-01 6.872104501928211e-04 - 2.000000000000000e-01 2.418371827909151e-01 6.138967488541480e-04 - 2.500000000000000e-01 1.847632280527681e-01 5.043531323443151e-04 - 3.000000000000000e-01 1.276840002010777e-01 3.835930211336658e-04 - 3.500000000000000e-01 7.618719033675811e-02 2.636045435802092e-04 - 4.000000000000000e-01 3.531419593151618e-02 1.573064662659523e-04 - 4.500000000000000e-01 9.066519343283548e-03 7.648430090645419e-05 - 4.999999999999999e-01 1.366001184678036e-05 2.823151530294188e-05 - 5.499999999999999e-01 9.040623250818201e-03 1.797011524983308e-05 - 6.000000000000000e-01 3.526521493345149e-02 4.668317652109510e-05 - 6.500000000000000e-01 7.611978800433235e-02 1.113065341032948e-04 - 7.000000000000001e-01 1.276052139912309e-01 2.055078043680103e-04 - 7.500000000000001e-01 1.846816872673240e-01 3.198179447260197e-04 - 8.000000000000002e-01 2.417622665681260e-01 4.436012109942933e-04 - 8.500000000000002e-01 2.932595626602583e-01 5.646811622962433e-04 - 9.000000000000002e-01 3.341325736101829e-01 6.709854988270481e-04 - 9.500000000000003e-01 3.603805168277087e-01 7.524532455107646e-04 - 1.000000000000000e+00 3.694333172773836e-01 7.994041692465093e-04 + 5.000000000000000e-02 3.603048616826305e-01 5.947581725728179e-04 + 1.000000000000000e-01 3.341442212752840e-01 7.029488321168564e-04 + 1.500000000000000e-01 2.933129364265377e-01 6.872104657476008e-04 + 2.000000000000000e-01 2.418371828053933e-01 6.138967875570778e-04 + 2.500000000000000e-01 1.847632280574957e-01 5.043531454586581e-04 + 3.000000000000000e-01 1.276840002086280e-01 3.835930415112543e-04 + 3.500000000000000e-01 7.618719032747635e-02 2.636045188839364e-04 + 4.000000000000000e-01 3.531419592900913e-02 1.573064596348678e-04 + 4.500000000000000e-01 9.066519339379787e-03 7.648429036438351e-05 + 4.999999999999999e-01 1.366001182955177e-05 2.823151525618881e-05 + 5.499999999999999e-01 9.040623249804479e-03 1.797011257123962e-05 + 6.000000000000000e-01 3.526521493542883e-02 4.668318201425659e-05 + 6.500000000000000e-01 7.611978800168785e-02 1.113065272947134e-04 + 7.000000000000001e-01 1.276052139795591e-01 2.055077733625899e-04 + 7.500000000000001e-01 1.846816872915430e-01 3.198180091384950e-04 + 8.000000000000002e-01 2.417622665897318e-01 4.436012686822588e-04 + 8.500000000000002e-01 2.932595626759321e-01 5.646812043804683e-04 + 9.000000000000002e-01 3.341325736187308e-01 6.709855218931526e-04 + 9.500000000000003e-01 3.603805168237891e-01 7.524532351810276e-04 + 1.000000000000000e+00 3.694333172786589e-01 7.994041731159696e-04 ----------------------------------------------------------------------- Final integrator statistics: Steps = 134 Step attempts = 135 Error test fails = 1 - RHS evals = 948 + RHS evals = 813 NLS iters = 405 NLS fails = 0 LS iters = 2925 @@ -76,4 +76,4 @@ Final integrator statistics: Avg NLS iters per step attempt = 3.000000 Avg LS iters per NLS iter = 7.222222 - Max error = 7.994041692465093e-04 + Max error = 7.994041731159696e-04 diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_--np_2_2.out b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_--np_2_2.out index 72c9868caa..3aa6089418 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_--np_2_2.out +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_--np_2_2.out @@ -40,33 +40,33 @@ t ||u||_rms max error ----------------------------------------------------------------------- 0.000000000000000e+00 3.691406249999997e-01 0.000000000000000e+00 - 5.000000000000000e-02 3.603048619327799e-01 5.947588761685552e-04 - 1.000000000000000e-01 3.341442198324603e-01 7.029449875427529e-04 - 1.500000000000000e-01 2.933129359408688e-01 6.872090865805980e-04 - 2.000000000000000e-01 2.418371816114719e-01 6.138936173949450e-04 - 2.500000000000000e-01 1.847632276987459e-01 5.043521686299290e-04 - 3.000000000000000e-01 1.276839996709629e-01 3.835916125021210e-04 - 3.500000000000000e-01 7.618719090432620e-02 2.636060692945696e-04 - 4.000000000000000e-01 3.531419605764338e-02 1.573068055824300e-04 - 4.500000000000000e-01 9.066519483453687e-03 7.648468362444691e-05 - 4.999999999999999e-01 1.366000934602030e-05 2.823150954460473e-05 - 5.499999999999999e-01 9.040623272556180e-03 1.797017413211754e-05 - 6.000000000000000e-01 3.526521486171871e-02 4.668298506418922e-05 - 6.500000000000000e-01 7.611978811657902e-02 1.113068278075224e-04 - 7.000000000000001e-01 1.276052146286863e-01 2.055095081313074e-04 - 7.500000000000001e-01 1.846816856478577e-01 3.198136633395521e-04 - 8.000000000000002e-01 2.417622647584950e-01 4.435963861751935e-04 - 8.500000000000002e-01 2.932595610245435e-01 5.646767564563282e-04 - 9.000000000000002e-01 3.341325725110011e-01 6.709825281477899e-04 - 9.500000000000003e-01 3.603805174370124e-01 7.524548362450867e-04 - 1.000000000000000e+00 3.694333171114552e-01 7.994036412738437e-04 + 5.000000000000000e-02 3.603048619753333e-01 5.947590016540660e-04 + 1.000000000000000e-01 3.341442195764323e-01 7.029443280297532e-04 + 1.500000000000000e-01 2.933129358633914e-01 6.872088817982958e-04 + 2.000000000000000e-01 2.418371813857269e-01 6.138930097124851e-04 + 2.500000000000000e-01 1.847632276239268e-01 5.043519623673109e-04 + 3.000000000000000e-01 1.276839995499893e-01 3.835912864304514e-04 + 3.500000000000000e-01 7.618719105489918e-02 2.636064591631515e-04 + 4.000000000000000e-01 3.531419609803035e-02 1.573069173000513e-04 + 4.500000000000000e-01 9.066519524079126e-03 7.648478735214695e-05 + 4.999999999999999e-01 1.366000892977262e-05 2.823150845772370e-05 + 5.499999999999999e-01 9.040623278407151e-03 1.797019017690110e-05 + 6.000000000000000e-01 3.526521486057654e-02 4.668298068317978e-05 + 6.500000000000000e-01 7.611978811031622e-02 1.113068150605245e-04 + 7.000000000000001e-01 1.276052145445968e-01 2.055092828922023e-04 + 7.500000000000001e-01 1.846816859443554e-01 3.198144283996229e-04 + 8.000000000000002e-01 2.417622651778854e-01 4.435975267760295e-04 + 8.500000000000002e-01 2.932595614654954e-01 5.646779628073473e-04 + 9.000000000000002e-01 3.341325728392148e-01 6.709834145076643e-04 + 9.500000000000003e-01 3.603805172400869e-01 7.524543311739906e-04 + 1.000000000000000e+00 3.694333171606730e-01 7.994038031826634e-04 ----------------------------------------------------------------------- Final integrator statistics: Steps = 134 Step attempts = 135 Error test fails = 1 - RHS evals = 948 + RHS evals = 813 NLS iters = 405 NLS fails = 0 LS iters = 2482 @@ -82,4 +82,4 @@ Final integrator statistics: Preconditioner solves = 2482 PFMG iters = 2482 - Max error = 7.994036412738437e-04 + Max error = 7.994038031826634e-04 diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex_--np_2_2.out b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex_--np_2_2.out index 370707799c..66fc95aae1 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex_--np_2_2.out +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex_--np_2_2.out @@ -40,15 +40,15 @@ t ||u||_rms ---------------------------------------------- 0.000000000000000e+00 3.691406249999997e-01 - 1.000000000000000e-01 5.162013648736323e-02 - 2.000000000000000e-01 7.426103375907699e-03 - 3.000000000000000e-01 1.067221964126028e-03 - 4.000000000000000e-01 1.533639279173463e-04 - 5.000000000000000e-01 2.203893657177772e-05 - 6.000000000000000e-01 3.167052399497521e-06 - 7.000000000000000e-01 4.550960415372650e-07 - 7.999999999999999e-01 6.537285820788082e-08 - 8.999999999999999e-01 9.413914309992992e-09 + 1.000000000000000e-01 5.162013561953564e-02 + 2.000000000000000e-01 7.426103216931702e-03 + 3.000000000000000e-01 1.067221955570474e-03 + 4.000000000000000e-01 1.533639242649863e-04 + 5.000000000000000e-01 2.203893152743892e-05 + 6.000000000000000e-01 3.167052161936452e-06 + 7.000000000000000e-01 4.550959197622963e-07 + 7.999999999999999e-01 6.537253782319481e-08 + 8.999999999999999e-01 9.573763963251624e-09 1.000000000000000e+00 1.326291426916513e-09 ---------------------------------------------- @@ -56,7 +56,7 @@ Final fast integrator statistics: Steps = 722 Step attempts = 722 Error test fails = 0 - RHS evals = 5445 + RHS evals = 5444 NLS iters = 2554 NLS fails = 0 LS iters = 8545 diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri_--np_2_2.out b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri_--np_2_2.out index 0473af4ffa..5c1a518ea8 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri_--np_2_2.out +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri_--np_2_2.out @@ -42,21 +42,21 @@ t ||u||_rms ---------------------------------------------- 0.000000000000000e+00 3.691406249999997e-01 - 1.000000000000000e-01 5.162012484063394e-02 - 2.000000000000000e-01 7.426100623733855e-03 - 3.000000000000000e-01 1.067221389928324e-03 - 4.000000000000000e-01 1.533638122100311e-04 - 5.000000000000000e-01 2.203890106093356e-05 - 6.000000000000000e-01 3.167064486065304e-06 - 7.000000000000000e-01 4.551179117995729e-07 - 7.999999999999999e-01 6.540200053027528e-08 - 8.999999999999999e-01 9.398526428504205e-09 - 1.000000000000000e+00 1.350608973293624e-09 + 1.000000000000000e-01 5.162014241947240e-02 + 2.000000000000000e-01 7.426100187263422e-03 + 3.000000000000000e-01 1.067221316468460e-03 + 4.000000000000000e-01 1.533638016722887e-04 + 5.000000000000000e-01 2.203889954704845e-05 + 6.000000000000000e-01 3.167064268518253e-06 + 7.000000000000000e-01 4.551178805373316e-07 + 7.999999999999999e-01 6.540199603778498e-08 + 8.999999999999999e-01 9.398525782915539e-09 + 1.000000000000000e+00 1.350608880519736e-09 ---------------------------------------------- Final slow integrator statistics: Steps = 1000 - RHS evals = 7356 + RHS evals = 7355 NLS iters = 3355 NLS fails = 0 LS iters = 10603 @@ -74,7 +74,7 @@ Final fast integrator statistics: Steps = 3003 Step attempts = 3003 Error test fails = 0 - RHS evals = 33857 + RHS evals = 29862 NLS iters = 17842 NLS fails = 0 LS iters = 10048 diff --git a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.out b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.out index 06a9c9284d..ea8c1ea7d6 100644 --- a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.out +++ b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.out @@ -31,15 +31,15 @@ Problem parameters and options: t ||y||_rms ---------------------------------------------- 0.000000000000000e+00 4.029895706298216e+00 - 3.000000000000000e-01 3.942279347418077e+00 - 6.000000000000000e-01 3.877431469116385e+00 - 8.999999999999999e-01 3.793649083180712e+00 - 1.200000000000000e+00 3.689067746332020e+00 - 1.500000000000000e+00 3.567028985343041e+00 - 1.800000000000000e+00 3.439281992076554e+00 - 2.100000000000000e+00 3.320144385200880e+00 - 2.400000000000000e+00 3.219721039168443e+00 - 2.700000000000000e+00 3.146930769180139e+00 + 3.000000000000000e-01 3.942280121135499e+00 + 6.000000000000000e-01 3.877434662389668e+00 + 8.999999999999999e-01 3.793654006700049e+00 + 1.200000000000000e+00 3.689067718768748e+00 + 1.500000000000000e+00 3.567028830880791e+00 + 1.800000000000000e+00 3.439281683889970e+00 + 2.100000000000000e+00 3.320143971224290e+00 + 2.400000000000000e+00 3.219720187221883e+00 + 2.700000000000000e+00 3.146931515115551e+00 3.000000000000000e+00 3.110922385062612e+00 ---------------------------------------------- @@ -47,8 +47,8 @@ Final integrator statistics: Steps = 23 Step attempts = 24 Error test fails = 0 - Explicit RHS evals = 96 - Implicit RHS evals = 288 + Explicit RHS evals = 94 + Implicit RHS evals = 286 NLS iters = 192 NLS fails = 7 LS setups = 16 diff --git a/examples/arkode/CXX_serial/ark_heat2D.cpp b/examples/arkode/CXX_serial/ark_heat2D.cpp index 3a78042a25..ae654ff5d0 100644 --- a/examples/arkode/CXX_serial/ark_heat2D.cpp +++ b/examples/arkode/CXX_serial/ark_heat2D.cpp @@ -691,7 +691,7 @@ static int InitUserData(UserData *udata) udata->pcg = true; // use PCG (true) or GMRES (false) udata->prec = true; // enable preconditioning udata->lsinfo = false; // output residual history - udata->liniters = 20; // max linear iterations + udata->liniters = 40; // max linear iterations udata->msbp = 0; // use default (20 steps) udata->epslin = ZERO; // use default (0.05) diff --git a/examples/arkode/CXX_serial/ark_heat2D.out b/examples/arkode/CXX_serial/ark_heat2D.out index 78a569fc79..07fbd3c159 100644 --- a/examples/arkode/CXX_serial/ark_heat2D.out +++ b/examples/arkode/CXX_serial/ark_heat2D.out @@ -20,7 +20,7 @@ linear = 1 --------------------------------- linear solver = PCG - lin iters = 20 + lin iters = 40 eps lin = 0 prec = 1 msbp = 0 @@ -31,45 +31,45 @@ t ||u||_rms max error ----------------------------------------------------------------------- 0.000000000000000e+00 3.632812500000000e-01 0.000000000000000e+00 - 5.000000000000000e-02 3.551986506970737e-01 2.454708334354683e-03 - 1.000000000000000e-01 3.296221524496879e-01 2.894333980192343e-03 - 1.500000000000000e-01 2.894444182004682e-01 2.832987149069655e-03 - 2.000000000000000e-01 2.387098264599945e-01 2.521582136275402e-03 - 2.500000000000000e-01 1.824252212041233e-01 2.077346466104524e-03 - 3.000000000000000e-01 1.261157381228246e-01 1.577424243514536e-03 - 3.500000000000000e-01 7.529904383258686e-02 1.082876471873273e-03 - 4.000000000000000e-01 3.495155701826252e-02 6.467375369675482e-04 - 4.500000000000000e-01 9.023496104529438e-03 3.131515037812990e-04 - 4.999999999999999e-01 5.514776992824374e-05 1.155729556710013e-04 - 5.499999999999999e-01 8.918881510806801e-03 7.366549900058444e-05 - 6.000000000000000e-01 3.475274602119641e-02 1.914543241995081e-04 - 6.500000000000000e-01 7.502608870114677e-02 4.577447220200370e-04 - 7.000000000000001e-01 1.257965457940830e-01 8.461313384890978e-04 - 7.500000000000001e-01 1.820944007923683e-01 1.318710942714962e-03 - 8.000000000000002e-01 2.384087154352889e-01 1.828963073706169e-03 - 8.500000000000002e-01 2.892273973706390e-01 2.327791690218795e-03 - 9.000000000000002e-01 3.295756160298886e-01 2.765521979463892e-03 - 9.500000000000003e-01 3.555038689873394e-01 3.099441273207049e-03 - 1.000000000000000e+00 3.644742066608401e-01 3.297074883238493e-03 + 5.000000000000000e-02 3.551988422792973e-01 2.455482048598578e-03 + 1.000000000000000e-01 3.296234292110422e-01 2.897895995286115e-03 + 1.500000000000000e-01 2.894441909302122e-01 2.832303854545248e-03 + 2.000000000000000e-01 2.387114783517686e-01 2.525802321085235e-03 + 2.500000000000000e-01 1.824256479734333e-01 2.078269488693274e-03 + 3.000000000000000e-01 1.261168083293890e-01 1.580109287144749e-03 + 3.500000000000000e-01 7.529981275357446e-02 1.084790334542951e-03 + 4.000000000000000e-01 3.495180902992235e-02 6.472683008614116e-04 + 4.500000000000000e-01 9.023693952669724e-03 3.135810223303982e-04 + 4.999999999999999e-01 5.528701552159280e-05 1.158664421454541e-04 + 5.499999999999999e-01 8.918915918112386e-03 7.372606746483198e-05 + 6.000000000000000e-01 3.475275193284167e-02 1.914158675670324e-04 + 6.500000000000000e-01 7.502609250656343e-02 4.577116535290637e-04 + 7.000000000000001e-01 1.257965751177328e-01 8.461653470575592e-04 + 7.500000000000001e-01 1.820941861469086e-01 1.318095315867573e-03 + 8.000000000000002e-01 2.384093995809592e-01 1.830603315116197e-03 + 8.500000000000002e-01 2.892274536079913e-01 2.327914393411401e-03 + 9.000000000000002e-01 3.295751199857850e-01 2.764242599605837e-03 + 9.500000000000003e-01 3.555039203642584e-01 3.099492771073020e-03 + 1.000000000000000e+00 3.644737419562301e-01 3.296010393803339e-03 ----------------------------------------------------------------------- Final integrator statistics: - Steps = 198 - Step attempts = 220 - Error test fails = 22 - RHS evals = 1543 - NLS iters = 660 + Steps = 124 + Step attempts = 125 + Error test fails = 1 + RHS evals = 753 + NLS iters = 375 NLS fails = 0 - LS iters = 12758 - LS fails = 609 - LS setups = 77 - LS RHS evals = 12758 - Jv products = 12758 + LS iters = 12926 + LS fails = 37 + LS setups = 56 + LS RHS evals = 12926 + Jv products = 12926 Avg NLS iters per step attempt = 3.000000 - Avg LS iters per NLS iter = 19.330303 + Avg LS iters per NLS iter = 34.469333 - Preconditioner setups = 24 - Preconditioner solves = 12758 + Preconditioner setups = 4 + Preconditioner solves = 12926 - Max error = 3.297074883238493e-03 + Max error = 3.296010393803339e-03 diff --git a/examples/arkode/CXX_serial/ark_kpr_Mt.cpp b/examples/arkode/CXX_serial/ark_kpr_Mt.cpp index 53a6e56ec5..83e549c031 100644 --- a/examples/arkode/CXX_serial/ark_kpr_Mt.cpp +++ b/examples/arkode/CXX_serial/ark_kpr_Mt.cpp @@ -631,6 +631,8 @@ static int check_order(void *arkode_mem, N_Vector y, realtype T0, if (check_retval(&retval, "ARKStepSetLSetupFrequency", 1)) return 1; retval = ARKStepSetMaxNonlinIters(arkode_mem, 20); if (check_retval(&retval, "ARKStepSetMaxNonlinIters", 1)) return 1; + retval = ARKStepSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); + if (check_retval(&retval, "ARKStepSetNonlinConvCoef", 1)) return 1; } // Set array of fixed step sizes to use, storage for corresponding errors/orders diff --git a/examples/arkode/CXX_serial/ark_kpr_Mt_0_-4.out b/examples/arkode/CXX_serial/ark_kpr_Mt_0_-4.out index 28232c62c7..8a2bebd177 100644 --- a/examples/arkode/CXX_serial/ark_kpr_Mt_0_-4.out +++ b/examples/arkode/CXX_serial/ark_kpr_Mt_0_-4.out @@ -16,8 +16,8 @@ Nonlinear Kvaerno-Prothero-Robinson test problem with mass matrix: h = 1.250e-01, error = 1.367e-05, order = 1.54 h = 6.250e-02, error = 3.085e-06, order = 2.15 h = 3.125e-02, error = 4.714e-07, order = 2.71 - h = 1.562e-02, error = 5.336e-08, order = 3.14 - h = 7.812e-03, error = 4.819e-09, order = 3.47 - h = 3.906e-03, error = 3.726e-10, order = 3.69 + h = 1.562e-02, error = 5.337e-08, order = 3.14 + h = 7.812e-03, error = 4.828e-09, order = 3.47 + h = 3.906e-03, error = 3.726e-10, order = 3.70 ----------------------------------------------------- - Order: max = 3.69, avg = 2.53, overall = 2.57 [SUCCESS] + Order: max = 3.70, avg = 2.53, overall = 2.57 [SUCCESS] diff --git a/examples/arkode/CXX_serial/ark_kpr_Mt_0_3_0_-10_0.out b/examples/arkode/CXX_serial/ark_kpr_Mt_0_3_0_-10_0.out index f38ae7c147..e3c31815e3 100644 --- a/examples/arkode/CXX_serial/ark_kpr_Mt_0_3_0_-10_0.out +++ b/examples/arkode/CXX_serial/ark_kpr_Mt_0_3_0_-10_0.out @@ -12,117 +12,117 @@ Nonlinear Kvaerno-Prothero-Robinson test problem with mass matrix: t u v uerr verr ------------------------------------------------------ -3.000000 0.710636 1.363407 0.00e+00 0.00e+00 - -2.900000 0.717671 1.324640 3.70e-04 2.29e-03 - -2.800000 0.727992 1.287515 7.44e-04 2.84e-03 - -2.700000 0.741092 1.251460 8.46e-04 2.58e-03 - -2.600000 0.757028 1.216006 1.01e-03 2.39e-03 - -2.500000 0.775576 1.181098 1.35e-03 2.76e-03 - -2.400000 0.795610 1.149093 1.06e-03 1.79e-03 - -2.300000 0.818403 1.117287 1.79e-03 2.67e-03 - -2.200000 0.842494 1.088504 2.40e-03 3.06e-03 - -2.100000 0.867789 1.062951 3.16e-03 3.25e-03 - -2.000000 0.890243 1.044103 3.40e-04 2.64e-04 - -1.900000 0.918743 1.024377 3.13e-03 2.12e-03 - -1.800000 0.944502 1.011651 3.01e-03 1.34e-03 - -1.700000 0.967983 1.003922 7.30e-04 2.37e-04 - -1.600000 0.996105 0.999928 3.43e-03 2.85e-04 - -1.500000 1.019955 1.001656 2.42e-03 4.05e-04 - -1.400000 1.043204 1.007716 1.58e-03 4.68e-04 - -1.300000 1.068074 1.019878 3.30e-03 1.82e-03 - -1.200000 1.088381 1.034712 1.56e-03 1.29e-03 - -1.100000 1.109643 1.054948 2.03e-03 1.96e-03 - -1.000000 1.129780 1.079804 2.77e-03 3.45e-03 - -0.900000 1.145536 1.104049 6.32e-04 1.02e-03 - -0.800000 1.163216 1.136066 2.03e-03 3.53e-03 - -0.700000 1.177736 1.168573 1.97e-03 4.19e-03 - -0.600000 1.188627 1.198295 7.04e-05 2.31e-04 - -0.500000 1.201096 1.237762 1.60e-03 4.65e-03 - -0.400000 1.209605 1.273093 1.08e-03 4.01e-03 - -0.300000 1.215977 1.307261 3.83e-04 1.70e-03 - -0.200000 1.221524 1.347217 8.55e-04 5.08e-03 - -0.100000 1.224023 1.381573 2.99e-04 3.11e-03 - 0.000000 1.224915 1.417046 1.70e-04 2.83e-03 - 0.100000 1.223682 1.453905 4.31e-05 4.83e-03 - 0.200000 1.220491 1.484604 1.78e-04 1.81e-03 - 0.300000 1.215142 1.518474 4.52e-04 3.38e-03 - 0.400000 1.207613 1.549792 9.12e-04 4.02e-03 - 0.500000 1.199317 1.575083 1.79e-04 4.64e-04 - 0.600000 1.187241 1.604738 1.32e-03 3.29e-03 - 0.700000 1.174195 1.628977 1.57e-03 2.87e-03 - 0.800000 1.160798 1.649024 3.88e-04 5.83e-04 - 0.900000 1.142674 1.670977 2.23e-03 2.65e-03 - 1.000000 1.125149 1.687306 1.86e-03 1.64e-03 - 1.100000 1.106375 1.701281 1.23e-03 9.26e-04 - 1.200000 1.083821 1.713934 3.00e-03 1.61e-03 - 1.300000 1.063098 1.722088 1.68e-03 5.89e-04 - 1.400000 1.039432 1.728436 2.19e-03 5.91e-04 - 1.500000 1.014086 1.731733 3.44e-03 4.05e-04 - 1.600000 0.991678 1.731904 9.96e-04 2.36e-05 - 1.700000 0.961426 1.728911 5.83e-03 7.32e-04 - 1.800000 0.935542 1.723129 5.95e-03 1.36e-03 - 1.900000 0.909675 1.714513 5.94e-03 1.97e-03 - 2.000000 0.884086 1.703125 5.82e-03 2.54e-03 - 2.100000 0.859058 1.689043 5.57e-03 3.06e-03 - 2.200000 0.835574 1.672856 4.52e-03 3.00e-03 - 2.300000 0.814580 1.655404 2.04e-03 1.61e-03 - 2.400000 0.792171 1.633239 2.37e-03 2.45e-03 - 2.500000 0.771823 1.609184 2.40e-03 2.79e-03 - 2.600000 0.753719 1.582648 2.29e-03 3.38e-03 - 2.700000 0.739155 1.555902 1.09e-03 2.10e-03 - 2.800000 0.726876 1.527066 3.71e-04 1.00e-03 - 2.900000 0.717091 1.495571 2.10e-04 8.41e-04 - 3.000000 0.710388 1.461718 2.48e-04 1.54e-03 - 3.100000 0.707227 1.426224 1.85e-04 2.62e-03 - 3.200000 0.707774 1.389871 6.43e-05 3.55e-03 - 3.300000 0.711937 1.353272 4.17e-04 4.02e-03 - 3.400000 0.719482 1.316831 7.32e-04 3.95e-03 - 3.500000 0.730101 1.280910 8.74e-04 3.31e-03 - 3.600000 0.743437 1.245871 7.25e-04 2.12e-03 - 3.700000 0.759104 1.212075 1.91e-04 4.28e-04 - 3.800000 0.778229 1.176840 7.22e-04 1.35e-03 - 3.900000 0.799673 1.143027 1.53e-03 2.50e-03 - 4.000000 0.822611 1.111958 2.14e-03 3.03e-03 - 4.100000 0.846613 1.084064 2.46e-03 3.01e-03 - 4.200000 0.872616 1.058537 3.78e-03 3.74e-03 - 4.300000 0.896759 1.038903 2.56e-03 2.17e-03 - 4.400000 0.922654 1.022357 2.69e-03 1.56e-03 - 4.500000 0.949804 1.009423 3.97e-03 1.75e-03 - 4.600000 0.971677 1.003131 1.20e-04 1.84e-05 - 4.700000 1.000881 0.999978 3.98e-03 6.03e-05 - 4.800000 1.024123 1.002244 2.48e-03 3.28e-04 - 4.900000 1.048218 1.009872 2.63e-03 1.14e-03 - 5.000000 1.072193 1.022451 3.63e-03 2.12e-03 - 5.100000 1.090618 1.036650 2.10e-04 2.21e-04 - 5.200000 1.114344 1.060263 3.37e-03 3.60e-03 - 5.300000 1.132066 1.083037 1.94e-03 2.42e-03 - 5.400000 1.149808 1.111129 2.05e-03 3.32e-03 - 5.500000 1.166384 1.142517 2.62e-03 4.77e-03 - 5.600000 1.178247 1.170493 2.05e-04 5.64e-04 - 5.700000 1.192675 1.209460 2.15e-03 5.58e-03 - 5.800000 1.202249 1.242415 1.10e-03 3.30e-03 - 5.900000 1.210920 1.279453 1.07e-03 4.26e-03 - 6.000000 1.217779 1.317297 1.19e-03 5.59e-03 - 6.100000 1.221394 1.349080 6.94e-05 8.08e-04 - 6.200000 1.224584 1.390348 5.45e-04 5.82e-03 - 6.300000 1.224861 1.423309 1.45e-04 3.16e-03 - 6.400000 1.223197 1.458922 1.55e-04 4.09e-03 - 6.500000 1.219541 1.493333 4.15e-04 5.01e-03 - 6.600000 1.214349 1.521229 1.94e-04 8.53e-04 - 6.700000 1.205961 1.555583 1.18e-03 4.82e-03 - 6.800000 1.197025 1.581689 7.64e-04 2.41e-03 - 6.900000 1.185091 1.608881 1.44e-03 3.13e-03 - 7.000000 1.171483 1.633589 1.95e-03 3.56e-03 + -2.900000 0.717316 1.326932 1.47e-05 9.30e-07 + -2.800000 0.727263 1.290352 1.55e-05 1.41e-06 + -2.700000 0.740260 1.254041 1.37e-05 9.10e-07 + -2.600000 0.756026 1.218399 1.32e-05 1.28e-06 + -2.500000 0.774239 1.183861 1.16e-05 8.00e-07 + -2.400000 0.794556 1.150884 9.86e-06 9.51e-07 + -2.300000 0.816624 1.119952 8.14e-06 5.76e-07 + -2.200000 0.840096 1.091559 7.49e-06 1.29e-06 + -2.100000 0.864636 1.066203 1.09e-05 9.87e-07 + -2.000000 0.889911 1.044366 8.52e-06 1.42e-06 + -1.900000 0.915620 1.026500 2.77e-06 1.52e-06 + -1.800000 0.941486 1.012993 1.33e-06 1.21e-06 + -1.700000 0.967247 1.004162 5.58e-06 2.92e-06 + -1.600000 0.992663 1.000217 1.08e-05 3.99e-06 + -1.500000 1.017517 1.001257 1.39e-05 5.41e-06 + -1.400000 1.041608 1.007254 1.72e-05 5.39e-06 + -1.300000 1.064756 1.018066 2.11e-05 7.67e-06 + -1.200000 1.086799 1.033429 2.13e-05 6.93e-06 + -1.100000 1.107583 1.053000 2.60e-05 8.00e-06 + -1.000000 1.126983 1.076359 2.70e-05 9.49e-06 + -0.900000 1.144876 1.103036 2.80e-05 7.01e-06 + -0.800000 1.161155 1.132548 3.11e-05 9.47e-06 + -0.700000 1.175735 1.164388 2.88e-05 7.11e-06 + -0.600000 1.188524 1.198072 3.31e-05 7.78e-06 + -0.500000 1.199463 1.233124 3.29e-05 8.30e-06 + -0.400000 1.208491 1.269093 3.27e-05 5.77e-06 + -0.300000 1.215559 1.305564 3.51e-05 7.20e-06 + -0.200000 1.220638 1.342141 3.14e-05 4.88e-06 + -0.100000 1.223689 1.378471 3.53e-05 5.22e-06 + 0.000000 1.224711 1.414219 3.42e-05 5.14e-06 + 0.100000 1.223691 1.449083 3.33e-05 3.29e-06 + 0.200000 1.220634 1.482795 3.50e-05 3.94e-06 + 0.300000 1.215563 1.515100 3.04e-05 2.14e-06 + 0.400000 1.208490 1.545777 3.36e-05 2.28e-06 + 0.500000 1.199464 1.574621 3.18e-05 2.03e-06 + 0.600000 1.188527 1.601451 3.02e-05 1.01e-06 + 0.700000 1.175733 1.626106 3.09e-05 1.39e-06 + 0.800000 1.161160 1.648441 2.58e-05 1.18e-07 + 0.900000 1.144876 1.668331 2.78e-05 4.44e-08 + 1.000000 1.126984 1.685666 2.53e-05 3.97e-07 + 1.100000 1.107586 1.700354 2.29e-05 1.20e-06 + 1.200000 1.086798 1.712318 2.23e-05 1.40e-06 + 1.300000 1.064760 1.721497 1.71e-05 2.15e-06 + 1.400000 1.041608 1.727843 1.70e-05 2.44e-06 + 1.500000 1.017517 1.731325 1.39e-05 2.90e-06 + 1.600000 0.992663 1.731924 1.02e-05 3.31e-06 + 1.700000 0.967239 1.729638 1.35e-05 4.84e-06 + 1.800000 0.941479 1.724478 8.60e-06 7.09e-06 + 1.900000 0.915621 1.716469 3.16e-06 9.53e-06 + 2.000000 0.889921 1.705654 1.84e-05 1.20e-05 + 2.100000 0.864659 1.692088 3.40e-05 1.40e-05 + 2.200000 0.840134 1.675842 4.55e-05 1.50e-05 + 2.300000 0.816667 1.657002 5.04e-05 1.46e-05 + 2.400000 0.794592 1.635671 4.58e-05 1.29e-05 + 2.500000 0.774269 1.611965 4.20e-05 1.31e-05 + 2.600000 0.756048 1.586022 3.55e-05 1.15e-05 + 2.700000 0.740280 1.557994 3.41e-05 1.07e-05 + 2.800000 0.727280 1.528057 3.23e-05 1.03e-05 + 2.900000 0.717332 1.496403 3.06e-05 9.62e-06 + 3.000000 0.710665 1.463248 2.89e-05 8.97e-06 + 3.100000 0.707440 1.428831 2.71e-05 8.29e-06 + 3.200000 0.707734 1.393415 2.51e-05 7.67e-06 + 3.300000 0.711545 1.357289 2.59e-05 7.84e-06 + 3.400000 0.718776 1.320772 2.60e-05 7.74e-06 + 3.500000 0.729252 1.284211 2.51e-05 7.39e-06 + 3.600000 0.742735 1.247983 2.31e-05 6.80e-06 + 3.700000 0.758934 1.212497 2.04e-05 6.03e-06 + 3.800000 0.777524 1.178189 1.72e-05 5.18e-06 + 3.900000 0.798158 1.145523 1.38e-05 4.36e-06 + 4.000000 0.820485 1.114984 1.07e-05 3.81e-06 + 4.100000 0.844158 1.087067 8.91e-06 4.05e-06 + 4.200000 0.868842 1.062267 9.49e-06 5.94e-06 + 4.300000 0.894213 1.041069 8.96e-06 4.31e-06 + 4.400000 0.919966 1.023913 2.07e-06 3.47e-07 + 4.500000 0.945831 1.011172 3.41e-06 8.05e-07 + 4.600000 0.971546 1.003152 1.12e-05 2.18e-06 + 4.700000 0.996883 1.000042 1.55e-05 3.97e-06 + 4.800000 1.021617 1.001922 2.33e-05 6.45e-06 + 4.900000 1.045562 1.008742 2.69e-05 6.55e-06 + 5.000000 1.068534 1.020341 3.13e-05 1.03e-05 + 5.100000 1.090371 1.036440 3.70e-05 1.06e-05 + 5.200000 1.110937 1.056675 3.46e-05 8.26e-06 + 5.300000 1.130084 1.080630 4.28e-05 1.37e-05 + 5.400000 1.147713 1.107817 4.42e-05 1.06e-05 + 5.500000 1.163715 1.137755 4.38e-05 1.22e-05 + 5.600000 1.177993 1.169941 4.89e-05 1.25e-05 + 5.700000 1.190483 1.203883 4.46e-05 8.51e-06 + 5.800000 1.201100 1.239124 4.97e-05 1.20e-05 + 5.900000 1.209801 1.275204 4.99e-05 8.96e-06 + 6.000000 1.216540 1.311719 4.73e-05 8.93e-06 + 6.100000 1.221273 1.348281 5.21e-05 8.85e-06 + 6.200000 1.223992 1.384531 4.65e-05 5.55e-06 + 6.300000 1.224665 1.420153 5.12e-05 7.47e-06 + 6.400000 1.223303 1.454842 5.01e-05 5.07e-06 + 6.500000 1.219909 1.488333 4.71e-05 4.73e-06 + 6.600000 1.214493 1.520380 5.05e-05 4.31e-06 + 6.700000 1.207098 1.550760 4.38e-05 1.96e-06 + 6.800000 1.197742 1.579279 4.76e-05 2.86e-06 + 6.900000 1.186489 1.605753 4.51e-05 1.14e-06 + 7.000000 1.173394 1.630027 4.15e-05 6.93e-07 ------------------------------------------------------ Final Solver Statistics: - Internal solver steps = 168 (attempted = 168) + Internal solver steps = 167 (attempted = 167) Total number of error test failures = 0 - Total RHS evals: Fe = 675, Fi = 1698 - Total mass matrix setups = 508 - Total mass matrix solves = 1515 - Total mass times evals = 1191 - Total number of Jacobian evaluations = 18 + Total RHS evals: Fe = 671, Fi = 1763 + Total mass matrix setups = 504 + Total mass matrix solves = 1340 + Total mass times evals = 1259 + Total number of Jacobian evaluations = 7 Total linear solver setups = 18 - Total number of Nonlinear iterations = 1023 + Total number of Nonlinear iterations = 1092 Total number of Nonlinear convergence failures = 5 - Errors: u = 0.00224481, v = 0.0027708, total = 0.00252156 + Errors: u = 3.02996e-05, v = 6.97389e-06, total = 2.19852e-05 diff --git a/examples/arkode/CXX_serial/ark_kpr_Mt_0_4_0_-10_0_10_1.out b/examples/arkode/CXX_serial/ark_kpr_Mt_0_4_0_-10_0_10_1.out index 0966765b36..25d972ace0 100644 --- a/examples/arkode/CXX_serial/ark_kpr_Mt_0_4_0_-10_0_10_1.out +++ b/examples/arkode/CXX_serial/ark_kpr_Mt_0_4_0_-10_0_10_1.out @@ -12,117 +12,117 @@ Nonlinear Kvaerno-Prothero-Robinson test problem with mass matrix: t u v uerr verr ------------------------------------------------------ -3.000000 0.710636 1.363407 0.00e+00 0.00e+00 - -2.900000 0.717019 1.329852 2.82e-04 2.92e-03 - -2.800000 0.727128 1.291781 1.19e-04 1.43e-03 - -2.700000 0.740964 1.252385 7.18e-04 1.66e-03 - -2.600000 0.756983 1.216059 9.70e-04 2.34e-03 - -2.500000 0.773350 1.185766 8.78e-04 1.90e-03 - -2.400000 0.793611 1.152873 9.34e-04 1.99e-03 - -2.300000 0.817253 1.119332 6.37e-04 6.21e-04 - -2.200000 0.841717 1.089568 1.63e-03 1.99e-03 - -2.100000 0.864011 1.066886 6.14e-04 6.82e-04 - -2.000000 0.892474 1.042263 2.57e-03 2.10e-03 - -1.900000 0.917602 1.025755 1.98e-03 7.44e-04 - -1.800000 0.937390 1.016647 4.10e-03 3.65e-03 - -1.700000 0.971792 1.003765 4.54e-03 3.94e-04 - -1.600000 0.989541 1.001911 3.13e-03 1.70e-03 - -1.500000 1.020109 1.001600 2.58e-03 3.48e-04 - -1.400000 1.041436 1.008886 1.89e-04 1.64e-03 - -1.300000 1.062303 1.017039 2.47e-03 1.02e-03 - -1.200000 1.089683 1.036317 2.86e-03 2.90e-03 - -1.100000 1.105577 1.052294 2.03e-03 6.98e-04 - -1.000000 1.126083 1.075316 9.26e-04 1.03e-03 - -0.900000 1.147001 1.106761 2.10e-03 3.73e-03 - -0.800000 1.159860 1.131459 1.33e-03 1.08e-03 - -0.700000 1.174024 1.161179 1.74e-03 3.20e-03 - -0.600000 1.190189 1.202272 1.63e-03 4.21e-03 - -0.500000 1.199459 1.234387 3.74e-05 1.27e-03 - -0.400000 1.206986 1.264980 1.54e-03 4.11e-03 - -0.300000 1.215711 1.306063 1.17e-04 5.06e-04 - -0.200000 1.221127 1.346177 4.58e-04 4.04e-03 - -0.100000 1.223082 1.376940 6.43e-04 1.53e-03 - 0.000000 1.224285 1.409999 4.59e-04 4.21e-03 - 0.100000 1.223699 1.452499 2.62e-05 3.42e-03 - 0.200000 1.220132 1.484766 5.37e-04 1.98e-03 - 0.300000 1.215566 1.511788 2.80e-05 3.31e-03 - 0.400000 1.208854 1.543863 3.30e-04 1.91e-03 - 0.500000 1.198305 1.577949 1.19e-03 3.33e-03 - 0.600000 1.188064 1.601091 4.93e-04 3.59e-04 - 0.700000 1.177002 1.622831 1.24e-03 3.27e-03 - 0.800000 1.160467 1.649540 7.19e-04 1.10e-03 - 0.900000 1.143024 1.669900 1.88e-03 1.57e-03 - 1.000000 1.127703 1.684083 6.93e-04 1.58e-03 - 1.100000 1.109563 1.698647 1.95e-03 1.71e-03 - 1.200000 1.084375 1.713548 2.45e-03 1.23e-03 - 1.300000 1.063451 1.721352 1.33e-03 1.47e-04 - 1.400000 1.043958 1.726670 2.33e-03 1.18e-03 - 1.500000 1.018212 1.731200 6.81e-04 1.28e-04 - 1.600000 0.989541 1.731687 3.13e-03 2.41e-04 - 1.700000 0.967594 1.729038 3.42e-04 6.05e-04 - 1.800000 0.945779 1.724938 4.29e-03 4.53e-04 - 1.900000 0.913122 1.714408 2.50e-03 2.07e-03 - 2.000000 0.892727 1.706653 2.82e-03 9.87e-04 - 2.100000 0.863079 1.690005 1.55e-03 2.10e-03 - 2.200000 0.842837 1.677421 2.75e-03 1.56e-03 - 2.300000 0.813660 1.654059 2.96e-03 2.96e-03 - 2.400000 0.796357 1.636543 1.81e-03 8.59e-04 - 2.500000 0.776495 1.614269 2.27e-03 2.29e-03 - 2.600000 0.754401 1.583710 1.61e-03 2.32e-03 - 2.700000 0.738886 1.554989 1.36e-03 3.02e-03 - 2.800000 0.727154 1.526628 9.33e-05 1.44e-03 - 2.900000 0.717938 1.496740 6.37e-04 3.28e-04 - 3.000000 0.711417 1.464762 7.80e-04 1.51e-03 - 3.100000 0.708036 1.430991 6.24e-04 2.15e-03 - 3.200000 0.708079 1.395889 3.70e-04 2.47e-03 - 3.300000 0.711619 1.359926 9.94e-05 2.63e-03 - 3.400000 0.718581 1.323519 1.69e-04 2.74e-03 - 3.500000 0.728792 1.287040 4.35e-04 2.82e-03 - 3.600000 0.742019 1.250864 6.93e-04 2.87e-03 - 3.700000 0.757977 1.215395 9.37e-04 2.89e-03 - 3.800000 0.776344 1.181065 1.16e-03 2.87e-03 - 3.900000 0.796778 1.148333 1.37e-03 2.81e-03 - 4.000000 0.818928 1.117683 1.55e-03 2.69e-03 - 4.100000 0.842446 1.089606 1.70e-03 2.53e-03 - 4.200000 0.866998 1.064597 1.83e-03 2.32e-03 - 4.300000 0.892261 1.043136 1.94e-03 2.06e-03 - 4.400000 0.916058 1.027104 3.91e-03 3.19e-03 - 4.500000 0.949013 1.011415 3.18e-03 2.42e-04 - 4.600000 0.967871 1.004821 3.69e-03 1.67e-03 - 4.700000 1.000576 1.000388 3.68e-03 3.49e-04 - 4.800000 1.019516 1.003159 2.12e-03 1.24e-03 - 4.900000 1.045822 1.008812 2.34e-04 7.65e-05 - 5.000000 1.070392 1.022564 1.83e-03 2.23e-03 - 5.100000 1.087297 1.034966 3.11e-03 1.46e-03 - 5.200000 1.112850 1.058594 1.88e-03 1.93e-03 - 5.300000 1.131091 1.082926 9.64e-04 2.31e-03 - 5.400000 1.145267 1.104991 2.49e-03 2.82e-03 - 5.500000 1.164313 1.138717 5.54e-04 9.74e-04 - 5.600000 1.179397 1.173602 1.35e-03 3.67e-03 - 5.700000 1.189228 1.201963 1.30e-03 1.91e-03 - 5.800000 1.199849 1.235675 1.30e-03 3.44e-03 - 5.900000 1.210965 1.279516 1.11e-03 4.32e-03 - 6.000000 1.216453 1.313042 1.34e-04 1.33e-03 - 6.100000 1.220283 1.344121 1.04e-03 4.15e-03 - 6.200000 1.224013 1.384363 2.59e-05 1.62e-04 - 6.300000 1.224687 1.424123 2.89e-05 3.98e-03 - 6.400000 1.222879 1.453549 4.74e-04 1.29e-03 - 6.500000 1.220024 1.484232 6.72e-05 4.10e-03 - 6.600000 1.214102 1.523276 4.41e-04 2.90e-03 - 6.700000 1.206270 1.552659 8.72e-04 1.90e-03 - 6.800000 1.198139 1.576403 3.50e-04 2.87e-03 - 6.900000 1.187244 1.603789 7.10e-04 1.96e-03 - 7.000000 1.171735 1.632792 1.70e-03 2.77e-03 + -2.900000 0.717301 1.326933 2.70e-07 3.73e-08 + -2.800000 0.727249 1.290351 1.13e-06 1.93e-06 + -2.700000 0.740247 1.254036 1.07e-06 5.17e-06 + -2.600000 0.756014 1.218395 7.58e-07 4.79e-06 + -2.500000 0.774228 1.183857 4.73e-07 4.46e-06 + -2.400000 0.794546 1.150881 3.10e-07 4.15e-06 + -2.300000 0.816616 1.119949 1.90e-07 3.86e-06 + -2.200000 0.840089 1.091557 7.29e-08 3.57e-06 + -2.100000 0.864625 1.066201 5.01e-08 3.31e-06 + -2.000000 0.889902 1.044364 2.51e-07 2.98e-06 + -1.900000 0.915617 1.026496 7.41e-07 2.44e-06 + -1.800000 0.941484 1.012992 3.21e-06 4.66e-07 + -1.700000 0.967244 1.004159 8.82e-06 3.48e-08 + -1.600000 0.992667 1.000213 5.91e-06 1.67e-07 + -1.500000 1.017525 1.001250 6.01e-06 1.73e-06 + -1.400000 1.041618 1.007250 7.55e-06 6.60e-07 + -1.300000 1.064770 1.018056 7.07e-06 1.39e-06 + -1.200000 1.086812 1.033423 8.15e-06 1.14e-06 + -1.100000 1.107603 1.052993 6.37e-06 1.16e-06 + -1.000000 1.127003 1.076350 6.54e-06 5.97e-07 + -0.900000 1.144897 1.103030 7.12e-06 1.12e-06 + -0.800000 1.161181 1.132540 5.65e-06 1.73e-06 + -0.700000 1.175759 1.164384 5.09e-06 3.04e-06 + -0.600000 1.188551 1.198067 6.35e-06 3.20e-06 + -0.500000 1.199490 1.233118 5.85e-06 1.93e-06 + -0.400000 1.208519 1.269088 5.00e-06 5.89e-07 + -0.300000 1.215588 1.305555 6.04e-06 2.25e-06 + -0.200000 1.220662 1.342131 6.84e-06 5.78e-06 + -0.100000 1.223719 1.378457 6.01e-06 7.95e-06 + 0.000000 1.224739 1.414204 5.62e-06 9.85e-06 + 0.100000 1.223718 1.449068 7.07e-06 1.25e-05 + 0.200000 1.220662 1.482778 6.74e-06 1.28e-05 + 0.300000 1.215588 1.515084 5.72e-06 1.31e-05 + 0.400000 1.208518 1.545760 5.96e-06 1.46e-05 + 0.500000 1.199489 1.574603 6.91e-06 1.62e-05 + 0.600000 1.188551 1.601433 6.09e-06 1.67e-05 + 0.700000 1.175759 1.626088 5.28e-06 1.69e-05 + 0.800000 1.161180 1.648423 5.98e-06 1.75e-05 + 0.900000 1.144898 1.668313 5.87e-06 1.77e-05 + 1.000000 1.127005 1.685649 4.85e-06 1.72e-05 + 1.100000 1.107605 1.700338 4.37e-06 1.67e-05 + 1.200000 1.086816 1.712303 4.71e-06 1.64e-05 + 1.300000 1.064773 1.721483 3.98e-06 1.56e-05 + 1.400000 1.041622 1.727831 3.10e-06 1.45e-05 + 1.500000 1.017528 1.731314 2.71e-06 1.35e-05 + 1.600000 0.992671 1.731915 2.16e-06 1.23e-05 + 1.700000 0.967251 1.729632 1.35e-06 1.10e-05 + 1.800000 0.941487 1.724475 4.26e-07 9.77e-06 + 1.900000 0.915622 1.716469 5.05e-06 1.00e-05 + 2.000000 0.889909 1.705658 6.21e-06 8.62e-06 + 2.100000 0.864636 1.692092 1.05e-05 1.02e-05 + 2.200000 0.840099 1.675847 1.03e-05 9.88e-06 + 2.300000 0.816629 1.657008 1.24e-05 9.44e-06 + 2.400000 0.794555 1.635676 9.06e-06 8.49e-06 + 2.500000 0.774235 1.611970 7.64e-06 7.70e-06 + 2.600000 0.756021 1.586026 7.63e-06 7.67e-06 + 2.700000 0.740253 1.557998 6.87e-06 7.15e-06 + 2.800000 0.727253 1.528060 5.82e-06 7.10e-06 + 2.900000 0.717306 1.496405 4.89e-06 7.26e-06 + 3.000000 0.710640 1.463249 4.17e-06 7.32e-06 + 3.100000 0.707416 1.428831 3.60e-06 7.55e-06 + 3.200000 0.707712 1.393413 3.07e-06 8.92e-06 + 3.300000 0.711522 1.357287 2.62e-06 9.53e-06 + 3.400000 0.718752 1.320772 2.24e-06 7.95e-06 + 3.500000 0.729229 1.284212 1.93e-06 6.49e-06 + 3.600000 0.742713 1.247985 1.62e-06 5.13e-06 + 3.700000 0.758915 1.212499 1.32e-06 3.88e-06 + 3.800000 0.777507 1.178192 1.01e-06 2.73e-06 + 3.900000 0.798145 1.145526 7.18e-07 1.69e-06 + 4.000000 0.820475 1.114987 4.41e-07 7.68e-07 + 4.100000 0.844149 1.087071 1.85e-07 3.81e-08 + 4.200000 0.868832 1.062274 5.04e-08 7.17e-07 + 4.300000 0.894204 1.041075 2.64e-07 1.26e-06 + 4.400000 0.919963 1.023915 9.20e-07 2.28e-06 + 4.500000 0.945828 1.011177 6.19e-06 4.81e-06 + 4.600000 0.971553 1.003152 4.72e-06 1.97e-06 + 4.700000 0.996891 1.000041 7.14e-06 2.29e-06 + 4.800000 1.021634 1.001919 6.39e-06 3.05e-06 + 4.900000 1.045581 1.008736 7.54e-06 9.35e-07 + 5.000000 1.068557 1.020334 7.55e-06 2.47e-06 + 5.100000 1.090402 1.036431 5.68e-06 1.83e-06 + 5.200000 1.110965 1.056670 7.01e-06 2.46e-06 + 5.300000 1.130120 1.080619 6.62e-06 2.63e-06 + 5.400000 1.147752 1.107809 5.22e-06 2.51e-06 + 5.500000 1.163753 1.137747 5.96e-06 3.76e-06 + 5.600000 1.178036 1.169935 6.19e-06 6.46e-06 + 5.700000 1.190523 1.203881 5.11e-06 5.99e-06 + 5.800000 1.201144 1.239116 4.94e-06 4.32e-06 + 5.900000 1.209845 1.275199 6.25e-06 3.31e-06 + 6.000000 1.216582 1.311713 5.78e-06 2.19e-06 + 6.100000 1.221320 1.348274 4.88e-06 1.47e-06 + 6.200000 1.224033 1.384526 5.58e-06 8.06e-07 + 6.300000 1.224710 1.420146 6.33e-06 9.33e-08 + 6.400000 1.223348 1.454836 5.45e-06 7.00e-07 + 6.500000 1.219952 1.488327 4.87e-06 1.03e-06 + 6.600000 1.214538 1.520374 6.04e-06 1.49e-06 + 6.700000 1.207136 1.550752 6.18e-06 5.85e-06 + 6.800000 1.197784 1.579267 5.34e-06 8.88e-06 + 6.900000 1.186528 1.605740 5.46e-06 1.20e-05 + 7.000000 1.173429 1.630011 6.48e-06 1.55e-05 ------------------------------------------------------ Final Solver Statistics: Internal solver steps = 80 (attempted = 82) Total number of error test failures = 2 - Total RHS evals: Fe = 495, Fi = 1086 - Total mass matrix setups = 416 - Total mass matrix solves = 657 - Total mass times evals = 1081 - Total number of Jacobian evaluations = 21 + Total RHS evals: Fe = 493, Fi = 1082 + Total mass matrix setups = 413 + Total mass matrix solves = 574 + Total mass times evals = 1079 + Total number of Jacobian evaluations = 12 Total linear solver setups = 21 - Total number of Nonlinear iterations = 1001 - Total number of Nonlinear convergence failures = 13 - Errors: u = 0.00178101, v = 0.00231678, total = 0.00206634 + Total number of Nonlinear iterations = 999 + Total number of Nonlinear convergence failures = 11 + Errors: u = 5.44891e-06, v = 7.96021e-06, total = 6.82113e-06 diff --git a/examples/arkode/CXX_serial/ark_kpr_Mt_0_4_0_-10_1_10_1.out b/examples/arkode/CXX_serial/ark_kpr_Mt_0_4_0_-10_1_10_1.out index 2d97a74e97..e28c955d6b 100644 --- a/examples/arkode/CXX_serial/ark_kpr_Mt_0_4_0_-10_1_10_1.out +++ b/examples/arkode/CXX_serial/ark_kpr_Mt_0_4_0_-10_1_10_1.out @@ -12,117 +12,117 @@ Nonlinear Kvaerno-Prothero-Robinson test problem with mass matrix: t u v uerr verr ------------------------------------------------------ -3.000000 0.710636 1.363407 0.00e+00 0.00e+00 - -2.900000 0.717211 1.328223 8.99e-05 1.29e-03 - -2.800000 0.728269 1.287692 1.02e-03 2.66e-03 - -2.700000 0.739164 1.256719 1.08e-03 2.68e-03 - -2.600000 0.757034 1.216907 1.02e-03 1.49e-03 - -2.500000 0.773721 1.184656 5.07e-04 7.94e-04 - -2.400000 0.794153 1.151722 3.93e-04 8.37e-04 - -2.300000 0.818329 1.118100 1.71e-03 1.85e-03 - -2.200000 0.837303 1.094451 2.79e-03 2.89e-03 - -2.100000 0.862921 1.067619 1.70e-03 1.41e-03 - -2.000000 0.890741 1.043833 8.39e-04 5.34e-04 - -1.900000 0.917113 1.027334 1.50e-03 8.36e-04 - -1.800000 0.937132 1.014893 4.36e-03 1.90e-03 - -1.700000 0.971264 1.004558 4.01e-03 3.99e-04 - -1.600000 0.989148 1.001512 3.53e-03 1.30e-03 - -1.500000 1.019857 1.001974 2.33e-03 7.23e-04 - -1.400000 1.041333 1.009018 2.92e-04 1.77e-03 - -1.300000 1.062133 1.016423 2.64e-03 1.64e-03 - -1.200000 1.089269 1.036935 2.45e-03 3.51e-03 - -1.100000 1.105611 1.051822 2.00e-03 1.17e-03 - -1.000000 1.126373 1.075348 6.37e-04 1.00e-03 - -0.900000 1.146348 1.106984 1.44e-03 3.96e-03 - -0.800000 1.159966 1.130930 1.22e-03 1.61e-03 - -0.700000 1.174625 1.161225 1.14e-03 3.16e-03 - -0.600000 1.189605 1.202473 1.05e-03 4.41e-03 - -0.500000 1.199275 1.233916 2.21e-04 8.00e-04 - -0.400000 1.207551 1.264783 9.73e-04 4.30e-03 - -0.300000 1.215744 1.306771 1.50e-04 1.21e-03 - -0.200000 1.220747 1.345850 7.74e-05 3.71e-03 - -0.100000 1.223304 1.376541 4.20e-04 1.92e-03 - 0.000000 1.224655 1.410336 9.03e-05 3.88e-03 - 0.100000 1.223464 1.452678 2.60e-04 3.60e-03 - 0.200000 1.220141 1.484317 5.28e-04 1.53e-03 - 0.300000 1.215820 1.511673 2.26e-04 3.42e-03 - 0.400000 1.208782 1.544565 2.58e-04 1.21e-03 - 0.500000 1.198262 1.577820 1.23e-03 3.20e-03 - 0.600000 1.188266 1.600763 2.91e-04 6.87e-04 - 0.700000 1.177064 1.622917 1.30e-03 3.19e-03 - 0.800000 1.160152 1.650027 1.03e-03 1.59e-03 - 0.900000 1.143163 1.669738 1.74e-03 1.41e-03 - 1.000000 1.127953 1.683870 9.43e-04 1.80e-03 - 1.100000 1.109344 1.698839 1.74e-03 1.52e-03 - 1.200000 1.084126 1.713713 2.69e-03 1.39e-03 - 1.300000 1.063729 1.721220 1.05e-03 2.79e-04 - 1.400000 1.044265 1.726551 2.64e-03 1.29e-03 - 1.500000 1.017322 1.731363 2.09e-04 3.55e-05 - 1.600000 0.989409 1.731682 3.26e-03 2.45e-04 - 1.700000 0.968115 1.729005 8.62e-04 6.38e-04 - 1.800000 0.945780 1.724905 4.29e-03 4.21e-04 - 1.900000 0.913350 1.714227 2.27e-03 2.25e-03 - 2.000000 0.891914 1.706373 2.01e-03 7.06e-04 - 2.100000 0.863536 1.689964 1.09e-03 2.14e-03 - 2.200000 0.842451 1.677230 2.36e-03 1.37e-03 - 2.300000 0.813595 1.653718 3.02e-03 3.30e-03 - 2.400000 0.797036 1.637090 2.49e-03 1.41e-03 - 2.500000 0.776409 1.614316 2.18e-03 2.34e-03 - 2.600000 0.753957 1.582797 2.06e-03 3.24e-03 - 2.700000 0.739018 1.554652 1.23e-03 3.35e-03 - 2.800000 0.727507 1.526918 2.60e-04 1.15e-03 - 2.900000 0.718202 1.497373 9.00e-04 9.61e-04 - 3.000000 0.711511 1.465459 8.75e-04 2.20e-03 - 3.100000 0.707986 1.431691 5.73e-04 2.85e-03 - 3.200000 0.707904 1.396535 1.95e-04 3.11e-03 - 3.300000 0.711361 1.360512 1.59e-04 3.21e-03 - 3.400000 0.718242 1.324028 5.08e-04 3.25e-03 - 3.500000 0.728403 1.287440 8.23e-04 3.22e-03 - 3.600000 0.741598 1.251148 1.11e-03 3.16e-03 - 3.700000 0.757545 1.215559 1.37e-03 3.06e-03 - 3.800000 0.775921 1.181111 1.59e-03 2.92e-03 - 3.900000 0.796382 1.148270 1.76e-03 2.74e-03 - 4.000000 0.818578 1.117520 1.90e-03 2.53e-03 - 4.100000 0.842160 1.089361 1.99e-03 2.29e-03 - 4.200000 0.866788 1.064291 2.04e-03 2.02e-03 - 4.300000 0.892141 1.042793 2.06e-03 1.72e-03 - 4.400000 0.915470 1.026651 4.49e-03 2.74e-03 - 4.500000 0.949956 1.010481 4.12e-03 6.92e-04 - 4.600000 0.969819 1.004919 1.74e-03 1.77e-03 - 4.700000 0.995171 0.999962 1.73e-03 7.62e-05 - 4.800000 1.024036 1.003989 2.40e-03 2.07e-03 - 4.900000 1.042057 1.008020 3.53e-03 7.16e-04 - 5.000000 1.070886 1.022350 2.32e-03 2.02e-03 - 5.100000 1.090463 1.038105 5.51e-05 1.68e-03 - 5.200000 1.108350 1.053723 2.62e-03 2.94e-03 - 5.300000 1.131978 1.084116 1.85e-03 3.50e-03 - 5.400000 1.147773 1.109311 1.62e-05 1.50e-03 - 5.500000 1.161934 1.133924 1.83e-03 3.82e-03 - 5.600000 1.178681 1.171971 6.39e-04 2.04e-03 - 5.700000 1.191085 1.207296 5.57e-04 3.42e-03 - 5.800000 1.200245 1.236544 9.04e-04 2.57e-03 - 5.900000 1.209250 1.271951 6.01e-04 3.24e-03 - 6.000000 1.217002 1.316051 4.15e-04 4.34e-03 - 6.100000 1.221052 1.349146 2.73e-04 8.74e-04 - 6.200000 1.223662 1.380339 3.76e-04 4.19e-03 - 6.300000 1.224706 1.420575 1.02e-05 4.30e-04 - 6.400000 1.222895 1.458395 4.58e-04 3.56e-03 - 6.500000 1.219734 1.486790 2.23e-04 1.54e-03 - 6.600000 1.215038 1.516684 4.95e-04 3.69e-03 - 6.700000 1.206372 1.553655 7.70e-04 2.90e-03 - 6.800000 1.196854 1.580760 9.35e-04 1.48e-03 - 6.900000 1.187218 1.602951 6.84e-04 2.80e-03 - 7.000000 1.174139 1.628591 7.03e-04 1.44e-03 + -2.900000 0.717302 1.326933 5.18e-07 6.29e-08 + -2.800000 0.727249 1.290354 1.76e-06 3.00e-07 + -2.700000 0.740248 1.254042 1.77e-06 6.52e-07 + -2.600000 0.756015 1.218401 2.05e-06 1.18e-06 + -2.500000 0.774229 1.183863 1.80e-06 1.67e-06 + -2.400000 0.794548 1.150887 1.78e-06 2.26e-06 + -2.300000 0.816618 1.119956 1.73e-06 2.88e-06 + -2.200000 0.840091 1.091561 2.35e-06 9.16e-07 + -2.100000 0.864627 1.066206 1.41e-06 1.78e-06 + -2.000000 0.889903 1.044369 7.08e-07 1.83e-06 + -1.900000 0.915617 1.026506 8.72e-08 7.10e-06 + -1.800000 0.941487 1.013000 3.27e-07 8.36e-06 + -1.700000 0.967250 1.004167 2.68e-06 8.25e-06 + -1.600000 0.992670 1.000223 3.57e-06 9.84e-06 + -1.500000 1.017527 1.001259 3.97e-06 7.51e-06 + -1.400000 1.041619 1.007259 6.46e-06 9.78e-06 + -1.300000 1.064772 1.018066 5.08e-06 8.29e-06 + -1.200000 1.086813 1.033430 7.23e-06 8.10e-06 + -1.100000 1.107603 1.053000 6.59e-06 8.19e-06 + -1.000000 1.127004 1.076357 5.43e-06 7.25e-06 + -0.900000 1.144897 1.103036 7.08e-06 7.19e-06 + -0.800000 1.161180 1.132545 6.46e-06 6.66e-06 + -0.700000 1.175759 1.164387 5.27e-06 6.15e-06 + -0.600000 1.188551 1.198070 6.33e-06 6.04e-06 + -0.500000 1.199489 1.233121 6.80e-06 5.48e-06 + -0.400000 1.208518 1.269092 5.71e-06 4.92e-06 + -0.300000 1.215588 1.305562 5.38e-06 4.74e-06 + -0.200000 1.220662 1.342141 6.93e-06 4.44e-06 + -0.100000 1.223718 1.378469 6.52e-06 3.81e-06 + 0.000000 1.224739 1.414217 5.45e-06 3.44e-06 + 0.100000 1.223719 1.449083 6.01e-06 3.25e-06 + 0.200000 1.220662 1.482794 6.90e-06 2.72e-06 + 0.300000 1.215588 1.515100 5.89e-06 2.20e-06 + 0.400000 1.208519 1.545776 5.12e-06 1.91e-06 + 0.500000 1.199490 1.574621 6.23e-06 1.56e-06 + 0.600000 1.188551 1.601451 5.98e-06 9.90e-07 + 0.700000 1.175759 1.626106 4.83e-06 5.92e-07 + 0.800000 1.161182 1.648441 4.59e-06 3.18e-07 + 0.900000 1.144899 1.668330 5.22e-06 1.80e-07 + 1.000000 1.127005 1.685666 4.37e-06 6.52e-07 + 1.100000 1.107606 1.700354 3.45e-06 9.25e-07 + 1.200000 1.086817 1.712319 3.52e-06 1.26e-06 + 1.300000 1.064774 1.721497 3.17e-06 1.75e-06 + 1.400000 1.041623 1.727843 2.27e-06 2.05e-06 + 1.500000 1.017529 1.731325 1.62e-06 2.23e-06 + 1.600000 0.992672 1.731925 1.09e-06 2.62e-06 + 1.700000 0.967252 1.729640 2.98e-07 2.96e-06 + 1.800000 0.941488 1.724482 3.06e-07 3.07e-06 + 1.900000 0.915619 1.716476 1.21e-06 3.20e-06 + 2.000000 0.889905 1.705663 2.67e-06 3.54e-06 + 2.100000 0.864629 1.692098 3.20e-06 3.66e-06 + 2.200000 0.840092 1.675853 3.55e-06 3.60e-06 + 2.300000 0.816622 1.657013 5.76e-06 3.73e-06 + 2.400000 0.794553 1.635680 7.17e-06 3.89e-06 + 2.500000 0.774234 1.611974 6.62e-06 3.74e-06 + 2.600000 0.756019 1.586030 6.45e-06 3.52e-06 + 2.700000 0.740253 1.558002 7.30e-06 3.40e-06 + 2.800000 0.727255 1.528064 7.08e-06 3.25e-06 + 2.900000 0.717306 1.496410 4.96e-06 2.49e-06 + 3.000000 0.710640 1.463255 3.65e-06 1.95e-06 + 3.100000 0.707417 1.428837 4.78e-06 1.61e-06 + 3.200000 0.707713 1.393421 3.79e-06 1.41e-06 + 3.300000 0.711524 1.357296 4.13e-06 1.09e-06 + 3.400000 0.718753 1.320779 3.08e-06 9.90e-07 + 3.500000 0.729230 1.284218 3.50e-06 7.02e-07 + 3.600000 0.742714 1.247989 2.37e-06 7.15e-07 + 3.700000 0.758915 1.212502 9.93e-07 1.30e-06 + 3.800000 0.777507 1.178192 2.56e-07 1.98e-06 + 3.900000 0.798144 1.145525 2.27e-07 2.69e-06 + 4.000000 0.820474 1.114984 5.91e-07 3.44e-06 + 4.100000 0.844148 1.087067 8.85e-07 4.17e-06 + 4.200000 0.868831 1.062268 1.12e-06 4.90e-06 + 4.300000 0.894202 1.041068 1.31e-06 5.58e-06 + 4.400000 0.919963 1.023910 1.35e-06 3.31e-06 + 4.500000 0.945833 1.011171 9.17e-07 1.79e-06 + 4.600000 0.971554 1.003150 2.99e-06 5.83e-07 + 4.700000 0.996895 1.000039 2.92e-06 8.52e-07 + 4.800000 1.021636 1.001916 4.52e-06 5.99e-07 + 4.900000 1.045583 1.008738 5.49e-06 2.78e-06 + 5.000000 1.068560 1.020333 4.65e-06 1.94e-06 + 5.100000 1.090401 1.036432 6.80e-06 2.61e-06 + 5.200000 1.110966 1.056670 6.28e-06 3.13e-06 + 5.300000 1.130122 1.080620 5.31e-06 2.82e-06 + 5.400000 1.147750 1.107810 6.97e-06 3.23e-06 + 5.500000 1.163752 1.137746 6.56e-06 3.16e-06 + 5.600000 1.178037 1.169932 5.39e-06 3.04e-06 + 5.700000 1.190522 1.203878 6.25e-06 3.28e-06 + 5.800000 1.201142 1.239115 6.96e-06 3.08e-06 + 5.900000 1.209845 1.275198 5.92e-06 2.78e-06 + 6.000000 1.216582 1.311713 5.43e-06 2.82e-06 + 6.100000 1.221318 1.348275 6.97e-06 2.77e-06 + 6.200000 1.224032 1.384528 6.70e-06 2.33e-06 + 6.300000 1.224710 1.420148 5.59e-06 2.09e-06 + 6.400000 1.223347 1.454839 5.89e-06 2.04e-06 + 6.500000 1.219950 1.488330 6.96e-06 1.68e-06 + 6.600000 1.214538 1.520377 6.02e-06 1.24e-06 + 6.700000 1.207137 1.550759 5.14e-06 1.04e-06 + 6.800000 1.197783 1.579277 6.12e-06 7.99e-07 + 6.900000 1.186528 1.605752 6.04e-06 3.04e-07 + 7.000000 1.173431 1.630027 4.89e-06 4.45e-08 ------------------------------------------------------ Final Solver Statistics: - Internal solver steps = 82 (attempted = 84) - Total number of error test failures = 2 - Total RHS evals: Fe = 507, Fi = 1758 - Total mass matrix setups = 426 - Total mass matrix solves = 673 - Total mass times evals = 1753 - Total number of Jacobian evaluations = 153 - Total linear solver setups = 153 - Total number of Nonlinear iterations = 1671 - Total number of Nonlinear convergence failures = 146 - Errors: u = 0.00176018, v = 0.00238235, total = 0.0020945 + Internal solver steps = 83 (attempted = 83) + Total number of error test failures = 0 + Total RHS evals: Fe = 501, Fi = 1738 + Total mass matrix setups = 418 + Total mass matrix solves = 585 + Total mass times evals = 1735 + Total number of Jacobian evaluations = 145 + Total linear solver setups = 150 + Total number of Nonlinear iterations = 1652 + Total number of Nonlinear convergence failures = 144 + Errors: u = 4.76925e-06, v = 3.83012e-06, total = 4.32525e-06 diff --git a/examples/arkode/CXX_serial/ark_kpr_Mt_0_4_1.out b/examples/arkode/CXX_serial/ark_kpr_Mt_0_4_1.out index e2be8b2242..b27df8ddb3 100644 --- a/examples/arkode/CXX_serial/ark_kpr_Mt_0_4_1.out +++ b/examples/arkode/CXX_serial/ark_kpr_Mt_0_4_1.out @@ -12,117 +12,117 @@ Nonlinear Kvaerno-Prothero-Robinson test problem with mass matrix: t u v uerr verr ------------------------------------------------------ -3.000000 0.710636 1.363407 0.00e+00 0.00e+00 - -2.900000 0.717289 1.326981 1.22e-05 4.87e-05 - -2.800000 0.727288 1.290237 4.09e-05 1.17e-04 - -2.700000 0.740297 1.253927 5.15e-05 1.15e-04 - -2.600000 0.756075 1.218287 6.16e-05 1.13e-04 - -2.500000 0.774294 1.183760 6.63e-05 1.02e-04 - -2.400000 0.794465 1.150991 8.04e-05 1.06e-04 - -2.300000 0.816591 1.119982 2.54e-05 2.88e-05 - -2.200000 0.839974 1.091671 1.15e-04 1.11e-04 - -2.100000 0.864501 1.066305 1.25e-04 1.01e-04 - -2.000000 0.889952 1.044335 4.99e-05 3.23e-05 - -1.900000 0.915478 1.026570 1.40e-04 7.14e-05 - -1.800000 0.941493 1.012996 5.06e-06 4.44e-06 - -1.700000 0.967415 1.004136 1.62e-04 2.32e-05 - -1.600000 0.992703 1.000214 2.93e-05 1.23e-06 - -1.500000 1.017014 1.001151 5.16e-04 1.01e-04 - -1.400000 1.041533 1.007206 9.20e-05 4.25e-05 - -1.300000 1.064795 1.018071 1.80e-05 1.30e-05 - -1.200000 1.086754 1.033357 6.67e-05 6.51e-05 - -1.100000 1.107534 1.052895 7.53e-05 9.68e-05 - -1.000000 1.127009 1.076351 3.43e-07 8.07e-07 - -0.900000 1.144852 1.102926 5.16e-05 1.03e-04 - -0.800000 1.161168 1.132493 1.86e-05 4.54e-05 - -0.700000 1.175722 1.164256 4.22e-05 1.25e-04 - -0.600000 1.188552 1.198047 5.27e-06 1.75e-05 - -0.500000 1.199515 1.233200 1.89e-05 8.43e-05 - -0.400000 1.208522 1.269075 2.42e-06 1.17e-05 - -0.300000 1.215578 1.305441 1.55e-05 1.17e-04 - -0.200000 1.220681 1.342266 1.14e-05 1.29e-04 - -0.100000 1.223722 1.378393 3.13e-06 7.23e-05 - 0.000000 1.224745 1.414086 1.48e-07 1.28e-04 - 0.100000 1.223729 1.448982 4.45e-06 9.83e-05 - 0.200000 1.220673 1.482752 3.61e-06 3.94e-05 - 0.300000 1.215597 1.515075 3.25e-06 2.20e-05 - 0.400000 1.208502 1.545874 2.24e-05 9.94e-05 - 0.500000 1.199516 1.574554 1.92e-05 6.55e-05 - 0.600000 1.188518 1.601549 3.87e-05 9.88e-05 - 0.700000 1.175761 1.626111 2.75e-06 5.57e-06 - 0.800000 1.161205 1.648410 1.86e-05 3.00e-05 - 0.900000 1.144846 1.668405 5.80e-05 7.45e-05 - 1.000000 1.127053 1.685621 4.32e-05 4.52e-05 - 1.100000 1.107589 1.700371 2.04e-05 1.55e-05 - 1.200000 1.086897 1.712271 7.69e-05 4.83e-05 - 1.300000 1.064768 1.721502 8.56e-06 3.00e-06 - 1.400000 1.041562 1.727865 6.34e-05 1.99e-05 - 1.500000 1.016979 1.731422 5.52e-04 9.44e-05 - 1.600000 0.992455 1.731939 2.18e-04 1.18e-05 - 1.700000 0.967255 1.729643 2.52e-06 1.22e-07 - 1.800000 0.941270 1.724450 2.17e-04 3.51e-05 - 1.900000 0.915449 1.716434 1.69e-04 4.49e-05 - 2.000000 0.889997 1.705701 9.49e-05 3.43e-05 - 2.100000 0.864509 1.692044 1.17e-04 5.82e-05 - 2.200000 0.840053 1.675834 3.55e-05 2.29e-05 - 2.300000 0.816625 1.657023 8.96e-06 5.95e-06 - 2.400000 0.794637 1.635769 9.09e-05 8.47e-05 - 2.500000 0.774242 1.611994 1.46e-05 1.59e-05 - 2.600000 0.756072 1.586117 5.87e-05 8.37e-05 - 2.700000 0.740248 1.558009 2.12e-06 3.87e-06 - 2.800000 0.727215 1.527988 3.21e-05 7.88e-05 - 2.900000 0.717284 1.496348 1.74e-05 6.40e-05 - 3.000000 0.710627 1.463197 9.55e-06 5.99e-05 - 3.100000 0.707416 1.428919 3.99e-06 7.98e-05 - 3.200000 0.707704 1.393517 5.54e-06 9.49e-05 - 3.300000 0.711505 1.357381 1.41e-05 8.48e-05 - 3.400000 0.718731 1.320849 1.80e-05 6.91e-05 - 3.500000 0.729200 1.284292 2.71e-05 7.41e-05 - 3.600000 0.742748 1.247913 3.58e-05 7.72e-05 - 3.700000 0.758982 1.212381 6.88e-05 1.22e-04 - 3.800000 0.777446 1.178286 6.03e-05 9.15e-05 - 3.900000 0.798166 1.145500 2.24e-05 2.78e-05 - 4.000000 0.820371 1.115102 1.04e-04 1.14e-04 - 4.100000 0.844171 1.087051 2.16e-05 2.02e-05 - 4.200000 0.868963 1.062173 1.30e-04 1.00e-04 - 4.300000 0.894283 1.041024 7.92e-05 4.92e-05 - 4.400000 0.920076 1.023865 1.12e-04 4.82e-05 - 4.500000 0.945936 1.011146 1.02e-04 2.64e-05 - 4.600000 0.970923 1.003241 6.35e-04 9.12e-05 - 4.700000 0.996888 1.000082 9.99e-06 4.35e-05 - 4.800000 1.022163 1.002075 5.22e-04 1.59e-04 - 4.900000 1.045496 1.008688 9.33e-05 4.76e-05 - 5.000000 1.068614 1.020369 4.90e-05 3.76e-05 - 5.100000 1.090360 1.036381 4.73e-05 4.80e-05 - 5.200000 1.110916 1.056593 5.59e-05 7.42e-05 - 5.300000 1.130183 1.080712 5.58e-05 9.51e-05 - 5.400000 1.147723 1.107737 3.42e-05 6.99e-05 - 5.500000 1.163719 1.137644 3.97e-05 9.93e-05 - 5.600000 1.178039 1.169920 3.34e-06 8.82e-06 - 5.700000 1.190563 1.204006 3.50e-05 1.31e-04 - 5.800000 1.201123 1.238990 2.66e-05 1.22e-04 - 5.900000 1.209871 1.275316 2.03e-05 1.20e-04 - 6.000000 1.216589 1.311725 1.53e-06 1.48e-05 - 6.100000 1.221314 1.348140 1.10e-05 1.33e-04 - 6.200000 1.224040 1.384556 1.20e-06 3.07e-05 - 6.300000 1.224715 1.420276 1.45e-06 1.30e-04 - 6.400000 1.223358 1.454743 4.94e-06 9.31e-05 - 6.500000 1.219962 1.488272 5.90e-06 5.59e-05 - 6.600000 1.214545 1.520364 1.61e-06 1.17e-05 - 6.700000 1.207127 1.550821 1.50e-05 6.31e-05 - 6.800000 1.197802 1.579235 1.25e-05 4.12e-05 - 6.900000 1.186493 1.605851 4.03e-05 9.91e-05 - 7.000000 1.173431 1.630035 4.42e-06 8.62e-06 + -2.900000 0.717301 1.326933 4.49e-10 2.27e-12 + -2.800000 0.727247 1.290353 4.71e-10 2.40e-12 + -2.700000 0.740246 1.254042 4.75e-10 2.42e-12 + -2.600000 0.756013 1.218400 4.81e-10 2.45e-12 + -2.500000 0.774227 1.183861 4.86e-10 2.53e-12 + -2.400000 0.794546 1.150885 4.63e-10 2.35e-12 + -2.300000 0.816616 1.119953 4.77e-10 2.40e-12 + -2.200000 0.840089 1.091560 4.63e-10 2.28e-12 + -2.100000 0.864625 1.066204 4.49e-10 1.91e-12 + -2.000000 0.889903 1.044367 4.35e-10 2.22e-12 + -1.900000 0.915617 1.026499 1.65e-10 5.44e-12 + -1.800000 0.941488 1.012992 2.06e-09 3.81e-11 + -1.700000 0.967253 1.004159 8.28e-10 5.15e-12 + -1.600000 0.992673 1.000213 2.51e-08 1.04e-10 + -1.500000 1.017531 1.001252 7.18e-08 1.15e-09 + -1.400000 1.041625 1.007249 7.22e-10 3.60e-11 + -1.300000 1.064777 1.018058 7.17e-10 3.30e-11 + -1.200000 1.086821 1.033422 6.98e-10 2.85e-11 + -1.100000 1.107609 1.052992 7.02e-10 2.53e-11 + -1.000000 1.127010 1.076350 7.44e-10 2.17e-11 + -0.900000 1.144904 1.103029 7.25e-10 1.91e-11 + -0.800000 1.161186 1.132539 7.50e-10 1.63e-11 + -0.700000 1.175764 1.164381 7.38e-10 1.40e-11 + -0.600000 1.188557 1.198064 7.71e-10 1.19e-11 + -0.500000 1.199496 1.233116 8.00e-10 9.72e-12 + -0.400000 1.208524 1.269087 7.82e-10 8.43e-12 + -0.300000 1.215594 1.305557 7.61e-10 6.91e-12 + -0.200000 1.220669 1.342137 8.22e-10 5.38e-12 + -0.100000 1.223725 1.378465 1.64e-07 8.46e-10 + 0.000000 1.224745 1.414214 7.74e-08 3.69e-10 + 0.100000 1.223724 1.449080 1.98e-07 9.71e-10 + 0.200000 1.220669 1.482791 2.35e-07 1.13e-09 + 0.300000 1.215594 1.515097 2.41e-07 1.12e-09 + 0.400000 1.208524 1.545774 8.88e-10 9.81e-11 + 0.500000 1.199496 1.574619 7.62e-10 8.75e-11 + 0.600000 1.188557 1.601450 8.07e-10 7.72e-11 + 0.700000 1.175764 1.626105 7.70e-10 6.85e-11 + 0.800000 1.161186 1.648441 7.48e-10 6.09e-11 + 0.900000 1.144904 1.668331 7.79e-10 5.39e-11 + 1.000000 1.127010 1.685666 7.17e-10 4.84e-11 + 1.100000 1.107609 1.700355 7.31e-10 4.30e-11 + 1.200000 1.086821 1.712320 6.79e-10 3.86e-11 + 1.300000 1.064777 1.721499 6.92e-10 3.44e-11 + 1.400000 1.041625 1.727845 2.04e-08 6.72e-11 + 1.500000 1.017530 1.731328 1.59e-07 7.12e-10 + 1.600000 0.992673 1.731928 6.88e-08 2.91e-10 + 1.700000 0.967253 1.729643 8.70e-08 3.76e-10 + 1.800000 0.941488 1.724485 5.13e-10 5.69e-11 + 1.900000 0.915617 1.716479 8.67e-10 5.85e-11 + 2.000000 0.889903 1.705666 6.33e-10 5.28e-11 + 2.100000 0.864625 1.692102 6.31e-10 4.83e-11 + 2.200000 0.840089 1.675857 5.82e-10 4.42e-11 + 2.300000 0.816616 1.657017 5.51e-10 4.05e-11 + 2.400000 0.794546 1.635684 5.15e-10 3.71e-11 + 2.500000 0.774227 1.611978 5.14e-10 3.44e-11 + 2.600000 0.756013 1.586033 4.88e-10 3.16e-11 + 2.700000 0.740246 1.558005 4.89e-10 2.93e-11 + 2.800000 0.727247 1.528067 4.90e-10 2.73e-11 + 2.900000 0.717301 1.496412 4.79e-10 2.54e-11 + 3.000000 0.710636 1.463257 4.70e-10 2.36e-11 + 3.100000 0.707412 1.428839 9.20e-08 4.46e-10 + 3.200000 0.707710 1.393422 1.09e-07 5.62e-10 + 3.300000 0.711520 1.357297 5.27e-10 1.53e-11 + 3.400000 0.718750 1.320780 4.47e-10 1.41e-11 + 3.500000 0.729227 1.284218 4.49e-10 1.32e-11 + 3.600000 0.742712 1.247990 4.72e-10 1.26e-11 + 3.700000 0.758914 1.212503 4.83e-10 1.20e-11 + 3.800000 0.777506 1.178194 4.61e-10 1.13e-11 + 3.900000 0.798144 1.145528 4.83e-10 1.07e-11 + 4.000000 0.820474 1.114988 4.63e-10 9.99e-12 + 4.100000 0.844149 1.087071 4.86e-10 9.55e-12 + 4.200000 0.868832 1.062273 4.87e-10 8.65e-12 + 4.300000 0.894204 1.041074 4.18e-10 8.16e-12 + 4.400000 0.919964 1.023913 7.04e-12 4.13e-12 + 4.500000 0.945834 1.011173 1.24e-09 1.30e-11 + 4.600000 0.971557 1.003150 2.19e-08 6.19e-10 + 4.700000 0.996898 1.000038 1.43e-07 2.28e-09 + 4.800000 1.021640 1.001916 1.99e-07 1.27e-09 + 4.900000 1.045589 1.008736 6.84e-10 3.85e-11 + 5.000000 1.068565 1.020331 7.31e-10 3.42e-11 + 5.100000 1.090408 1.036429 7.07e-10 2.95e-11 + 5.200000 1.110972 1.056667 7.11e-10 2.61e-11 + 5.300000 1.130127 1.080617 7.73e-10 2.25e-11 + 5.400000 1.147757 1.107807 7.36e-10 1.98e-11 + 5.500000 1.163759 1.137743 7.37e-10 1.71e-11 + 5.600000 1.178042 1.169929 7.67e-10 1.46e-11 + 5.700000 1.190528 1.203875 8.07e-10 1.21e-11 + 5.800000 1.201149 1.239112 7.52e-10 1.06e-11 + 5.900000 1.209851 1.275195 8.14e-10 8.47e-12 + 6.000000 1.216587 1.311711 7.93e-10 7.30e-12 + 6.100000 1.221325 1.348272 7.60e-10 6.06e-12 + 6.200000 1.224039 1.384525 2.32e-07 1.19e-09 + 6.300000 1.224716 1.420146 1.87e-07 9.24e-10 + 6.400000 1.223353 1.454836 2.45e-07 1.21e-09 + 6.500000 1.219956 1.488328 2.34e-07 1.12e-09 + 6.600000 1.214543 1.520375 2.43e-07 1.12e-09 + 6.700000 1.207142 1.550758 8.17e-10 9.47e-11 + 6.800000 1.197789 1.579276 7.68e-10 8.41e-11 + 6.900000 1.186534 1.605752 8.06e-10 7.42e-11 + 7.000000 1.173436 1.630027 7.70e-10 6.59e-11 ------------------------------------------------------ Final Solver Statistics: Internal solver steps = 2271 (attempted = 3401) Total number of error test failures = 0 - Total RHS evals: Fe = 14917, Fi = 51629 - Total mass matrix setups = 13777 - Total mass matrix solves = 68814 + Total RHS evals: Fe = 13787, Fi = 50499 + Total mass matrix setups = 12646 + Total mass matrix solves = 64284 Total mass times evals = 2271 Total number of Jacobian evaluations = 0 Total linear solver setups = 0 Total number of Nonlinear iterations = 36712 Total number of Nonlinear convergence failures = 1130 - Errors: u = 0.000128202, v = 7.56396e-05, total = 0.000105255 + Errors: u = 7.56688e-08, v = 4.52391e-10, total = 5.35069e-08 diff --git a/examples/arkode/CXX_serial/ark_kpr_Mt_0_5.out b/examples/arkode/CXX_serial/ark_kpr_Mt_0_5.out index 0e4c7017ec..7f9417757d 100644 --- a/examples/arkode/CXX_serial/ark_kpr_Mt_0_5.out +++ b/examples/arkode/CXX_serial/ark_kpr_Mt_0_5.out @@ -12,117 +12,117 @@ Nonlinear Kvaerno-Prothero-Robinson test problem with mass matrix: t u v uerr verr ------------------------------------------------------ -3.000000 0.710636 1.363407 0.00e+00 0.00e+00 - -2.900000 0.717388 1.327299 8.73e-05 3.66e-04 - -2.800000 0.728314 1.288641 1.07e-03 1.71e-03 - -2.700000 0.741339 1.252148 1.09e-03 1.89e-03 - -2.600000 0.755772 1.218919 2.41e-04 5.19e-04 - -2.500000 0.775163 1.183340 9.36e-04 5.22e-04 - -2.400000 0.796592 1.149044 2.05e-03 1.84e-03 - -2.300000 0.817654 1.120075 1.04e-03 1.22e-04 - -2.200000 0.843176 1.090371 3.09e-03 1.19e-03 - -2.100000 0.868704 1.064378 4.08e-03 1.83e-03 - -2.000000 0.893196 1.042908 3.29e-03 1.46e-03 - -1.900000 0.916762 1.026017 1.15e-03 4.82e-04 - -1.800000 0.945436 1.012933 3.95e-03 5.90e-05 - -1.700000 0.980666 1.004097 1.34e-02 6.16e-05 - -1.600000 0.998761 1.000587 6.09e-03 3.73e-04 - -1.500000 1.017448 1.000988 8.25e-05 2.63e-04 - -1.400000 1.042940 1.007750 1.32e-03 5.01e-04 - -1.300000 1.071766 1.020789 6.99e-03 2.73e-03 - -1.200000 1.096158 1.037591 9.34e-03 4.17e-03 - -1.100000 1.116122 1.057371 8.51e-03 4.38e-03 - -1.000000 1.133776 1.080322 6.77e-03 3.97e-03 - -0.900000 1.150174 1.106624 5.27e-03 3.59e-03 - -0.800000 1.165496 1.136147 4.31e-03 3.61e-03 - -0.700000 1.179450 1.168433 3.69e-03 4.05e-03 - -0.600000 1.191803 1.202813 3.25e-03 4.75e-03 - -0.500000 1.202130 1.238472 2.63e-03 5.36e-03 - -0.400000 1.210436 1.274789 1.91e-03 5.70e-03 - -0.300000 1.216680 1.310633 1.09e-03 5.08e-03 - -0.200000 1.221032 1.345104 3.63e-04 2.97e-03 - -0.100000 1.223727 1.378032 2.80e-06 4.33e-04 - 0.000000 1.224604 1.412721 1.41e-04 1.49e-03 - 0.100000 1.223128 1.449128 5.97e-04 4.77e-05 - 0.200000 1.219267 1.485113 1.40e-03 2.32e-03 - 0.300000 1.213399 1.519147 2.19e-03 4.05e-03 - 0.400000 1.206050 1.550292 2.47e-03 4.52e-03 - 0.500000 1.197696 1.577986 1.80e-03 3.37e-03 - 0.600000 1.188182 1.602312 3.75e-04 8.61e-04 - 0.700000 1.175839 1.625020 7.53e-05 1.08e-03 - 0.800000 1.159254 1.648147 1.93e-03 2.94e-04 - 0.900000 1.140173 1.669602 4.73e-03 1.27e-03 - 1.000000 1.120421 1.687986 6.59e-03 2.32e-03 - 1.100000 1.101290 1.702694 6.32e-03 2.34e-03 - 1.200000 1.083051 1.713755 3.77e-03 1.43e-03 - 1.300000 1.064474 1.721636 3.03e-04 1.38e-04 - 1.400000 1.041492 1.727466 1.33e-04 3.79e-04 - 1.500000 1.013536 1.731237 3.99e-03 9.08e-05 - 1.600000 0.984457 1.731961 8.22e-03 3.28e-05 - 1.700000 0.957111 1.729388 1.01e-02 2.55e-04 - 1.800000 0.932874 1.723796 8.61e-03 6.88e-04 - 1.900000 0.911325 1.715739 4.29e-03 7.40e-04 - 2.000000 0.890114 1.705753 2.11e-04 8.67e-05 - 2.100000 0.864107 1.692643 5.18e-04 5.41e-04 - 2.200000 0.835391 1.675464 4.70e-03 3.93e-04 - 2.300000 0.808511 1.654919 8.10e-03 2.10e-03 - 2.400000 0.785914 1.632068 8.63e-03 3.62e-03 - 2.500000 0.768154 1.608069 6.07e-03 3.91e-03 - 2.600000 0.754531 1.584376 1.48e-03 1.66e-03 - 2.700000 0.740261 1.559180 1.56e-05 1.18e-03 - 2.800000 0.724434 1.524972 2.81e-03 3.09e-03 - 2.900000 0.715918 1.492839 1.38e-03 3.57e-03 - 3.000000 0.710611 1.463290 2.53e-05 3.29e-05 - 3.100000 0.707311 1.424683 1.01e-04 4.16e-03 - 3.200000 0.708518 1.392506 8.09e-04 9.17e-04 - 3.300000 0.711954 1.355294 4.34e-04 2.00e-03 - 3.400000 0.721526 1.317145 2.78e-03 3.63e-03 - 3.500000 0.729040 1.285553 1.87e-04 1.33e-03 - 3.600000 0.746590 1.243533 3.88e-03 4.46e-03 - 3.700000 0.761014 1.212342 2.10e-03 1.61e-04 - 3.800000 0.779555 1.175901 2.05e-03 2.29e-03 - 3.900000 0.803501 1.142951 5.36e-03 2.58e-03 - 4.000000 0.819925 1.115851 5.49e-04 8.63e-04 - 4.100000 0.850182 1.084064 6.03e-03 3.01e-03 - 4.200000 0.870689 1.062493 1.86e-03 2.20e-04 - 4.300000 0.897346 1.039678 3.14e-03 1.40e-03 - 4.400000 0.925196 1.023112 5.23e-03 8.01e-04 - 4.500000 0.945438 1.011315 3.96e-04 1.43e-04 - 4.600000 0.975016 1.003205 3.46e-03 5.53e-05 - 4.700000 1.000787 1.000237 3.89e-03 1.98e-04 - 4.800000 1.023771 1.002064 2.13e-03 1.48e-04 - 4.900000 1.049731 1.010069 4.14e-03 1.33e-03 - 5.000000 1.069597 1.020192 1.03e-03 1.39e-04 - 5.100000 1.094382 1.038873 3.97e-03 2.44e-03 - 5.200000 1.111245 1.056062 2.73e-04 6.05e-04 - 5.300000 1.133607 1.083908 3.48e-03 3.29e-03 - 5.400000 1.147625 1.106806 1.32e-04 1.00e-03 - 5.500000 1.166537 1.141480 2.78e-03 3.74e-03 - 5.600000 1.177807 1.168831 2.35e-04 1.10e-03 - 5.700000 1.192487 1.207635 1.96e-03 3.76e-03 - 5.800000 1.201013 1.238372 1.36e-04 7.40e-04 - 5.900000 1.211002 1.278614 1.15e-03 3.42e-03 - 6.000000 1.216618 1.311855 3.03e-05 1.45e-04 - 6.100000 1.221705 1.351089 3.80e-04 2.82e-03 - 6.200000 1.224097 1.385673 5.79e-05 1.15e-03 - 6.300000 1.224433 1.422213 2.83e-04 2.07e-03 - 6.400000 1.223202 1.456776 1.51e-04 1.94e-03 - 6.500000 1.219174 1.489612 7.82e-04 1.28e-03 - 6.600000 1.213915 1.522834 6.29e-04 2.46e-03 - 6.700000 1.206078 1.551321 1.06e-03 5.63e-04 - 6.800000 1.196415 1.581959 1.37e-03 2.68e-03 - 6.900000 1.185452 1.605738 1.08e-03 1.44e-05 - 7.000000 1.171096 1.632645 2.34e-03 2.62e-03 + -2.900000 0.717299 1.326933 2.17e-06 2.61e-08 + -2.800000 0.727242 1.290353 5.02e-06 4.87e-08 + -2.700000 0.740244 1.254041 2.34e-06 1.64e-08 + -2.600000 0.756012 1.218400 1.45e-06 5.75e-08 + -2.500000 0.774224 1.183861 3.66e-06 4.59e-08 + -2.400000 0.794544 1.150885 1.97e-06 5.84e-08 + -2.300000 0.816613 1.119953 3.48e-06 1.01e-07 + -2.200000 0.840087 1.091560 2.43e-06 1.14e-09 + -2.100000 0.864618 1.066204 7.08e-06 2.30e-09 + -2.000000 0.889895 1.044367 7.59e-06 3.97e-08 + -1.900000 0.915607 1.026499 1.06e-05 1.44e-07 + -1.800000 0.941492 1.012991 4.02e-06 4.95e-07 + -1.700000 0.967257 1.004158 4.11e-06 4.82e-07 + -1.600000 0.992683 1.000213 9.89e-06 6.54e-07 + -1.500000 1.017558 1.001251 2.75e-05 1.04e-06 + -1.400000 1.041689 1.007247 6.33e-05 1.54e-06 + -1.300000 1.064815 1.018056 3.81e-05 1.54e-06 + -1.200000 1.086836 1.033420 1.52e-05 1.52e-06 + -1.100000 1.107689 1.052990 8.03e-05 2.09e-06 + -1.000000 1.127096 1.076348 8.61e-05 2.22e-06 + -0.900000 1.144923 1.103027 1.91e-05 1.84e-06 + -0.800000 1.161242 1.132537 5.54e-05 2.09e-06 + -0.700000 1.175875 1.164378 1.11e-04 2.44e-06 + -0.600000 1.188617 1.198062 5.95e-05 2.11e-06 + -0.500000 1.199513 1.233114 1.68e-05 1.88e-06 + -0.400000 1.208606 1.269084 8.23e-05 2.98e-06 + -0.300000 1.215709 1.305554 1.16e-04 3.26e-06 + -0.200000 1.220692 1.342134 2.30e-05 2.71e-06 + -0.100000 1.223796 1.378462 7.12e-05 3.08e-06 + 0.000000 1.224877 1.414210 1.32e-04 3.54e-06 + 0.100000 1.223793 1.449077 6.82e-05 3.15e-06 + 0.200000 1.220698 1.482788 2.92e-05 3.17e-06 + 0.300000 1.215709 1.515093 1.16e-04 4.03e-06 + 0.400000 1.208659 1.545770 1.35e-04 4.24e-06 + 0.500000 1.199523 1.574616 2.67e-05 3.55e-06 + 0.600000 1.188625 1.601447 6.77e-05 3.55e-06 + 0.700000 1.175888 1.626102 1.24e-04 3.24e-06 + 0.800000 1.161245 1.648438 5.90e-05 2.46e-06 + 0.900000 1.144927 1.668329 2.33e-05 1.85e-06 + 1.000000 1.127103 1.685665 9.32e-05 1.66e-06 + 1.100000 1.107692 1.700354 8.25e-05 1.18e-06 + 1.200000 1.086835 1.712319 1.40e-05 5.65e-07 + 1.300000 1.064818 1.721499 4.17e-05 2.90e-07 + 1.400000 1.041691 1.727845 6.55e-05 2.56e-09 + 1.500000 1.017558 1.731328 2.73e-05 4.16e-07 + 1.600000 0.992682 1.731928 8.66e-06 7.34e-07 + 1.700000 0.967276 1.729644 2.38e-05 1.04e-06 + 1.800000 0.941500 1.724486 1.27e-05 1.33e-06 + 1.900000 0.915618 1.716480 6.40e-07 1.48e-06 + 2.000000 0.889865 1.705668 3.74e-05 1.97e-06 + 2.100000 0.864463 1.692105 1.63e-04 2.89e-06 + 2.200000 0.839771 1.675861 3.18e-04 3.84e-06 + 2.300000 0.816292 1.657021 3.24e-04 3.84e-06 + 2.400000 0.794423 1.635687 1.23e-04 2.71e-06 + 2.500000 0.774078 1.611980 1.50e-04 2.70e-06 + 2.600000 0.755825 1.586036 1.88e-04 3.00e-06 + 2.700000 0.740043 1.558009 2.03e-04 3.71e-06 + 2.800000 0.727119 1.528070 1.28e-04 3.62e-06 + 2.900000 0.717266 1.496415 3.55e-05 3.11e-06 + 3.000000 0.710497 1.463260 1.40e-04 3.72e-06 + 3.100000 0.707393 1.428842 1.94e-05 3.00e-06 + 3.200000 0.707605 1.393426 1.04e-04 3.48e-06 + 3.300000 0.711478 1.357300 4.12e-05 3.10e-06 + 3.400000 0.718691 1.320783 5.83e-05 3.23e-06 + 3.500000 0.729151 1.284222 7.60e-05 3.36e-06 + 3.600000 0.742697 1.247993 1.45e-05 2.83e-06 + 3.700000 0.758850 1.212506 6.40e-05 2.82e-06 + 3.800000 0.777488 1.178197 1.79e-05 2.37e-06 + 3.900000 0.798113 1.145530 3.15e-05 2.20e-06 + 4.000000 0.820445 1.114990 2.97e-05 1.96e-06 + 4.100000 0.844142 1.087072 7.54e-06 1.64e-06 + 4.200000 0.868812 1.062275 1.99e-05 1.45e-06 + 4.300000 0.894201 1.041075 2.88e-06 1.19e-06 + 4.400000 0.919960 1.023914 3.54e-06 9.65e-07 + 4.500000 0.945847 1.011173 1.29e-05 6.70e-07 + 4.600000 0.971568 1.003150 1.10e-05 4.18e-07 + 4.700000 0.996908 1.000039 9.91e-06 1.68e-07 + 4.800000 1.021690 1.001916 4.99e-05 3.06e-07 + 4.900000 1.045717 1.008735 1.28e-04 9.66e-07 + 5.000000 1.068798 1.020329 2.33e-04 1.82e-06 + 5.100000 1.090687 1.036427 2.79e-04 2.26e-06 + 5.200000 1.111265 1.056665 2.93e-04 2.47e-06 + 5.300000 1.130409 1.080614 2.82e-04 2.48e-06 + 5.400000 1.148027 1.107804 2.70e-04 2.45e-06 + 5.500000 1.164021 1.137741 2.62e-04 2.42e-06 + 5.600000 1.178250 1.169926 2.08e-04 2.55e-06 + 5.700000 1.190798 1.203872 2.71e-04 2.75e-06 + 5.800000 1.201390 1.239109 2.40e-04 2.93e-06 + 5.900000 1.210030 1.275192 1.79e-04 2.93e-06 + 6.000000 1.216691 1.311708 1.03e-04 2.78e-06 + 6.100000 1.221360 1.348269 3.51e-05 2.63e-06 + 6.200000 1.224072 1.384523 3.32e-05 2.86e-06 + 6.300000 1.224817 1.420142 1.01e-04 3.52e-06 + 6.400000 1.223526 1.454832 1.73e-04 4.16e-06 + 6.500000 1.220166 1.488323 2.09e-04 4.52e-06 + 6.600000 1.214751 1.520371 2.07e-04 4.43e-06 + 6.700000 1.207326 1.550753 1.84e-04 4.55e-06 + 6.800000 1.197850 1.579273 6.10e-05 3.22e-06 + 6.900000 1.186555 1.605750 2.16e-05 2.46e-06 + 7.000000 1.173507 1.630024 7.15e-05 2.08e-06 ------------------------------------------------------ Final Solver Statistics: - Internal solver steps = 149 (attempted = 150) - Total number of error test failures = 0 - Total RHS evals: Fe = 1299, Fi = 4690 - Total mass matrix setups = 1249 - Total mass matrix solves = 2644 - Total mass times evals = 3540 - Total number of Jacobian evaluations = 183 - Total linear solver setups = 183 - Total number of Nonlinear iterations = 3391 - Total number of Nonlinear convergence failures = 174 - Errors: u = 0.00385864, v = 0.00235449, total = 0.0031963 + Internal solver steps = 144 (attempted = 146) + Total number of error test failures = 1 + Total RHS evals: Fe = 1265, Fi = 4680 + Total mass matrix setups = 1121 + Total mass matrix solves = 2428 + Total mass times evals = 3559 + Total number of Jacobian evaluations = 204 + Total linear solver setups = 214 + Total number of Nonlinear iterations = 3415 + Total number of Nonlinear convergence failures = 203 + Errors: u = 0.000119634, v = 2.45689e-06, total = 8.46118e-05 diff --git a/examples/arkode/CXX_serial/ark_kpr_Mt_1_-3_0_-10_0.out b/examples/arkode/CXX_serial/ark_kpr_Mt_1_-3_0_-10_0.out index b3ee50ac25..848d98ebc4 100644 --- a/examples/arkode/CXX_serial/ark_kpr_Mt_1_-3_0_-10_0.out +++ b/examples/arkode/CXX_serial/ark_kpr_Mt_1_-3_0_-10_0.out @@ -18,6 +18,6 @@ Nonlinear Kvaerno-Prothero-Robinson test problem with mass matrix: h = 3.125e-02, error = 1.482e-07, order = 2.90 h = 1.562e-02, error = 1.929e-08, order = 2.94 h = 7.812e-03, error = 2.467e-09, order = 2.97 - h = 3.906e-03, error = 3.121e-10, order = 2.98 + h = 3.906e-03, error = 3.124e-10, order = 2.98 ----------------------------------------------------- Order: max = 2.98, avg = 2.89, overall = 2.89 [SUCCESS] diff --git a/examples/arkode/CXX_serial/ark_kpr_Mt_1_-5.out b/examples/arkode/CXX_serial/ark_kpr_Mt_1_-5.out index 0dd082d2db..5c1b0cbb31 100644 --- a/examples/arkode/CXX_serial/ark_kpr_Mt_1_-5.out +++ b/examples/arkode/CXX_serial/ark_kpr_Mt_1_-5.out @@ -13,11 +13,11 @@ Nonlinear Kvaerno-Prothero-Robinson test problem with mass matrix: ----------------------------------------------------- h = 5.000e-01, error = 1.725e-05 h = 2.500e-01, error = 2.900e-06, order = 2.57 - h = 1.250e-01, error = 3.630e-07, order = 3.00 - h = 6.250e-02, error = 2.784e-08, order = 3.70 - h = 3.125e-02, error = 1.198e-09, order = 4.54 - h = 1.562e-02, error = 4.518e-11, order = 4.73 - h = 7.812e-03, error = 1.355e-11, order = 1.74 - h = 3.906e-03, error = 1.389e-10, order = -3.36 + h = 1.250e-01, error = 3.629e-07, order = 3.00 + h = 6.250e-02, error = 2.782e-08, order = 3.71 + h = 3.125e-02, error = 1.209e-09, order = 4.52 + h = 1.562e-02, error = 3.841e-11, order = 4.98 + h = 7.812e-03, error = 5.907e-11, order = -0.62 + h = 3.906e-03, error = 5.812e-10, order = -3.30 ----------------------------------------------------- - Order: max = 4.73, avg = 2.42, overall = 2.98 [SUCCESS] + Order: max = 4.98, avg = 2.12, overall = 2.69 [SUCCESS] diff --git a/examples/arkode/CXX_serial/ark_kpr_Mt_1_4.out b/examples/arkode/CXX_serial/ark_kpr_Mt_1_4.out index f50c73b72e..8f2cfc2057 100644 --- a/examples/arkode/CXX_serial/ark_kpr_Mt_1_4.out +++ b/examples/arkode/CXX_serial/ark_kpr_Mt_1_4.out @@ -12,117 +12,117 @@ Nonlinear Kvaerno-Prothero-Robinson test problem with mass matrix: t u v uerr verr ------------------------------------------------------ -3.000000 0.710636 1.363407 0.00e+00 0.00e+00 - -2.900000 0.717208 1.327305 9.30e-05 3.72e-04 - -2.800000 0.727268 1.290371 2.03e-05 1.72e-05 - -2.700000 0.740425 1.253644 1.79e-04 3.98e-04 - -2.600000 0.755801 1.218831 2.12e-04 4.31e-04 - -2.500000 0.774699 1.183143 4.72e-04 7.18e-04 - -2.400000 0.794073 1.151533 4.73e-04 6.47e-04 - -2.300000 0.817175 1.119339 5.59e-04 6.14e-04 - -2.200000 0.839499 1.092138 5.90e-04 5.78e-04 - -2.100000 0.864212 1.066598 4.13e-04 3.94e-04 - -2.000000 0.889032 1.044976 8.71e-04 6.09e-04 - -1.900000 0.914718 1.026973 9.00e-04 4.74e-04 - -1.800000 0.940179 1.013455 1.31e-03 4.63e-04 - -1.700000 0.968083 1.004047 8.31e-04 1.12e-04 - -1.600000 0.993909 1.000388 1.24e-03 1.75e-04 - -1.500000 1.017654 1.001477 1.23e-04 2.25e-04 - -1.400000 1.040934 1.007085 6.92e-04 1.64e-04 - -1.300000 1.063961 1.017604 8.15e-04 4.54e-04 - -1.200000 1.086272 1.033016 5.49e-04 4.06e-04 - -1.100000 1.107659 1.053203 4.94e-05 2.11e-04 - -1.000000 1.127623 1.077435 6.13e-04 1.08e-03 - -0.900000 1.144846 1.102917 5.76e-05 1.13e-04 - -0.800000 1.161002 1.132205 1.85e-04 3.34e-04 - -0.700000 1.176043 1.165234 2.79e-04 8.53e-04 - -0.600000 1.188410 1.197657 1.47e-04 4.07e-04 - -0.500000 1.199588 1.233521 9.12e-05 4.05e-04 - -0.400000 1.208528 1.269280 4.29e-06 1.93e-04 - -0.300000 1.215451 1.304558 1.42e-04 9.99e-04 - -0.200000 1.220755 1.343310 8.63e-05 1.17e-03 - -0.100000 1.223670 1.377830 5.45e-05 6.35e-04 - 0.000000 1.224746 1.413828 1.30e-06 3.86e-04 - 0.100000 1.223656 1.450033 6.83e-05 9.53e-04 - 0.200000 1.220713 1.482092 4.42e-05 6.99e-04 - 0.300000 1.215653 1.514717 5.94e-05 3.81e-04 - 0.400000 1.208303 1.546650 2.21e-04 8.76e-04 - 0.500000 1.199626 1.574073 1.30e-04 5.46e-04 - 0.600000 1.188765 1.600906 2.08e-04 5.44e-04 - 0.700000 1.175362 1.626884 4.02e-04 7.79e-04 - 0.800000 1.160968 1.648722 2.18e-04 2.81e-04 - 0.900000 1.145114 1.667998 2.10e-04 3.33e-04 - 1.000000 1.127514 1.685113 5.04e-04 5.53e-04 - 1.100000 1.108159 1.699899 5.49e-04 4.56e-04 - 1.200000 1.087142 1.712119 3.22e-04 2.01e-04 - 1.300000 1.064531 1.721612 2.45e-04 1.13e-04 - 1.400000 1.040958 1.728047 6.67e-04 2.01e-04 - 1.500000 1.016725 1.731456 8.05e-04 1.29e-04 - 1.600000 0.991983 1.731941 6.91e-04 1.35e-05 - 1.700000 0.966874 1.729586 3.79e-04 5.72e-05 - 1.800000 0.940784 1.724279 7.04e-04 2.06e-04 - 1.900000 0.915877 1.716442 2.59e-04 3.71e-05 - 2.000000 0.890471 1.705877 5.68e-04 2.10e-04 - 2.100000 0.863219 1.691310 1.41e-03 7.92e-04 - 2.200000 0.840201 1.675797 1.12e-04 5.96e-05 - 2.300000 0.816737 1.657004 1.21e-04 1.31e-05 - 2.400000 0.793668 1.634786 8.78e-04 8.98e-04 - 2.500000 0.774939 1.612776 7.11e-04 7.98e-04 - 2.600000 0.755378 1.585094 6.35e-04 9.39e-04 - 2.700000 0.739812 1.557192 4.34e-04 8.13e-04 - 2.800000 0.727481 1.528628 2.34e-04 5.61e-04 - 2.900000 0.717491 1.496927 1.90e-04 5.15e-04 - 3.000000 0.710508 1.462255 1.29e-04 1.00e-03 - 3.100000 0.707466 1.429783 5.39e-05 9.44e-04 - 3.200000 0.707793 1.392653 8.38e-05 7.69e-04 - 3.300000 0.711356 1.358368 1.64e-04 1.07e-03 - 3.400000 0.719043 1.319780 2.93e-04 9.99e-04 - 3.500000 0.728867 1.285263 3.60e-04 1.04e-03 - 3.600000 0.743163 1.247040 4.51e-04 9.50e-04 - 3.700000 0.759125 1.212182 2.12e-04 3.21e-04 - 3.800000 0.777005 1.178985 5.01e-04 7.90e-04 - 3.900000 0.797903 1.145840 2.41e-04 3.12e-04 - 4.000000 0.821085 1.114325 6.11e-04 6.63e-04 - 4.100000 0.844766 1.086520 6.17e-04 5.50e-04 - 4.200000 0.869296 1.061916 4.64e-04 3.57e-04 - 4.300000 0.894280 1.041111 7.58e-05 3.77e-05 - 4.400000 0.919226 1.024310 7.38e-04 3.97e-04 - 4.500000 0.947241 1.010826 1.41e-03 3.47e-04 - 4.600000 0.972517 1.003182 9.60e-04 3.27e-05 - 4.700000 0.996899 1.000222 6.87e-07 1.84e-04 - 4.800000 1.020790 1.001834 8.50e-04 8.23e-05 - 4.900000 1.044488 1.008269 1.10e-03 4.67e-04 - 5.000000 1.067577 1.019650 9.88e-04 6.81e-04 - 5.100000 1.089592 1.035682 8.16e-04 7.47e-04 - 5.200000 1.110689 1.056427 2.83e-04 2.40e-04 - 5.300000 1.130590 1.081510 4.63e-04 8.94e-04 - 5.400000 1.148014 1.108349 2.57e-04 5.43e-04 - 5.500000 1.163471 1.137100 2.88e-04 6.43e-04 - 5.600000 1.178297 1.170732 2.55e-04 8.03e-04 - 5.700000 1.190803 1.204950 2.75e-04 1.08e-03 - 5.800000 1.201254 1.239702 1.04e-04 5.91e-04 - 5.900000 1.209788 1.274961 6.34e-05 2.35e-04 - 6.000000 1.216453 1.310771 1.35e-04 9.40e-04 - 6.100000 1.221238 1.347205 8.70e-05 1.07e-03 - 6.200000 1.224075 1.385740 3.64e-05 1.21e-03 - 6.300000 1.224694 1.421145 2.19e-05 9.99e-04 - 6.400000 1.223290 1.455612 6.29e-05 7.75e-04 - 6.500000 1.219880 1.488778 7.64e-05 4.50e-04 - 6.600000 1.214417 1.521008 1.26e-04 6.32e-04 - 6.700000 1.206981 1.551430 1.61e-04 6.72e-04 - 6.800000 1.197968 1.578698 1.79e-04 5.78e-04 - 6.900000 1.186755 1.605158 2.21e-04 5.94e-04 - 7.000000 1.173344 1.630149 9.14e-05 1.23e-04 + -2.900000 0.717303 1.326933 1.41e-06 9.00e-08 + -2.800000 0.727250 1.290353 3.05e-06 3.67e-07 + -2.700000 0.740247 1.254042 1.58e-06 3.07e-07 + -2.600000 0.756016 1.218400 3.34e-06 3.18e-07 + -2.500000 0.774229 1.183863 1.87e-06 1.42e-06 + -2.400000 0.794549 1.150887 2.92e-06 1.67e-06 + -2.300000 0.816618 1.119956 2.05e-06 3.01e-06 + -2.200000 0.840090 1.091564 8.04e-07 3.49e-06 + -2.100000 0.864626 1.066208 5.07e-07 4.62e-06 + -2.000000 0.889905 1.044373 2.49e-06 5.91e-06 + -1.900000 0.915619 1.026506 1.67e-06 6.92e-06 + -1.800000 0.941488 1.013000 1.28e-07 8.31e-06 + -1.700000 0.967252 1.004167 7.11e-07 7.62e-06 + -1.600000 0.992671 1.000220 1.97e-06 6.97e-06 + -1.500000 1.017528 1.001258 2.21e-06 6.34e-06 + -1.400000 1.041624 1.007259 1.57e-06 1.01e-05 + -1.300000 1.064775 1.018068 1.63e-06 1.00e-05 + -1.200000 1.086819 1.033433 1.64e-06 1.08e-05 + -1.100000 1.107607 1.053004 1.91e-06 1.16e-05 + -1.000000 1.127008 1.076363 2.23e-06 1.36e-05 + -0.900000 1.144902 1.103043 1.90e-06 1.35e-05 + -0.800000 1.161180 1.132551 6.58e-06 1.21e-05 + -0.700000 1.175761 1.164391 2.88e-06 1.06e-05 + -0.600000 1.188555 1.198075 1.66e-06 1.09e-05 + -0.500000 1.199494 1.233127 2.39e-06 1.14e-05 + -0.400000 1.208523 1.269100 1.54e-06 1.29e-05 + -0.300000 1.215593 1.305570 2.94e-07 1.28e-05 + -0.200000 1.220668 1.342149 8.50e-07 1.20e-05 + -0.100000 1.223723 1.378476 2.01e-06 1.09e-05 + 0.000000 1.224741 1.414224 3.73e-06 1.05e-05 + 0.100000 1.223723 1.449092 1.20e-06 1.21e-05 + 0.200000 1.220668 1.482803 1.21e-06 1.17e-05 + 0.300000 1.215591 1.515108 2.74e-06 1.08e-05 + 0.400000 1.208522 1.545785 1.90e-06 1.03e-05 + 0.500000 1.199492 1.574629 3.97e-06 1.02e-05 + 0.600000 1.188555 1.601458 1.74e-06 8.35e-06 + 0.700000 1.175761 1.626112 2.87e-06 7.30e-06 + 0.800000 1.161184 1.648447 2.00e-06 6.59e-06 + 0.900000 1.144903 1.668335 8.98e-07 4.56e-06 + 1.000000 1.127005 1.685670 5.32e-06 4.04e-06 + 1.100000 1.107608 1.700357 8.68e-07 2.08e-06 + 1.200000 1.086818 1.712321 2.45e-06 1.14e-06 + 1.300000 1.064776 1.721498 4.33e-07 5.31e-07 + 1.400000 1.041624 1.727843 1.76e-06 1.91e-06 + 1.500000 1.017530 1.731324 3.22e-07 3.31e-06 + 1.600000 0.992672 1.731923 7.91e-07 5.08e-06 + 1.700000 0.967252 1.729637 7.00e-07 6.26e-06 + 1.800000 0.941487 1.724472 2.93e-07 1.28e-05 + 1.900000 0.915617 1.716467 4.48e-08 1.16e-05 + 2.000000 0.889904 1.705655 1.90e-06 1.08e-05 + 2.100000 0.864611 1.692092 1.40e-05 9.99e-06 + 2.200000 0.840090 1.675847 1.09e-06 9.68e-06 + 2.300000 0.816618 1.657006 2.22e-06 1.06e-05 + 2.400000 0.794547 1.635674 1.39e-06 1.03e-05 + 2.500000 0.774228 1.611967 3.25e-07 1.09e-05 + 2.600000 0.756014 1.586021 1.04e-06 1.22e-05 + 2.700000 0.740245 1.557992 7.23e-07 1.32e-05 + 2.800000 0.727249 1.528053 1.66e-06 1.38e-05 + 2.900000 0.717302 1.496399 8.11e-07 1.32e-05 + 3.000000 0.710637 1.463243 6.86e-07 1.39e-05 + 3.100000 0.707415 1.428826 2.59e-06 1.25e-05 + 3.200000 0.707710 1.393410 6.94e-07 1.21e-05 + 3.300000 0.711521 1.357285 1.53e-06 1.14e-05 + 3.400000 0.718751 1.320770 1.60e-06 1.01e-05 + 3.500000 0.729226 1.284209 5.55e-07 9.40e-06 + 3.600000 0.742716 1.247982 3.92e-06 8.60e-06 + 3.700000 0.758914 1.212497 4.97e-07 5.99e-06 + 3.800000 0.777505 1.178189 1.74e-06 5.18e-06 + 3.900000 0.798150 1.145523 5.73e-06 4.63e-06 + 4.000000 0.820475 1.114985 1.79e-07 2.61e-06 + 4.100000 0.844150 1.087070 2.82e-07 1.21e-06 + 4.200000 0.868833 1.062273 5.41e-07 1.95e-07 + 4.300000 0.894211 1.041074 7.05e-06 7.71e-07 + 4.400000 0.919971 1.023914 6.81e-06 1.43e-06 + 4.500000 0.945834 1.011175 5.80e-08 2.53e-06 + 4.600000 0.971556 1.003152 1.08e-06 2.89e-06 + 4.700000 0.996895 1.000042 2.64e-06 3.95e-06 + 4.800000 1.021638 1.001920 2.63e-06 4.28e-06 + 4.900000 1.045585 1.008740 3.46e-06 4.07e-06 + 5.000000 1.068562 1.020337 3.07e-06 5.68e-06 + 5.100000 1.090405 1.036435 2.52e-06 6.24e-06 + 5.200000 1.110969 1.056675 2.42e-06 7.46e-06 + 5.300000 1.130132 1.080627 4.44e-06 1.01e-05 + 5.400000 1.147758 1.107819 5.47e-07 1.21e-05 + 5.500000 1.163763 1.137757 3.73e-06 1.39e-05 + 5.600000 1.178041 1.169944 1.24e-06 1.55e-05 + 5.700000 1.190526 1.203890 2.00e-06 1.57e-05 + 5.800000 1.201147 1.239128 1.86e-06 1.64e-05 + 5.900000 1.209851 1.275211 1.54e-07 1.56e-05 + 6.000000 1.216587 1.311725 4.24e-07 1.49e-05 + 6.100000 1.221324 1.348286 9.63e-07 1.37e-05 + 6.200000 1.224037 1.384538 2.29e-06 1.25e-05 + 6.300000 1.224713 1.420159 3.01e-06 1.36e-05 + 6.400000 1.223352 1.454851 1.10e-06 1.45e-05 + 6.500000 1.219953 1.488343 3.87e-06 1.52e-05 + 6.600000 1.214543 1.520390 4.21e-07 1.50e-05 + 6.700000 1.207142 1.550771 1.08e-07 1.28e-05 + 6.800000 1.197791 1.579287 1.50e-06 1.09e-05 + 6.900000 1.186533 1.605761 3.49e-07 9.24e-06 + 7.000000 1.173440 1.630034 3.90e-06 7.57e-06 ------------------------------------------------------ Final Solver Statistics: - Internal solver steps = 286 (attempted = 289) + Internal solver steps = 284 (attempted = 287) Total number of error test failures = 3 - Total RHS evals: Fe = 0, Fi = 5808 - Total mass matrix setups = 1448 - Total mass matrix solves = 1734 - Total mass times evals = 4646 - Total number of Jacobian evaluations = 154 - Total linear solver setups = 167 - Total number of Nonlinear iterations = 4360 - Total number of Nonlinear convergence failures = 153 - Errors: u = 0.000511077, v = 0.000617033, total = 0.000566538 + Total RHS evals: Fe = 0, Fi = 5758 + Total mass matrix setups = 1438 + Total mass matrix solves = 1438 + Total mass times evals = 4604 + Total number of Jacobian evaluations = 152 + Total linear solver setups = 166 + Total number of Nonlinear iterations = 4320 + Total number of Nonlinear convergence failures = 151 + Errors: u = 2.75875e-06, v = 9.68052e-06, total = 7.1177e-06 diff --git a/examples/arkode/CXX_serial/ark_kpr_Mt_2_4_0_-10_0.out b/examples/arkode/CXX_serial/ark_kpr_Mt_2_4_0_-10_0.out index 0cb940ef35..54a56620ba 100644 --- a/examples/arkode/CXX_serial/ark_kpr_Mt_2_4_0_-10_0.out +++ b/examples/arkode/CXX_serial/ark_kpr_Mt_2_4_0_-10_0.out @@ -116,8 +116,8 @@ Nonlinear Kvaerno-Prothero-Robinson test problem with mass matrix: Final Solver Statistics: Internal solver steps = 165 (attempted = 168) Total number of error test failures = 3 - Total RHS evals: Fe = 1008, Fi = 0 - Total mass matrix setups = 676 - Total mass matrix solves = 1008 + Total RHS evals: Fe = 840, Fi = 0 + Total mass matrix setups = 672 + Total mass matrix solves = 840 Total mass times evals = 165 Errors: u = 3.7533e-06, v = 2.61601e-07, total = 2.66042e-06 diff --git a/examples/arkode/CXX_serial/ark_kpr_Mt_2_8_0_-10.out b/examples/arkode/CXX_serial/ark_kpr_Mt_2_8_0_-10.out index 8de30f8bb8..09b1fd9f98 100644 --- a/examples/arkode/CXX_serial/ark_kpr_Mt_2_8_0_-10.out +++ b/examples/arkode/CXX_serial/ark_kpr_Mt_2_8_0_-10.out @@ -11,113 +11,113 @@ Nonlinear Kvaerno-Prothero-Robinson test problem with mass matrix: t u v uerr verr ------------------------------------------------------ -3.000000 0.710636 1.363407 0.00e+00 0.00e+00 - -2.900000 0.718045 1.326475 7.44e-04 4.58e-04 - -2.800000 0.728085 1.289925 8.38e-04 4.28e-04 - -2.700000 0.741158 1.253650 9.13e-04 3.92e-04 - -2.600000 0.756981 1.218051 9.68e-04 3.49e-04 - -2.500000 0.775232 1.183562 1.00e-03 3.00e-04 - -2.400000 0.795569 1.150641 1.02e-03 2.45e-04 - -2.300000 0.817640 1.119769 1.02e-03 1.84e-04 - -2.200000 0.841097 1.091440 1.01e-03 1.20e-04 - -2.100000 0.865605 1.066152 9.79e-04 5.20e-05 - -2.000000 0.890841 1.044384 9.38e-04 1.73e-05 - -1.900000 0.916505 1.026585 8.87e-04 8.65e-05 - -1.800000 0.942316 1.013145 8.29e-04 1.54e-04 - -1.700000 0.968017 1.004376 7.65e-04 2.17e-04 - -1.600000 0.993371 1.000487 6.98e-04 2.74e-04 - -1.500000 1.018160 1.001576 6.29e-04 3.24e-04 - -1.400000 1.042187 1.007615 5.62e-04 3.66e-04 - -1.300000 1.065272 1.018458 4.95e-04 4.00e-04 - -1.200000 1.087252 1.033847 4.32e-04 4.25e-04 - -1.100000 1.107980 1.053435 3.71e-04 4.43e-04 - -1.000000 1.127323 1.076803 3.13e-04 4.53e-04 - -0.900000 1.145162 1.103486 2.58e-04 4.57e-04 - -0.800000 1.161392 1.132995 2.06e-04 4.56e-04 - -0.700000 1.175919 1.164832 1.55e-04 4.51e-04 - -0.600000 1.188664 1.198507 1.07e-04 4.43e-04 - -0.500000 1.199556 1.233548 5.93e-05 4.32e-04 - -0.400000 1.208537 1.269506 1.25e-05 4.19e-04 - -0.300000 1.215560 1.305961 3.40e-05 4.04e-04 - -0.200000 1.220588 1.342524 8.09e-05 3.87e-04 - -0.100000 1.223596 1.378834 1.28e-04 3.69e-04 - 0.000000 1.224568 1.414564 1.77e-04 3.50e-04 - 0.100000 1.223499 1.449410 2.26e-04 3.30e-04 - 0.200000 1.220392 1.483100 2.77e-04 3.09e-04 - 0.300000 1.215265 1.515385 3.29e-04 2.87e-04 - 0.400000 1.208143 1.546038 3.81e-04 2.64e-04 - 0.500000 1.199061 1.574859 4.35e-04 2.39e-04 - 0.600000 1.188067 1.601664 4.90e-04 2.14e-04 - 0.700000 1.175220 1.626292 5.44e-04 1.87e-04 - 0.800000 1.160588 1.648599 5.98e-04 1.59e-04 - 0.900000 1.144254 1.668459 6.50e-04 1.29e-04 - 1.000000 1.126309 1.685764 7.01e-04 9.76e-05 - 1.100000 1.106861 1.700420 7.49e-04 6.49e-05 - 1.200000 1.086028 1.712351 7.92e-04 3.09e-05 - 1.300000 1.063946 1.721494 8.31e-04 4.52e-06 - 1.400000 1.040763 1.727804 8.63e-04 4.11e-05 - 1.500000 1.016643 1.731249 8.87e-04 7.87e-05 - 1.600000 0.991770 1.731811 9.03e-04 1.17e-04 - 1.700000 0.966344 1.729487 9.09e-04 1.56e-04 - 1.800000 0.940584 1.724289 9.03e-04 1.95e-04 - 1.900000 0.914733 1.716245 8.85e-04 2.34e-04 - 2.000000 0.889050 1.705393 8.52e-04 2.73e-04 - 2.100000 0.863821 1.691792 8.05e-04 3.11e-04 - 2.200000 0.839347 1.675510 7.42e-04 3.47e-04 - 2.300000 0.815954 1.656637 6.62e-04 3.80e-04 - 2.400000 0.793979 1.635273 5.67e-04 4.12e-04 - 2.500000 0.773771 1.611538 4.56e-04 4.40e-04 - 2.600000 0.755681 1.585570 3.32e-04 4.64e-04 - 2.700000 0.740050 1.557522 1.96e-04 4.83e-04 - 2.800000 0.727196 1.527569 5.13e-05 4.97e-04 - 2.900000 0.717399 1.495906 9.79e-05 5.06e-04 - 3.000000 0.710883 1.462748 2.47e-04 5.09e-04 - 3.100000 0.707805 1.428334 3.92e-04 5.05e-04 - 3.200000 0.708238 1.392928 5.29e-04 4.94e-04 - 3.300000 0.712172 1.356819 6.53e-04 4.77e-04 - 3.400000 0.719510 1.320326 7.61e-04 4.53e-04 - 3.500000 0.730078 1.283796 8.52e-04 4.22e-04 - 3.600000 0.743635 1.247605 9.23e-04 3.85e-04 - 3.700000 0.759889 1.212162 9.76e-04 3.41e-04 - 3.800000 0.778515 1.177904 1.01e-03 2.91e-04 - 3.900000 0.799168 1.145293 1.02e-03 2.35e-04 - 4.000000 0.821496 1.114814 1.02e-03 1.74e-04 - 4.100000 0.845154 1.086962 1.00e-03 1.09e-04 - 4.200000 0.869806 1.062233 9.73e-04 4.04e-05 - 4.300000 0.895134 1.041103 9.30e-04 2.90e-05 - 4.400000 0.920842 1.024011 8.78e-04 9.80e-05 - 4.500000 0.946652 1.011337 8.18e-04 1.65e-04 - 4.600000 0.972311 1.003376 7.54e-04 2.27e-04 - 4.700000 0.997584 1.000322 6.86e-04 2.83e-04 - 4.800000 1.022259 1.002248 6.18e-04 3.32e-04 - 4.900000 1.046139 1.009108 5.50e-04 3.73e-04 - 5.000000 1.069050 1.020736 4.85e-04 4.05e-04 - 5.100000 1.090829 1.036858 4.21e-04 4.29e-04 - 5.200000 1.111333 1.057112 3.61e-04 4.45e-04 - 5.300000 1.130431 1.081071 3.04e-04 4.54e-04 - 5.400000 1.148006 1.108264 2.49e-04 4.57e-04 - 5.500000 1.163956 1.138199 1.97e-04 4.56e-04 - 5.600000 1.178189 1.170379 1.47e-04 4.50e-04 - 5.700000 1.190627 1.204316 9.87e-05 4.41e-04 - 5.800000 1.201201 1.239542 5.14e-05 4.30e-04 - 5.900000 1.209856 1.275612 4.71e-06 4.16e-04 - 6.000000 1.216546 1.312111 4.19e-05 4.01e-04 - 6.100000 1.221236 1.348656 8.88e-05 3.84e-04 - 6.200000 1.223902 1.384891 1.36e-04 3.66e-04 - 6.300000 1.224531 1.420493 1.85e-04 3.47e-04 - 6.400000 1.223118 1.455163 2.35e-04 3.27e-04 - 6.500000 1.219671 1.488633 2.85e-04 3.06e-04 - 6.600000 1.214206 1.520659 3.37e-04 2.83e-04 - 6.700000 1.206751 1.551018 3.90e-04 2.60e-04 - 6.800000 1.197345 1.579511 4.44e-04 2.35e-04 - 6.900000 1.186035 1.605962 4.99e-04 2.09e-04 - 7.000000 1.172883 1.630209 5.53e-04 1.82e-04 + -2.900000 0.717301 1.326933 4.07e-08 3.12e-09 + -2.800000 0.727247 1.290353 3.42e-08 2.79e-09 + -2.700000 0.740246 1.254042 2.54e-08 2.29e-09 + -2.600000 0.756013 1.218400 1.63e-08 1.73e-09 + -2.500000 0.774227 1.183861 8.20e-09 1.12e-09 + -2.400000 0.794546 1.150885 1.46e-09 4.54e-10 + -2.300000 0.816616 1.119953 3.85e-09 2.91e-10 + -2.200000 0.840089 1.091560 7.86e-09 1.15e-09 + -2.100000 0.864625 1.066204 1.08e-08 2.15e-09 + -2.000000 0.889903 1.044367 1.29e-08 3.28e-09 + -1.900000 0.915617 1.026499 1.44e-08 4.47e-09 + -1.800000 0.941488 1.012992 1.53e-08 5.61e-09 + -1.700000 0.967253 1.004159 1.58e-08 6.53e-09 + -1.600000 0.992673 1.000213 1.58e-08 7.07e-09 + -1.500000 1.017531 1.001252 1.55e-08 7.11e-09 + -1.400000 1.041625 1.007249 1.48e-08 6.62e-09 + -1.300000 1.064777 1.018058 1.40e-08 5.67e-09 + -1.200000 1.086821 1.033422 1.30e-08 4.42e-09 + -1.100000 1.107609 1.052992 1.21e-08 3.06e-09 + -1.000000 1.127010 1.076350 1.13e-08 1.77e-09 + -0.900000 1.144904 1.103029 1.06e-08 6.58e-10 + -0.800000 1.161186 1.132539 1.00e-08 2.11e-10 + -0.700000 1.175764 1.164381 9.60e-09 8.29e-10 + -0.600000 1.188557 1.198064 9.28e-09 1.22e-09 + -0.500000 1.199496 1.233116 9.06e-09 1.44e-09 + -0.400000 1.208524 1.269087 8.91e-09 1.52e-09 + -0.300000 1.215594 1.305557 8.81e-09 1.51e-09 + -0.200000 1.220669 1.342137 8.75e-09 1.43e-09 + -0.100000 1.223725 1.378465 8.72e-09 1.33e-09 + 0.000000 1.224745 1.414214 8.70e-09 1.21e-09 + 0.100000 1.223725 1.449080 8.70e-09 1.09e-09 + 0.200000 1.220669 1.482791 8.71e-09 9.72e-10 + 0.300000 1.215594 1.515097 8.74e-09 8.62e-10 + 0.400000 1.208524 1.545774 8.78e-09 7.62e-10 + 0.500000 1.199496 1.574619 8.83e-09 6.73e-10 + 0.600000 1.188557 1.601450 8.91e-09 5.94e-10 + 0.700000 1.175764 1.626105 9.01e-09 5.23e-10 + 0.800000 1.161186 1.648441 9.14e-09 4.60e-10 + 0.900000 1.144904 1.668331 9.30e-09 4.04e-10 + 1.000000 1.127010 1.685666 9.50e-09 3.53e-10 + 1.100000 1.107609 1.700355 9.75e-09 3.06e-10 + 1.200000 1.086821 1.712320 1.00e-08 2.63e-10 + 1.300000 1.064777 1.721499 1.04e-08 2.23e-10 + 1.400000 1.041625 1.727845 1.07e-08 1.85e-10 + 1.500000 1.017531 1.731328 1.11e-08 1.52e-10 + 1.600000 0.992673 1.731928 1.14e-08 1.24e-10 + 1.700000 0.967253 1.729643 1.16e-08 1.06e-10 + 1.800000 0.941488 1.724485 1.16e-08 1.01e-10 + 1.900000 0.915617 1.716479 1.13e-08 1.16e-10 + 2.000000 0.889903 1.705666 1.05e-08 1.63e-10 + 2.100000 0.864625 1.692102 8.92e-09 2.52e-10 + 2.200000 0.840089 1.675857 6.33e-09 3.98e-10 + 2.300000 0.816616 1.657017 2.42e-09 6.17e-10 + 2.400000 0.794546 1.635684 3.04e-09 9.19e-10 + 2.500000 0.774227 1.611978 1.02e-08 1.31e-09 + 2.600000 0.756013 1.586033 1.88e-08 1.79e-09 + 2.700000 0.740246 1.558005 2.85e-08 2.31e-09 + 2.800000 0.727247 1.528067 3.83e-08 2.85e-09 + 2.900000 0.717301 1.496412 4.71e-08 3.33e-09 + 3.000000 0.710636 1.463257 5.36e-08 3.70e-09 + 3.100000 0.707413 1.428839 5.66e-08 3.88e-09 + 3.200000 0.707709 1.393422 5.57e-08 3.86e-09 + 3.300000 0.711520 1.357297 5.10e-08 3.64e-09 + 3.400000 0.718750 1.320780 4.34e-08 3.27e-09 + 3.500000 0.729227 1.284218 3.41e-08 2.78e-09 + 3.600000 0.742712 1.247990 2.43e-08 2.23e-09 + 3.700000 0.758914 1.212503 1.50e-08 1.64e-09 + 3.800000 0.777506 1.178194 7.03e-09 1.01e-09 + 3.900000 0.798144 1.145528 4.85e-10 3.38e-10 + 4.000000 0.820474 1.114988 4.60e-09 4.26e-10 + 4.100000 0.844149 1.087071 8.42e-09 1.31e-09 + 4.200000 0.868832 1.062273 1.12e-08 2.33e-09 + 4.300000 0.894204 1.041074 1.32e-08 3.48e-09 + 4.400000 0.919964 1.023913 1.46e-08 4.67e-09 + 4.500000 0.945834 1.011173 1.54e-08 5.78e-09 + 4.600000 0.971557 1.003150 1.58e-08 6.65e-09 + 4.700000 0.996898 1.000038 1.58e-08 7.12e-09 + 4.800000 1.021641 1.001916 1.54e-08 7.06e-09 + 4.900000 1.045589 1.008736 1.47e-08 6.49e-09 + 5.000000 1.068565 1.020331 1.38e-08 5.47e-09 + 5.100000 1.090408 1.036429 1.29e-08 4.19e-09 + 5.200000 1.110972 1.056667 1.20e-08 2.84e-09 + 5.300000 1.130127 1.080617 1.12e-08 1.57e-09 + 5.400000 1.147757 1.107807 1.05e-08 4.94e-10 + 5.500000 1.163759 1.137743 9.95e-09 3.32e-10 + 5.600000 1.178042 1.169929 9.54e-09 9.10e-10 + 5.700000 1.190528 1.203875 9.24e-09 1.27e-09 + 5.800000 1.201149 1.239112 9.03e-09 1.46e-09 + 5.900000 1.209851 1.275195 8.89e-09 1.52e-09 + 6.000000 1.216587 1.311711 8.80e-09 1.50e-09 + 6.100000 1.221325 1.348272 8.75e-09 1.42e-09 + 6.200000 1.224039 1.384525 8.72e-09 1.31e-09 + 6.300000 1.224716 1.420146 8.70e-09 1.19e-09 + 6.400000 1.223353 1.454836 8.70e-09 1.07e-09 + 6.500000 1.219956 1.488328 8.72e-09 9.53e-10 + 6.600000 1.214544 1.520375 8.74e-09 8.44e-10 + 6.700000 1.207142 1.550758 8.78e-09 7.47e-10 + 6.800000 1.197789 1.579276 8.84e-09 6.59e-10 + 6.900000 1.186534 1.605752 8.92e-09 5.81e-10 + 7.000000 1.173436 1.630027 9.03e-09 5.12e-10 ------------------------------------------------------ Final Solver Statistics: Internal solver steps = 103 (attempted = 103) Total number of error test failures = 0 Total RHS evals: Fe = 1742, Fi = 0 - Total mass matrix setups = 1539 - Total mass matrix solves = 1845 + Total mass matrix setups = 1439 + Total mass matrix solves = 1742 Total mass times evals = 103 - Errors: u = 0.000634856, v = 0.000337591, total = 0.000508434 + Errors: u = 1.83418e-08, v = 2.86413e-09, total = 1.31268e-08 diff --git a/examples/arkode/CXX_serial/ark_pendulum.cpp b/examples/arkode/CXX_serial/ark_pendulum.cpp index d56ee752b8..a0a0cf3090 100644 --- a/examples/arkode/CXX_serial/ark_pendulum.cpp +++ b/examples/arkode/CXX_serial/ark_pendulum.cpp @@ -209,6 +209,9 @@ int main(int argc, char* argv[]) if (check_flag(flag, "ARKStepSetFixedStep")) return 1; } + flag = ARKStepSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); + if (check_flag(flag, "ARKStepSetNonlinConvCoef")) return 1; + /* --------------- * * Advance in Time * * --------------- */ diff --git a/examples/arkode/CXX_serial/ark_pendulum.out b/examples/arkode/CXX_serial/ark_pendulum.out index dca1a58ccb..94c4259cfd 100644 --- a/examples/arkode/CXX_serial/ark_pendulum.out +++ b/examples/arkode/CXX_serial/ark_pendulum.out @@ -7,29 +7,29 @@ Nonlinear Pendulum problem: step t u v e e err --------------------------------------------------------------------------------------------------------------------------- 0 0.000000000000000e+00 1.500000000000000e+00 1.000000000000000e+00 5.846976941318602e-01 0.000000000000000e+00 - 1000 1.226511879534299e+00 3.458488320982976e-01 2.123384535074106e+00 5.846976941318555e-01 -4.773959005888173e-15 - 2000 2.398784336118560e+00 -6.416442371616857e-01 1.959343228667432e+00 5.846976941318377e-01 -2.253752739989068e-14 - 3000 3.618483293504332e+00 -1.718124366999066e+00 4.706406225355917e-01 5.846976941318435e-01 -1.676436767183986e-14 - 4000 4.580865391430372e+00 -1.411700239944070e+00 -1.146421559917496e+00 5.846976941318369e-01 -2.331468351712829e-14 - 5000 5.877850661141863e+00 -2.026377125271683e-01 -2.170219947005763e+00 5.846976941318408e-01 -1.942890293094024e-14 - 6000 7.079795692175875e+00 8.320973704310155e-01 -1.811622127832077e+00 5.846976941318234e-01 -3.685940441755520e-14 - 7000 8.313428698722841e+00 1.777791699609239e+00 -9.412012907795819e-02 5.846976941318288e-01 -3.141931159689193e-14 - 8000 9.289846347799413e+00 1.192220279192671e+00 1.444463648145965e+00 5.846976941318289e-01 -3.130828929442941e-14 + 1000 1.225851562364904e+00 3.464109129286753e-01 2.123155979647627e+00 5.846976941318590e-01 -1.221245327087672e-15 + 2000 2.418923205034655e+00 -6.603311992497419e-01 1.946233242793910e+00 5.846976941317269e-01 -1.333377852574813e-13 + 3000 3.660149066899992e+00 -1.735668411457896e+00 3.986787133040775e-01 5.846976941317225e-01 -1.377786773559819e-13 + 4000 4.623294832907320e+00 -1.372538839057398e+00 -1.205491805789652e+00 5.846976941317235e-01 -1.367794766338193e-13 + 5000 5.934005658137125e+00 -1.564401075076330e-01 -2.180300444219520e+00 5.846976941317296e-01 -1.306732499983809e-13 + 6000 7.123567932980419e+00 8.747899699484564e-01 -1.774266316025390e+00 5.846976941316223e-01 -2.379207941771710e-13 + 7000 8.350624078669346e+00 1.780060261145096e+00 -2.794469129917746e-02 5.846976941316284e-01 -2.318145675417327e-13 + 8000 9.285790680382140e+00 1.196242389800009e+00 1.439620221946003e+00 5.846976941316235e-01 -2.366995488500834e-13 --------------------------------------------------------------------------------------------------------------------------- Final Solver Statistics: - Internal solver steps = 8518 (attempted = 8528) + Internal solver steps = 8552 (attempted = 8562) Total number of error test failures = 10 - Total RHS evals: Fe = 0, Fi = 50909 - Total number of Newton iterations = 25332 - Total number of linear solver convergence failures = 5 - Total linear solver setups = 459 - Total number of Jacobian evaluations = 146 + Total RHS evals: Fe = 0, Fi = 52696 + Total number of Newton iterations = 27018 + Total number of linear solver convergence failures = 11 + Total linear solver setups = 471 + Total number of Jacobian evaluations = 150 Total RHS evals for setting up the linear system = 0 - Total Relaxation Fn evals = 25494 - Total Relaxation Jac evals = 25494 + Total Relaxation Fn evals = 25424 + Total Relaxation Jac evals = 25424 Total Relaxation fails = 0 Total Relaxation bound fails = 0 Total Relaxation NLS fails = 0 - Total Relaxation NLS iters = 8438 + Total Relaxation NLS iters = 8300 diff --git a/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.out b/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.out index 1cf56e4da4..61563dca16 100644 --- a/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.out +++ b/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.out @@ -12,68 +12,68 @@ 0.300000 0.648532 3.334867 1.999989 0.400000 0.654362 3.323350 1.999989 0.500000 0.660542 3.311172 1.999988 - 0.600000 0.667093 3.298310 1.999988 - 0.700000 0.674031 3.284739 1.999988 + 0.600000 0.667093 3.298309 1.999988 + 0.700000 0.674031 3.284739 1.999989 0.800000 0.681370 3.270442 1.999988 0.900000 0.689121 3.255404 1.999988 - 1.000000 0.697285 3.239620 1.999988 - 1.100000 0.705854 3.223093 1.999987 + 1.000000 0.697284 3.239620 1.999988 + 1.100000 0.705853 3.223093 1.999987 1.200000 0.714805 3.205842 1.999987 - 1.300000 0.724099 3.187902 1.999987 - 1.400000 0.733671 3.169332 1.999987 - 1.500000 0.743429 3.150211 1.999987 - 1.600000 0.753249 3.130653 1.999987 - 1.700000 0.762974 3.110800 1.999986 - 1.800000 0.772412 3.090827 1.999986 - 1.900000 0.781337 3.070944 1.999986 - 2.000000 0.789501 3.051388 1.999986 - 2.100000 0.796639 3.032420 1.999986 - 2.200000 0.802490 3.014317 1.999986 - 2.300000 0.806810 2.997358 1.999986 - 2.400000 0.809386 2.981818 1.999986 - 2.500000 0.810060 2.967949 1.999986 - 2.600000 0.808729 2.955977 1.999986 - 2.700000 0.805360 2.946085 1.999986 - 2.800000 0.799989 2.938410 1.999986 - 2.900000 0.792711 2.933039 1.999986 - 3.000000 0.783680 2.930010 1.999986 - 3.100000 0.773095 2.929307 1.999986 - 3.200000 0.761187 2.930873 1.999986 - 3.300000 0.748207 2.934612 1.999987 - 3.400000 0.734416 2.940393 1.999987 - 3.500000 0.720073 2.948062 1.999987 + 1.300000 0.724098 3.187903 1.999987 + 1.400000 0.733670 3.169332 1.999987 + 1.500000 0.743428 3.150212 1.999987 + 1.600000 0.753248 3.130655 1.999987 + 1.700000 0.762974 3.110801 1.999986 + 1.800000 0.772411 3.090829 1.999986 + 1.900000 0.781336 3.070946 1.999986 + 2.000000 0.789499 3.051390 1.999986 + 2.100000 0.796638 3.032422 1.999986 + 2.200000 0.802489 3.014319 1.999986 + 2.300000 0.806808 2.997360 1.999986 + 2.400000 0.809386 2.981819 1.999986 + 2.500000 0.810059 2.967951 1.999986 + 2.600000 0.808728 2.955979 1.999986 + 2.700000 0.805361 2.946086 1.999986 + 2.800000 0.799988 2.938411 1.999986 + 2.900000 0.792711 2.933041 1.999986 + 3.000000 0.783681 2.930010 1.999986 + 3.100000 0.773096 2.929307 1.999986 + 3.200000 0.761187 2.930874 1.999986 + 3.300000 0.748207 2.934613 1.999987 + 3.400000 0.734416 2.940394 1.999987 + 3.500000 0.720074 2.948062 1.999987 3.600000 0.705429 2.957444 1.999987 - 3.700000 0.690714 2.968354 1.999988 + 3.700000 0.690715 2.968354 1.999988 3.800000 0.676141 2.980600 1.999988 - 3.900000 0.661891 2.993989 1.999988 - 4.000000 0.648122 3.008331 1.999989 - 4.100000 0.634961 3.023445 1.999989 + 3.900000 0.661892 2.993989 1.999988 + 4.000000 0.648123 3.008331 1.999989 + 4.100000 0.634962 3.023445 1.999989 4.200000 0.622506 3.039157 1.999989 4.300000 0.610828 3.055308 1.999989 - 4.400000 0.599972 3.071752 1.999989 + 4.400000 0.599972 3.071751 1.999989 4.500000 0.589962 3.088356 1.999990 4.600000 0.580801 3.105007 1.999990 - 4.700000 0.572477 3.121603 1.999990 - 4.800000 0.564964 3.138059 1.999990 + 4.700000 0.572477 3.121602 1.999990 + 4.800000 0.564964 3.138058 1.999990 4.900000 0.558227 3.154303 1.999990 - 5.000000 0.552224 3.170278 1.999990 + 5.000000 0.552224 3.170277 1.999990 5.100000 0.546907 3.185935 1.999991 - 5.200000 0.542228 3.201239 1.999991 - 5.300000 0.538137 3.216162 1.999991 - 5.400000 0.534585 3.230683 1.999991 + 5.200000 0.542229 3.201239 1.999991 + 5.300000 0.538138 3.216162 1.999991 + 5.400000 0.534586 3.230682 1.999991 5.500000 0.531525 3.244788 1.999991 - 5.600000 0.528910 3.258469 1.999991 - 5.700000 0.526699 3.271720 1.999991 + 5.600000 0.528910 3.258468 1.999991 + 5.700000 0.526699 3.271719 1.999991 5.800000 0.524852 3.284539 1.999991 5.900000 0.523334 3.296928 1.999991 - 6.000000 0.522111 3.308889 1.999991 - 6.100000 0.521154 3.320427 1.999991 + 6.000000 0.522112 3.308889 1.999991 + 6.100000 0.521154 3.320426 1.999991 6.200000 0.520436 3.331545 1.999991 - 6.300000 0.519932 3.342251 1.999991 + 6.300000 0.519932 3.342250 1.999991 6.400000 0.519621 3.352549 1.999991 - 6.500000 0.519484 3.362447 1.999991 - 6.600000 0.519503 3.371950 1.999991 - 6.700000 0.519664 3.381065 1.999991 + 6.500000 0.519484 3.362446 1.999991 + 6.600000 0.519503 3.371949 1.999991 + 6.700000 0.519664 3.381064 1.999991 6.800000 0.519953 3.389797 1.999991 6.900000 0.520358 3.398153 1.999991 7.000000 0.520869 3.406139 1.999991 @@ -86,37 +86,37 @@ 7.700000 0.526775 3.452091 1.999991 7.800000 0.527887 3.457288 1.999991 7.900000 0.529055 3.462154 1.999991 - 8.000000 0.530276 3.466693 1.999991 - 8.100000 0.531549 3.470907 1.999991 + 8.000000 0.530276 3.466692 1.999991 + 8.100000 0.531549 3.470906 1.999991 8.200000 0.532872 3.474798 1.999991 8.300000 0.534244 3.478370 1.999991 8.400000 0.535665 3.481625 1.999991 - 8.500000 0.537133 3.484563 1.999991 + 8.500000 0.537133 3.484564 1.999991 8.600000 0.538649 3.487188 1.999991 8.700000 0.540213 3.489499 1.999991 - 8.800000 0.541825 3.491497 1.999991 - 8.900000 0.543486 3.493184 1.999991 + 8.800000 0.541825 3.491498 1.999991 + 8.900000 0.543486 3.493185 1.999991 9.000000 0.545196 3.494560 1.999991 9.100000 0.546957 3.495624 1.999991 9.200000 0.548771 3.496375 1.999991 9.300000 0.550638 3.496814 1.999990 - 9.400000 0.552562 3.496938 1.999990 + 9.400000 0.552561 3.496938 1.999990 9.500000 0.554543 3.496746 1.999990 - 9.600000 0.556585 3.496235 1.999990 + 9.600000 0.556585 3.496236 1.999990 9.700000 0.558691 3.495404 1.999990 - 9.800000 0.560864 3.494247 1.999990 + 9.800000 0.560864 3.494248 1.999990 9.900000 0.563108 3.492763 1.999990 10.000000 0.565426 3.490945 1.999990 ---------------------------------------------- Final Solver Statistics: Internal solver steps = 95 (attempted = 95) - Total RHS evals: Fe = 0, Fi = 1605 + Total RHS evals: Fe = 0, Fi = 1596 Total mass matrix setups = 1 - Total mass matrix solves = 288 - Total mass times evals = 1697 + Total mass matrix solves = 193 + Total mass times evals = 1688 Total linear solver setups = 31 Total number of Jacobian evaluations = 11 - Total number of Newton iterations = 1127 + Total number of Newton iterations = 1118 Total number of nonlinear solver convergence failures = 10 Total number of error test failures = 0 diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid_--np_2_1_2_--x_print_level_0.out b/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid_--np_2_1_2_--x_print_level_0.out index bd7bba7149..978c7d9928 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid_--np_2_1_2_--x_print_level_0.out +++ b/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid_--np_2_1_2_--x_print_level_0.out @@ -45,13 +45,13 @@ output = 1 --------------------------------- - Max error = 3.297223456216303e-03 + Max error = 3.297223495382084e-03 Final max integrator statistics: Steps = 1780 Step attempts = 1780 Error test fails = 450 - RHS evals = 14240 + RHS evals = 12460 NLS iters = 5340 NLS fails = 0 LS iters = 30510 diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid_--np_2_1_2_--x_print_level_0.out b/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid_--np_2_1_2_--x_print_level_0.out index 4e2d372699..744747849a 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid_--np_2_1_2_--x_print_level_0.out +++ b/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid_--np_2_1_2_--x_print_level_0.out @@ -42,24 +42,24 @@ output = 1 --------------------------------- - Max error = 3.297223517807257e-03 + Max error = 3.297223330406052e-03 Final max integrator statistics: Steps = 1780 Step attempts = 1780 Error test fails = 450 - RHS evals = 14240 + RHS evals = 12460 NLS iters = 5340 NLS fails = 0 - LS iters = 189634 + LS iters = 188622 LS fails = 0 LS setups = 1780 - LS RHS evals = 189634 - Jv products = 189634 + LS RHS evals = 188622 + Jv products = 188622 Avg NLS iters per step attempt = 3.000000 - Avg LS iters per NLS iter = 35.511985 + Avg LS iters per NLS iter = 35.322472 Preconditioner setups = 1780 - Preconditioner solves = 189634 + Preconditioner solves = 188622 diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid_--x_print_level_0.out b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid_--x_print_level_0.out index f9de301b00..90b4dedf7a 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid_--x_print_level_0.out +++ b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid_--x_print_level_0.out @@ -37,24 +37,24 @@ output = 1 --------------------------------- - Max error = 3.297223770518998e-03 + Max error = 3.297223425028251e-03 Final max integrator statistics: Steps = 895 Step attempts = 895 Error test fails = 324 - RHS evals = 7160 + RHS evals = 6265 NLS iters = 2685 NLS fails = 0 - LS iters = 98385 + LS iters = 97779 LS fails = 0 LS setups = 895 - LS RHS evals = 98385 - Jv products = 98385 + LS RHS evals = 97779 + Jv products = 97779 Avg NLS iters per step attempt = 3.000000 - Avg LS iters per NLS iter = 36.642458 + Avg LS iters per NLS iter = 36.416760 Preconditioner setups = 895 - Preconditioner solves = 98385 + Preconditioner solves = 97779 diff --git a/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.out b/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.out index ab197185fe..6366fd534c 100644 --- a/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.out +++ b/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.out @@ -32,7 +32,7 @@ 2.300000 1.178983 2.282911 1.999977 2.400000 1.156873 2.248486 1.999978 2.500000 1.128176 2.220852 1.999978 - 2.600000 1.094311 2.199774 1.999979 + 2.600000 1.094311 2.199774 1.999978 2.700000 1.056614 2.184957 1.999979 2.800000 1.016284 2.176069 1.999980 2.900000 0.974366 2.172745 1.999981 @@ -64,7 +64,7 @@ 5.500000 0.354771 2.869085 1.999993 5.600000 0.349641 2.900573 1.999993 5.700000 0.345224 2.931786 1.999993 - 5.800000 0.341455 2.962716 1.999994 + 5.800000 0.341455 2.962716 1.999993 5.900000 0.338270 2.993362 1.999994 6.000000 0.335614 3.023721 1.999994 6.100000 0.333434 3.053792 1.999994 @@ -82,9 +82,9 @@ 7.300000 0.331130 3.392178 1.999994 7.400000 0.332202 3.418486 1.999994 7.500000 0.333401 3.444494 1.999994 - 7.600000 0.334721 3.470197 1.999994 - 7.700000 0.336154 3.495592 1.999994 - 7.800000 0.337695 3.520673 1.999994 + 7.600000 0.334721 3.470197 1.999993 + 7.700000 0.336154 3.495592 1.999993 + 7.800000 0.337695 3.520673 1.999993 7.900000 0.339341 3.545436 1.999993 8.000000 0.341088 3.569873 1.999993 8.100000 0.342934 3.593980 1.999993 @@ -100,18 +100,18 @@ 9.100000 0.366830 3.814901 1.999993 9.200000 0.369812 3.834729 1.999993 9.300000 0.372919 3.854085 1.999993 - 9.400000 0.376159 3.872952 1.999993 - 9.500000 0.379540 3.891308 1.999993 - 9.600000 0.383069 3.909132 1.999993 + 9.400000 0.376159 3.872952 1.999992 + 9.500000 0.379540 3.891308 1.999992 + 9.600000 0.383069 3.909132 1.999992 9.700000 0.386758 3.926398 1.999992 - 9.800000 0.390617 3.943079 1.999992 - 9.900000 0.394659 3.959146 1.999992 - 10.000000 0.398900 3.974566 1.999992 + 9.800000 0.390617 3.943079 1.999993 + 9.900000 0.394659 3.959146 1.999993 + 10.000000 0.398900 3.974566 1.999993 ---------------------------------------------- Final Solver Statistics: Internal solver steps = 395 (attempted = 422) - Total RHS evals: Fe = 2535, Fi = 7165 + Total RHS evals: Fe = 2508, Fi = 7138 Total linear solver setups = 0 Total linear iterations = 15143 Total linear convergence failures = 0 diff --git a/examples/arkode/C_openmp/ark_brusselator1D_omp.out b/examples/arkode/C_openmp/ark_brusselator1D_omp.out index 1c209cc20f..9d254eaac0 100644 --- a/examples/arkode/C_openmp/ark_brusselator1D_omp.out +++ b/examples/arkode/C_openmp/ark_brusselator1D_omp.out @@ -9,102 +9,102 @@ t ||u||_rms ||v||_rms ||w||_rms ---------------------------------------------- 0.100000 0.673914 3.377329 1.999987 - 0.200000 0.684316 3.356619 1.999987 + 0.200000 0.684316 3.356619 1.999986 0.300000 0.695306 3.334633 1.999986 0.400000 0.706918 3.311313 1.999986 0.500000 0.719185 3.286601 1.999986 0.600000 0.732137 3.260442 1.999986 0.700000 0.745798 3.232787 1.999985 0.800000 0.760185 3.203596 1.999985 - 0.900000 0.775303 3.172839 1.999985 + 0.900000 0.775302 3.172839 1.999985 1.000000 0.791135 3.140510 1.999984 1.100000 0.807648 3.106624 1.999984 1.200000 0.824771 3.071233 1.999984 1.300000 0.842402 3.034426 1.999983 1.400000 0.860384 2.996350 1.999983 - 1.500000 0.878514 2.957206 1.999983 + 1.500000 0.878514 2.957207 1.999983 1.600000 0.896525 2.917266 1.999982 1.700000 0.914089 2.876873 1.999982 1.800000 0.930823 2.836438 1.999982 1.900000 0.946292 2.796446 1.999982 - 2.000000 0.960033 2.757430 1.999981 - 2.100000 0.971576 2.719962 1.999981 - 2.200000 0.980475 2.684623 1.999981 + 2.000000 0.960034 2.757430 1.999981 + 2.100000 0.971577 2.719961 1.999981 + 2.200000 0.980476 2.684622 1.999981 2.300000 0.986338 2.651980 1.999981 - 2.400000 0.988852 2.622560 1.999981 - 2.500000 0.987815 2.596818 1.999981 - 2.600000 0.983141 2.575128 1.999981 - 2.700000 0.974858 2.557766 1.999981 - 2.800000 0.963114 2.544903 1.999981 - 2.900000 0.948154 2.536611 1.999981 - 3.000000 0.930299 2.532868 1.999982 - 3.100000 0.909930 2.533567 1.999982 - 3.200000 0.887464 2.538529 1.999983 - 3.300000 0.863335 2.547515 1.999983 - 3.400000 0.837978 2.560241 1.999983 + 2.400000 0.988853 2.622559 1.999981 + 2.500000 0.987816 2.596818 1.999981 + 2.600000 0.983141 2.575127 1.999981 + 2.700000 0.974859 2.557765 1.999981 + 2.800000 0.963115 2.544902 1.999981 + 2.900000 0.948155 2.536610 1.999981 + 3.000000 0.930300 2.532867 1.999982 + 3.100000 0.909931 2.533566 1.999982 + 3.200000 0.887464 2.538528 1.999983 + 3.300000 0.863335 2.547514 1.999983 + 3.400000 0.837978 2.560240 1.999983 3.500000 0.811818 2.576391 1.999984 3.600000 0.785255 2.595624 1.999984 - 3.700000 0.758659 2.617587 1.999985 - 3.800000 0.732363 2.641922 1.999986 + 3.700000 0.758658 2.617586 1.999985 + 3.800000 0.732363 2.641921 1.999986 3.900000 0.706662 2.668274 1.999986 4.000000 0.681809 2.696300 1.999986 - 4.100000 0.658012 2.725670 1.999987 + 4.100000 0.658011 2.725670 1.999987 4.200000 0.635435 2.756075 1.999987 - 4.300000 0.614205 2.787228 1.999988 + 4.300000 0.614204 2.787228 1.999988 4.400000 0.594404 2.818869 1.999988 4.500000 0.576082 2.850764 1.999989 - 4.600000 0.559255 2.882710 1.999989 + 4.600000 0.559254 2.882710 1.999989 4.700000 0.543909 2.914529 1.999989 4.800000 0.530011 2.946071 1.999990 - 4.900000 0.517506 2.977209 1.999990 + 4.900000 0.517506 2.977210 1.999990 5.000000 0.506326 3.007843 1.999990 - 5.100000 0.496394 3.037889 1.999990 - 5.200000 0.487626 3.067283 1.999990 + 5.100000 0.496393 3.037889 1.999990 + 5.200000 0.487625 3.067283 1.999990 5.300000 0.479935 3.095976 1.999991 5.400000 0.473237 3.123932 1.999991 - 5.500000 0.467445 3.151125 1.999991 + 5.500000 0.467445 3.151126 1.999991 5.600000 0.462480 3.177540 1.999991 5.700000 0.458264 3.203165 1.999991 5.800000 0.454726 3.227997 1.999991 - 5.900000 0.451800 3.252035 1.999991 + 5.900000 0.451799 3.252035 1.999991 6.000000 0.449425 3.275283 1.999991 - 6.100000 0.447546 3.297744 1.999991 + 6.100000 0.447546 3.297745 1.999991 6.200000 0.446115 3.319428 1.999991 - 6.300000 0.445086 3.340340 1.999991 - 6.400000 0.444419 3.360491 1.999991 - 6.500000 0.444079 3.379890 1.999991 + 6.300000 0.445085 3.340341 1.999991 + 6.400000 0.444419 3.360492 1.999991 + 6.500000 0.444079 3.379891 1.999991 6.600000 0.444034 3.398547 1.999991 6.700000 0.444257 3.416470 1.999991 6.800000 0.444722 3.433669 1.999991 6.900000 0.445409 3.450154 1.999991 - 7.000000 0.446297 3.465934 1.999991 + 7.000000 0.446297 3.465935 1.999991 7.100000 0.447370 3.481018 1.999991 - 7.200000 0.448614 3.495414 1.999991 + 7.200000 0.448614 3.495415 1.999991 7.300000 0.450016 3.509131 1.999991 7.400000 0.451564 3.522176 1.999991 7.500000 0.453249 3.534557 1.999991 7.600000 0.455064 3.546280 1.999991 7.700000 0.457000 3.557353 1.999991 7.800000 0.459052 3.567781 1.999991 - 7.900000 0.461216 3.577571 1.999991 - 8.000000 0.463486 3.586728 1.999991 + 7.900000 0.461215 3.577572 1.999991 + 8.000000 0.463486 3.586729 1.999991 8.100000 0.465860 3.595257 1.999991 8.200000 0.468335 3.603162 1.999991 8.300000 0.470909 3.610447 1.999991 8.400000 0.473582 3.617116 1.999991 - 8.500000 0.476352 3.623171 1.999991 + 8.500000 0.476352 3.623172 1.999991 8.600000 0.479220 3.628616 1.999991 8.700000 0.482186 3.633451 1.999991 8.800000 0.485250 3.637679 1.999990 8.900000 0.488416 3.641299 1.999990 - 9.000000 0.491684 3.644311 1.999990 - 9.100000 0.495058 3.646715 1.999990 - 9.200000 0.498540 3.648509 1.999990 - 9.300000 0.502134 3.649691 1.999990 - 9.400000 0.505844 3.650257 1.999990 - 9.500000 0.509675 3.650202 1.999990 - 9.600000 0.513632 3.649521 1.999990 - 9.700000 0.517722 3.648209 1.999990 + 9.000000 0.491684 3.644312 1.999990 + 9.100000 0.495058 3.646716 1.999990 + 9.200000 0.498539 3.648510 1.999990 + 9.300000 0.502133 3.649691 1.999990 + 9.400000 0.505843 3.650257 1.999990 + 9.500000 0.509674 3.650202 1.999990 + 9.600000 0.513632 3.649522 1.999990 + 9.700000 0.517722 3.648210 1.999990 9.800000 0.521951 3.646257 1.999990 9.900000 0.526326 3.643656 1.999990 10.000000 0.530857 3.640396 1.999990 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_bbd_p.out b/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.out index 5d53186f79..280069d4a3 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.out +++ b/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.out @@ -7,53 +7,53 @@ Preconditioner type is: jpre = SUN_PREC_LEFT -t = 7.20e+03 no. steps = 979 stepsize = 3.07e+00 +t = 7.20e+03 no. steps = 980 stepsize = 3.07e+00 At bottom left: c1, c2 = 1.047e+04 2.527e+11 At top right: c1, c2 = 1.119e+04 2.700e+11 -t = 1.44e+04 no. steps = 2738 stepsize = 6.94e+00 +t = 1.44e+04 no. steps = 2730 stepsize = 6.90e+00 At bottom left: c1, c2 = 6.659e+06 2.582e+11 At top right: c1, c2 = 7.301e+06 2.833e+11 -t = 2.16e+04 no. steps = 3535 stepsize = 1.05e+01 +t = 2.16e+04 no. steps = 3533 stepsize = 1.04e+01 At bottom left: c1, c2 = 2.665e+07 2.993e+11 At top right: c1, c2 = 2.931e+07 3.313e+11 -t = 2.88e+04 no. steps = 4683 stepsize = 4.46e+00 +t = 2.88e+04 no. steps = 4681 stepsize = 4.32e+00 At bottom left: c1, c2 = 8.702e+06 3.380e+11 At top right: c1, c2 = 9.650e+06 3.751e+11 -t = 3.60e+04 no. steps = 5959 stepsize = 2.55e+00 +t = 3.60e+04 no. steps = 5975 stepsize = 2.55e+00 At bottom left: c1, c2 = 1.404e+04 3.387e+11 At top right: c1, c2 = 1.561e+04 3.765e+11 -t = 4.32e+04 no. steps = 7152 stepsize = 3.93e+02 -At bottom left: c1, c2 = -1.202e-09 3.382e+11 -At top right: c1, c2 = 1.624e-07 3.804e+11 +t = 4.32e+04 no. steps = 7163 stepsize = 4.64e+02 +At bottom left: c1, c2 = 2.125e-08 3.382e+11 +At top right: c1, c2 = 4.245e-08 3.804e+11 -t = 5.04e+04 no. steps = 7171 stepsize = 3.76e+02 -At bottom left: c1, c2 = 5.092e-08 3.358e+11 -At top right: c1, c2 = -4.835e-07 3.864e+11 +t = 5.04e+04 no. steps = 7179 stepsize = 4.64e+02 +At bottom left: c1, c2 = -4.072e-07 3.358e+11 +At top right: c1, c2 = 4.005e-11 3.864e+11 -t = 5.76e+04 no. steps = 7188 stepsize = 2.94e+02 -At bottom left: c1, c2 = -3.248e-10 3.320e+11 -At top right: c1, c2 = 7.269e-08 3.909e+11 +t = 5.76e+04 no. steps = 7195 stepsize = 3.44e+02 +At bottom left: c1, c2 = 3.487e-08 3.320e+11 +At top right: c1, c2 = 3.658e-18 3.909e+11 -t = 6.48e+04 no. steps = 7212 stepsize = 5.52e+02 -At bottom left: c1, c2 = -1.079e-09 3.313e+11 -At top right: c1, c2 = -2.660e-07 3.963e+11 +t = 6.48e+04 no. steps = 7210 stepsize = 5.15e+02 +At bottom left: c1, c2 = 2.253e-07 3.313e+11 +At top right: c1, c2 = -2.680e-19 3.963e+11 -t = 7.20e+04 no. steps = 7225 stepsize = 5.52e+02 -At bottom left: c1, c2 = 4.318e-08 3.330e+11 -At top right: c1, c2 = -4.973e-07 4.039e+11 +t = 7.20e+04 no. steps = 7224 stepsize = 5.15e+02 +At bottom left: c1, c2 = 8.966e-08 3.330e+11 +At top right: c1, c2 = -1.036e-18 4.039e+11 -t = 7.92e+04 no. steps = 7238 stepsize = 5.52e+02 -At bottom left: c1, c2 = -1.398e-08 3.334e+11 -At top right: c1, c2 = 7.657e-08 4.120e+11 +t = 7.92e+04 no. steps = 7238 stepsize = 5.15e+02 +At bottom left: c1, c2 = 2.038e-08 3.334e+11 +At top right: c1, c2 = -2.330e-18 4.120e+11 -t = 8.64e+04 no. steps = 7252 stepsize = 5.52e+02 -At bottom left: c1, c2 = 1.764e-07 3.352e+11 -At top right: c1, c2 = -4.190e-08 4.163e+11 +t = 8.64e+04 no. steps = 7252 stepsize = 5.15e+02 +At bottom left: c1, c2 = -3.746e-21 3.352e+11 +At top right: c1, c2 = -2.537e-27 4.163e+11 Final Statistics: @@ -61,14 +61,14 @@ Final Statistics: lenrw = 3901 leniw = 267 lenrwls = 2455 leniwls = 126 nst = 7252 nfe = 0 -nfe = 76109 nfels = 82856 -nni = 39711 nli = 82856 -nsetups = 437 netf = 27 -npe = 121 nps = 120385 +nfe = 76929 nfels = 102816 +nni = 40521 nli = 102816 +nsetups = 439 netf = 29 +npe = 122 nps = 140398 ncfn = 0 ncfl = 0 In ARKBBDPRE: real/integer local work space sizes = 1300, 192 - no. flocal evals. = 2662 + no. flocal evals. = 2684 ------------------------------------------------------------------- @@ -76,11 +76,11 @@ In ARKBBDPRE: real/integer local work space sizes = 1300, 192 Preconditioner type is: jpre = SUN_PREC_RIGHT -t = 7.20e+03 no. steps = 981 stepsize = 3.07e+00 +t = 7.20e+03 no. steps = 980 stepsize = 3.07e+00 At bottom left: c1, c2 = 1.047e+04 2.527e+11 At top right: c1, c2 = 1.119e+04 2.700e+11 -t = 1.44e+04 no. steps = 2731 stepsize = 6.90e+00 +t = 1.44e+04 no. steps = 2730 stepsize = 6.90e+00 At bottom left: c1, c2 = 6.659e+06 2.582e+11 At top right: c1, c2 = 7.301e+06 2.833e+11 @@ -88,53 +88,53 @@ t = 2.16e+04 no. steps = 3533 stepsize = 1.04e+01 At bottom left: c1, c2 = 2.665e+07 2.993e+11 At top right: c1, c2 = 2.931e+07 3.313e+11 -t = 2.88e+04 no. steps = 4692 stepsize = 3.80e+00 +t = 2.88e+04 no. steps = 4705 stepsize = 3.57e+00 At bottom left: c1, c2 = 8.702e+06 3.380e+11 At top right: c1, c2 = 9.650e+06 3.751e+11 -t = 3.60e+04 no. steps = 6087 stepsize = 2.55e+00 +t = 3.60e+04 no. steps = 6160 stepsize = 2.56e+00 At bottom left: c1, c2 = 1.404e+04 3.387e+11 At top right: c1, c2 = 1.561e+04 3.765e+11 -t = 4.32e+04 no. steps = 7275 stepsize = 4.76e+02 -At bottom left: c1, c2 = 1.722e-10 3.382e+11 -At top right: c1, c2 = 1.593e-09 3.804e+11 +t = 4.32e+04 no. steps = 7347 stepsize = 4.30e+02 +At bottom left: c1, c2 = 4.255e-12 3.382e+11 +At top right: c1, c2 = -2.358e-07 3.804e+11 -t = 5.04e+04 no. steps = 7291 stepsize = 3.75e+02 -At bottom left: c1, c2 = 1.309e-09 3.358e+11 -At top right: c1, c2 = -1.367e-09 3.864e+11 +t = 5.04e+04 no. steps = 7364 stepsize = 4.81e+02 +At bottom left: c1, c2 = -1.312e-17 3.358e+11 +At top right: c1, c2 = 2.130e-11 3.864e+11 -t = 5.76e+04 no. steps = 7308 stepsize = 2.92e+02 -At bottom left: c1, c2 = -2.110e-07 3.320e+11 -At top right: c1, c2 = -3.069e-07 3.909e+11 +t = 5.76e+04 no. steps = 7380 stepsize = 2.39e+02 +At bottom left: c1, c2 = -6.762e-21 3.320e+11 +At top right: c1, c2 = -4.330e-12 3.909e+11 -t = 6.48e+04 no. steps = 7323 stepsize = 4.87e+02 -At bottom left: c1, c2 = 2.224e-07 3.313e+11 -At top right: c1, c2 = 2.684e-07 3.963e+11 +t = 6.48e+04 no. steps = 7393 stepsize = 6.42e+02 +At bottom left: c1, c2 = -3.898e-25 3.313e+11 +At top right: c1, c2 = -4.918e-07 3.963e+11 -t = 7.20e+04 no. steps = 7338 stepsize = 4.87e+02 -At bottom left: c1, c2 = 6.820e-08 3.330e+11 -At top right: c1, c2 = -2.132e-06 4.039e+11 +t = 7.20e+04 no. steps = 7405 stepsize = 6.42e+02 +At bottom left: c1, c2 = 5.173e-25 3.330e+11 +At top right: c1, c2 = -1.031e-06 4.039e+11 -t = 7.92e+04 no. steps = 7353 stepsize = 4.87e+02 -At bottom left: c1, c2 = 1.134e-09 3.334e+11 -At top right: c1, c2 = -2.341e-07 4.120e+11 +t = 7.92e+04 no. steps = 7416 stepsize = 6.42e+02 +At bottom left: c1, c2 = 5.441e-26 3.334e+11 +At top right: c1, c2 = -1.290e-06 4.120e+11 -t = 8.64e+04 no. steps = 7364 stepsize = 7.33e+02 -At bottom left: c1, c2 = 4.331e-07 3.352e+11 -At top right: c1, c2 = -6.607e-08 4.163e+11 +t = 8.64e+04 no. steps = 7427 stepsize = 6.42e+02 +At bottom left: c1, c2 = 1.538e-27 3.352e+11 +At top right: c1, c2 = -5.134e-07 4.163e+11 Final Statistics: lenrw = 3901 leniw = 272 lenrwls = 2455 leniwls = 126 -nst = 7364 nfe = 0 -nfe = 77457 nfels = 101131 -nni = 40469 nli = 101131 -nsetups = 457 netf = 33 -npe = 124 nps = 138172 -ncfn = 0 ncfl = 0 +nst = 7427 nfe = 0 +nfe = 78794 nfels = 111450 +nni = 41511 nli = 111450 +nsetups = 453 netf = 29 +npe = 125 nps = 149218 +ncfn = 0 ncfl = 38 In ARKBBDPRE: real/integer local work space sizes = 1300, 192 - no. flocal evals. = 2728 + no. flocal evals. = 2750 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/C_parallel/ark_diurnal_kry_p.out b/examples/arkode/C_parallel/ark_diurnal_kry_p.out index 97f07c3221..3e509d403e 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_p.out +++ b/examples/arkode/C_parallel/ark_diurnal_kry_p.out @@ -1,11 +1,11 @@ 2-species diurnal advection-diffusion problem -t = 7.20e+03 no. steps = 979 stepsize = 3.07e+00 +t = 7.20e+03 no. steps = 980 stepsize = 3.07e+00 At bottom left: c1, c2 = 1.047e+04 2.527e+11 At top right: c1, c2 = 1.119e+04 2.700e+11 -t = 1.44e+04 no. steps = 2733 stepsize = 6.92e+00 +t = 1.44e+04 no. steps = 2730 stepsize = 6.90e+00 At bottom left: c1, c2 = 6.659e+06 2.582e+11 At top right: c1, c2 = 7.301e+06 2.833e+11 @@ -13,51 +13,51 @@ t = 2.16e+04 no. steps = 3533 stepsize = 1.04e+01 At bottom left: c1, c2 = 2.665e+07 2.993e+11 At top right: c1, c2 = 2.931e+07 3.313e+11 -t = 2.88e+04 no. steps = 4559 stepsize = 4.56e+00 +t = 2.88e+04 no. steps = 4695 stepsize = 3.50e+00 At bottom left: c1, c2 = 8.702e+06 3.380e+11 At top right: c1, c2 = 9.650e+06 3.751e+11 -t = 3.60e+04 no. steps = 5822 stepsize = 2.55e+00 +t = 3.60e+04 no. steps = 6172 stepsize = 2.55e+00 At bottom left: c1, c2 = 1.404e+04 3.387e+11 At top right: c1, c2 = 1.561e+04 3.765e+11 -t = 4.32e+04 no. steps = 7012 stepsize = 4.38e+02 -At bottom left: c1, c2 = -2.534e-08 3.382e+11 -At top right: c1, c2 = 2.458e-08 3.804e+11 +t = 4.32e+04 no. steps = 7361 stepsize = 5.00e+02 +At bottom left: c1, c2 = 3.855e-13 3.382e+11 +At top right: c1, c2 = -1.439e-12 3.804e+11 -t = 5.04e+04 no. steps = 7031 stepsize = 3.01e+02 -At bottom left: c1, c2 = 6.320e-07 3.358e+11 -At top right: c1, c2 = -7.802e-07 3.864e+11 +t = 5.04e+04 no. steps = 7379 stepsize = 3.71e+02 +At bottom left: c1, c2 = -4.407e-14 3.358e+11 +At top right: c1, c2 = 1.551e-13 3.864e+11 -t = 5.76e+04 no. steps = 7052 stepsize = 2.39e+02 -At bottom left: c1, c2 = -2.953e-15 3.320e+11 -At top right: c1, c2 = -6.467e-15 3.909e+11 +t = 5.76e+04 no. steps = 7394 stepsize = 1.90e+02 +At bottom left: c1, c2 = 2.370e-12 3.320e+11 +At top right: c1, c2 = -4.013e-12 3.909e+11 -t = 6.48e+04 no. steps = 7067 stepsize = 6.00e+02 -At bottom left: c1, c2 = -2.940e-18 3.313e+11 -At top right: c1, c2 = -9.232e-17 3.963e+11 +t = 6.48e+04 no. steps = 7409 stepsize = 5.59e+02 +At bottom left: c1, c2 = 1.301e-12 3.313e+11 +At top right: c1, c2 = -4.849e-12 3.963e+11 -t = 7.20e+04 no. steps = 7079 stepsize = 6.00e+02 -At bottom left: c1, c2 = 2.299e-17 3.330e+11 -At top right: c1, c2 = -1.240e-16 4.039e+11 +t = 7.20e+04 no. steps = 7421 stepsize = 5.59e+02 +At bottom left: c1, c2 = -1.797e-23 3.330e+11 +At top right: c1, c2 = -3.890e-22 4.039e+11 -t = 7.92e+04 no. steps = 7091 stepsize = 6.00e+02 -At bottom left: c1, c2 = 2.598e-17 3.334e+11 -At top right: c1, c2 = -6.124e-17 4.120e+11 +t = 7.92e+04 no. steps = 7434 stepsize = 5.59e+02 +At bottom left: c1, c2 = -2.819e-27 3.334e+11 +At top right: c1, c2 = -1.209e-25 4.120e+11 -t = 8.64e+04 no. steps = 7103 stepsize = 6.00e+02 -At bottom left: c1, c2 = 1.059e-27 3.352e+11 -At top right: c1, c2 = 1.567e-26 4.163e+11 +t = 8.64e+04 no. steps = 7447 stepsize = 5.59e+02 +At bottom left: c1, c2 = -2.334e-27 3.352e+11 +At top right: c1, c2 = -8.983e-26 4.163e+11 Final Statistics: lenrw = 3301 leniw = 243 lenrwls = 2455 leniwls = 126 -nst = 7103 nfe = 0 -nfi = 74602 nfels = 87206 -nni = 38944 nli = 87206 -nsetups = 431 netf = 28 -npe = 120 nps = 123894 -ncfn = 0 ncfl = 0 +nst = 7447 nfe = 0 +nfi = 79041 nfels = 108536 +nni = 41643 nli = 108536 +nsetups = 456 netf = 32 +npe = 125 nps = 147035 +ncfn = 0 ncfl = 83 diff --git a/examples/arkode/C_parhyp/ark_diurnal_kry_ph.out b/examples/arkode/C_parhyp/ark_diurnal_kry_ph.out index 411f0a09fc..2d806c7252 100644 --- a/examples/arkode/C_parhyp/ark_diurnal_kry_ph.out +++ b/examples/arkode/C_parhyp/ark_diurnal_kry_ph.out @@ -5,59 +5,59 @@ t = 7.20e+03 no. steps = 979 stepsize = 3.07e+00 At bottom left: c1, c2 = 1.047e+04 2.527e+11 At top right: c1, c2 = 1.119e+04 2.700e+11 -t = 1.44e+04 no. steps = 2733 stepsize = 6.92e+00 +t = 1.44e+04 no. steps = 2733 stepsize = 6.93e+00 At bottom left: c1, c2 = 6.659e+06 2.582e+11 At top right: c1, c2 = 7.301e+06 2.833e+11 -t = 2.16e+04 no. steps = 3533 stepsize = 1.04e+01 +t = 2.16e+04 no. steps = 3532 stepsize = 1.04e+01 At bottom left: c1, c2 = 2.665e+07 2.993e+11 At top right: c1, c2 = 2.931e+07 3.313e+11 -t = 2.88e+04 no. steps = 4558 stepsize = 3.77e+00 +t = 2.88e+04 no. steps = 4588 stepsize = 4.86e+00 At bottom left: c1, c2 = 8.702e+06 3.380e+11 At top right: c1, c2 = 9.650e+06 3.751e+11 -t = 3.60e+04 no. steps = 5961 stepsize = 2.55e+00 +t = 3.60e+04 no. steps = 5824 stepsize = 2.55e+00 At bottom left: c1, c2 = 1.404e+04 3.387e+11 At top right: c1, c2 = 1.561e+04 3.765e+11 -t = 4.32e+04 no. steps = 7161 stepsize = 5.16e+02 -At bottom left: c1, c2 = 4.611e-12 3.382e+11 -At top right: c1, c2 = -1.475e-11 3.804e+11 +t = 4.32e+04 no. steps = 7026 stepsize = 5.12e+02 +At bottom left: c1, c2 = 1.334e-12 3.382e+11 +At top right: c1, c2 = -4.825e-12 3.804e+11 -t = 5.04e+04 no. steps = 7175 stepsize = 5.05e+02 -At bottom left: c1, c2 = 1.182e-11 3.358e+11 -At top right: c1, c2 = -2.617e-11 3.864e+11 +t = 5.04e+04 no. steps = 7041 stepsize = 5.36e+02 +At bottom left: c1, c2 = 1.415e-13 3.358e+11 +At top right: c1, c2 = -1.712e-12 3.864e+11 -t = 5.76e+04 no. steps = 7190 stepsize = 2.44e+02 -At bottom left: c1, c2 = -1.051e-11 3.320e+11 -At top right: c1, c2 = -9.200e-11 3.909e+11 +t = 5.76e+04 no. steps = 7055 stepsize = 2.34e+02 +At bottom left: c1, c2 = -2.533e-12 3.320e+11 +At top right: c1, c2 = -5.401e-12 3.909e+11 -t = 6.48e+04 no. steps = 7203 stepsize = 6.40e+02 -At bottom left: c1, c2 = 1.286e-10 3.313e+11 -At top right: c1, c2 = -4.357e-10 3.963e+11 +t = 6.48e+04 no. steps = 7068 stepsize = 6.40e+02 +At bottom left: c1, c2 = -4.169e-12 3.313e+11 +At top right: c1, c2 = 1.665e-11 3.963e+11 -t = 7.20e+04 no. steps = 7215 stepsize = 6.40e+02 -At bottom left: c1, c2 = -1.814e-11 3.330e+11 -At top right: c1, c2 = -9.120e-11 4.039e+11 +t = 7.20e+04 no. steps = 7080 stepsize = 6.40e+02 +At bottom left: c1, c2 = -3.839e-12 3.330e+11 +At top right: c1, c2 = -3.434e-11 4.039e+11 -t = 7.92e+04 no. steps = 7226 stepsize = 6.40e+02 -At bottom left: c1, c2 = -1.291e-21 3.334e+11 -At top right: c1, c2 = -1.937e-20 4.120e+11 +t = 7.92e+04 no. steps = 7091 stepsize = 6.40e+02 +At bottom left: c1, c2 = 2.289e-26 3.334e+11 +At top right: c1, c2 = 4.220e-25 4.120e+11 -t = 8.64e+04 no. steps = 7237 stepsize = 6.40e+02 -At bottom left: c1, c2 = -3.534e-21 3.352e+11 -At top right: c1, c2 = -4.442e-20 4.163e+11 +t = 8.64e+04 no. steps = 7102 stepsize = 6.40e+02 +At bottom left: c1, c2 = -5.225e-26 3.352e+11 +At top right: c1, c2 = -5.452e-25 4.163e+11 Final Statistics: lenrw = 3301 leniw = 243 lenrwls = 2455 leniwls = 126 -nst = 7237 nfe = 0 -nfi = 75881 nfels = 88695 -nni = 39568 nli = 88695 -nsetups = 431 netf = 25 -npe = 121 nps = 126028 +nst = 7102 nfe = 0 +nfi = 74579 nfels = 87090 +nni = 38921 nli = 87090 +nsetups = 429 netf = 29 +npe = 119 nps = 123765 ncfn = 0 ncfl = 0 diff --git a/examples/arkode/C_serial/ark_KrylovDemo_prec.out b/examples/arkode/C_serial/ark_KrylovDemo_prec.out index 3a63a46785..a3f589f739 100644 --- a/examples/arkode/C_serial/ark_KrylovDemo_prec.out +++ b/examples/arkode/C_serial/ark_KrylovDemo_prec.out @@ -190,18 +190,18 @@ Species 6 297691 307208 319252 319264 307245 297749 297229 297691 298276 298276 297692 297231 -t = 1.00e-02 nst = 113 nfe = 0 nfi = 1797 nni = 1229 hu = 3.46e-03 +t = 1.00e-02 nst = 113 nfe = 0 nfi = 1797 nni = 1229 hu = 3.43e-03 -t = 1.00e-01 nst = 127 nfe = 0 nfi = 2024 nni = 1386 hu = 1.28e-02 +t = 1.00e-01 nst = 127 nfe = 0 nfi = 2023 nni = 1385 hu = 1.25e-02 -t = 1.00e+00 nst = 154 nfe = 0 nfi = 2489 nni = 1716 hu = 6.84e-02 +t = 1.00e+00 nst = 153 nfe = 0 nfi = 2474 nni = 1706 hu = 6.52e-02 c values at t = 1: Species 1 -1.58851 1.59924 1.62152 1.64764 1.67036 1.68149 +1.58851 1.59924 1.62152 1.64765 1.67036 1.68149 1.58533 1.59503 1.61548 1.63952 1.66033 1.67036 -1.57757 1.58547 1.60239 1.62235 1.63952 1.64764 +1.57757 1.58547 1.60239 1.62235 1.63952 1.64765 1.5682 1.57412 1.58706 1.60239 1.61548 1.62152 1.56048 1.56463 1.57412 1.58547 1.59503 1.59924 1.55733 1.56048 1.5682 1.57757 1.58533 1.58851 @@ -210,7 +210,7 @@ Species 2 1.59067 1.60141 1.62371 1.64987 1.67261 1.68375 1.58748 1.5972 1.61766 1.64173 1.66257 1.67261 1.57971 1.58763 1.60457 1.62454 1.64173 1.64987 -1.57034 1.57626 1.58921 1.60457 1.61766 1.62371 +1.57034 1.57626 1.58922 1.60457 1.61766 1.62371 1.56261 1.56676 1.57626 1.58763 1.5972 1.60141 1.55945 1.56261 1.57034 1.57971 1.58748 1.59067 @@ -223,34 +223,34 @@ Species 3 1.56146 1.56462 1.57236 1.58174 1.58951 1.5927 Species 4 -47718.3 48040.3 48709 49493.5 50175.5 50509.4 +47718.4 48040.3 48709 49493.5 50175.5 50509.4 47622.8 47914 48527.8 49249.6 49874.4 50175.5 -47389.7 47627 48134.9 48734.2 49249.6 49493.5 -47108.5 47286 47674.6 48134.9 48527.8 48709 -46876.6 47001.2 47286 47627 47914 48040.3 -46781.9 46876.6 47108.5 47389.7 47622.8 47718.3 +47389.7 47627 48135 48734.2 49249.6 49493.5 +47108.5 47286.1 47674.6 48135 48527.8 48709 +46876.6 47001.1 47286.1 47627 47914 48040.3 +46781.9 46876.6 47108.5 47389.7 47622.8 47718.4 Species 5 -47718.3 48040.3 48709 49493.5 50175.5 50509.4 +47718.4 48040.3 48709 49493.5 50175.5 50509.4 47622.8 47914 48527.8 49249.6 49874.4 50175.5 -47389.7 47627 48134.9 48734.2 49249.6 49493.5 -47108.5 47286 47674.6 48134.9 48527.8 48709 -46876.6 47001.2 47286 47627 47914 48040.3 -46781.9 46876.6 47108.5 47389.7 47622.8 47718.3 +47389.7 47627 48135 48734.2 49249.6 49493.5 +47108.5 47286.1 47674.6 48135 48527.8 48709 +46876.6 47001.1 47286.1 47627 47914 48040.3 +46781.9 46876.6 47108.5 47389.7 47622.8 47718.4 Species 6 -47718.3 48040.3 48709 49493.5 50175.5 50509.4 +47718.4 48040.3 48709 49493.5 50175.5 50509.4 47622.8 47914 48527.8 49249.6 49874.4 50175.5 -47389.7 47627 48134.9 48734.2 49249.6 49493.5 -47108.5 47286 47674.6 48134.9 48527.8 48709 -46876.6 47001.2 47286 47627 47914 48040.3 -46781.9 46876.6 47108.5 47389.7 47622.8 47718.3 +47389.7 47627 48135 48734.2 49249.6 49493.5 +47108.5 47286.1 47674.6 48135 48527.8 48709 +46876.6 47001.1 47286.1 47627 47914 48040.3 +46781.9 46876.6 47108.5 47389.7 47622.8 47718.4 -t = 2.00e+00 nst = 165 nfe = 0 nfi = 2661 nni = 1833 hu = 4.14e-02 +t = 2.00e+00 nst = 164 nfe = 0 nfi = 2647 nni = 1824 hu = 1.58e-01 -t = 3.00e+00 nst = 177 nfe = 0 nfi = 2848 nni = 1960 hu = 1.08e-01 +t = 3.00e+00 nst = 170 nfe = 0 nfi = 2737 nni = 1884 hu = 1.58e-01 -t = 4.00e+00 nst = 187 nfe = 0 nfi = 3013 nni = 2073 hu = 1.23e-01 +t = 4.00e+00 nst = 176 nfe = 0 nfi = 2843 nni = 1955 hu = 1.85e-01 c values at t = 4: @@ -280,33 +280,33 @@ Species 3 Species 4 35860.6 36110.2 36632.4 37246.4 37779.5 38038.7 -35784.2 36010.4 36490.4 37056.3 37545.3 37779.5 +35784.2 36010.4 36490.4 37056.3 37545.4 37779.5 35597.2 35782 36180.5 36651.6 37056.3 37246.4 -35371.4 35510.4 35816.7 36180.5 36490.4 36632.4 -35185.4 35283.8 35510.4 35782 36010.4 36110.2 -35109.7 35185.4 35371.4 35597.2 35784.2 35860.6 +35371.4 35510.3 35816.7 36180.5 36490.4 36632.4 +35185.4 35283.8 35510.3 35782 36010.4 36110.2 +35109.8 35185.4 35371.4 35597.2 35784.2 35860.6 Species 5 35860.6 36110.2 36632.4 37246.4 37779.5 38038.7 -35784.2 36010.4 36490.4 37056.3 37545.3 37779.5 +35784.2 36010.4 36490.4 37056.3 37545.4 37779.5 35597.2 35782 36180.5 36651.6 37056.3 37246.4 -35371.4 35510.4 35816.7 36180.5 36490.4 36632.4 -35185.4 35283.8 35510.4 35782 36010.4 36110.2 -35109.7 35185.4 35371.4 35597.2 35784.2 35860.6 +35371.4 35510.3 35816.7 36180.5 36490.4 36632.4 +35185.4 35283.8 35510.3 35782 36010.4 36110.2 +35109.8 35185.4 35371.4 35597.2 35784.2 35860.6 Species 6 35860.6 36110.2 36632.4 37246.4 37779.5 38038.7 -35784.2 36010.4 36490.4 37056.3 37545.3 37779.5 +35784.2 36010.4 36490.4 37056.3 37545.4 37779.5 35597.2 35782 36180.5 36651.6 37056.3 37246.4 -35371.4 35510.4 35816.7 36180.5 36490.4 36632.4 -35185.4 35283.8 35510.4 35782 36010.4 36110.2 -35109.7 35185.4 35371.4 35597.2 35784.2 35860.6 +35371.4 35510.3 35816.7 36180.5 36490.4 36632.4 +35185.4 35283.8 35510.3 35782 36010.4 36110.2 +35109.8 35185.4 35371.4 35597.2 35784.2 35860.6 -t = 5.00e+00 nst = 198 nfe = 0 nfi = 3179 nni = 2182 hu = 9.99e-02 +t = 5.00e+00 nst = 181 nfe = 0 nfi = 2911 nni = 1998 hu = 2.46e-01 -t = 6.00e+00 nst = 207 nfe = 0 nfi = 3336 nni = 2284 hu = 9.66e-02 +t = 6.00e+00 nst = 184 nfe = 0 nfi = 2950 nni = 2022 hu = 3.05e-01 -t = 7.00e+00 nst = 216 nfe = 0 nfi = 3477 nni = 2375 hu = 1.51e-01 +t = 7.00e+00 nst = 186 nfe = 0 nfi = 2975 nni = 2037 hu = 4.87e-01 c values at t = 7: @@ -335,34 +335,34 @@ Species 3 1.16363 1.16614 1.17231 1.1798 1.18601 1.18854 Species 4 -35656.3 35903.1 36424.2 37033.8 37564.6 37822.3 -35578.4 35804.9 36281.3 36845.5 37330.9 37564.6 -35393.9 35575.9 35974.4 36441.4 36845.5 37033.8 -35167.5 35307.4 35610.6 35974.4 36281.3 36424.2 -34984.3 35080.2 35307.4 35575.9 35804.9 35903.1 -34907.5 34984.3 35167.5 35393.9 35578.4 35656.3 +35655.3 35903.6 36423.2 37034.1 37564.4 37822.3 +35579.3 35804.3 36281.9 36844.9 37331.5 37564.4 +35393.1 35577 35973.5 36442.3 36844.9 37034.1 +35168.4 35306.6 35611.5 35973.5 36281.9 36423.2 +34983.3 35081.1 35306.6 35577 35804.3 35903.6 +34907.9 34983.3 35168.4 35393.1 35579.3 35655.3 Species 5 -35656.3 35903.1 36424.2 37033.8 37564.6 37822.3 -35578.4 35804.9 36281.3 36845.5 37330.9 37564.6 -35393.9 35575.9 35974.4 36441.4 36845.5 37033.8 -35167.5 35307.4 35610.6 35974.4 36281.3 36424.2 -34984.3 35080.2 35307.4 35575.9 35804.9 35903.1 -34907.5 34984.3 35167.5 35393.9 35578.4 35656.3 +35655.3 35903.6 36423.2 37034.1 37564.4 37822.3 +35579.3 35804.3 36281.9 36844.9 37331.5 37564.4 +35393.1 35577 35973.5 36442.3 36844.9 37034.1 +35168.4 35306.6 35611.5 35973.5 36281.9 36423.2 +34983.3 35081.1 35306.6 35577 35804.3 35903.6 +34907.9 34983.3 35168.4 35393.1 35579.3 35655.3 Species 6 -35656.3 35903.1 36424.2 37033.8 37564.6 37822.3 -35578.4 35804.9 36281.3 36845.5 37330.9 37564.6 -35393.9 35575.9 35974.4 36441.4 36845.5 37033.8 -35167.5 35307.4 35610.6 35974.4 36281.3 36424.2 -34984.3 35080.2 35307.4 35575.9 35804.9 35903.1 -34907.5 34984.3 35167.5 35393.9 35578.4 35656.3 +35655.3 35903.6 36423.2 37034.1 37564.4 37822.3 +35579.3 35804.3 36281.9 36844.9 37331.5 37564.4 +35393.1 35577 35973.5 36442.3 36844.9 37034.1 +35168.4 35306.6 35611.5 35973.5 36281.9 36423.2 +34983.3 35081.1 35306.6 35577 35804.3 35903.6 +34907.9 34983.3 35168.4 35393.1 35579.3 35655.3 -t = 8.00e+00 nst = 232 nfe = 0 nfi = 3780 nni = 2567 hu = 1.06e-01 +t = 8.00e+00 nst = 188 nfe = 0 nfi = 3003 nni = 2055 hu = 7.64e-01 -t = 9.00e+00 nst = 249 nfe = 0 nfi = 4075 nni = 2742 hu = 8.61e-02 +t = 9.00e+00 nst = 189 nfe = 0 nfi = 3015 nni = 2062 hu = 7.64e-01 -t = 1.00e+01 nst = 266 nfe = 0 nfi = 4394 nni = 2941 hu = 8.37e-02 +t = 1.00e+01 nst = 190 nfe = 0 nfi = 3030 nni = 2072 hu = 1.57e+00 c values at t = 10: @@ -391,27 +391,27 @@ Species 3 1.16347 1.16598 1.17215 1.17964 1.18585 1.18838 Species 4 -35650.6 35898.8 36418.4 37029.2 37559.5 37817.3 +35650.6 35898.8 36418.3 37029.2 37559.5 37817.3 35574.5 35799.5 36277.1 36840 37326.6 37559.5 -35388.4 35572.3 35968.8 36437.5 36840 37029.2 -35163.7 35302 35606.7 35968.8 36277.1 36418.4 -34978.6 35076.5 35302 35572.3 35799.5 35898.8 +35388.4 35572.3 35968.7 36437.4 36840 37029.2 +35163.7 35301.9 35606.7 35968.7 36277.1 36418.3 +34978.6 35076.5 35301.9 35572.3 35799.5 35898.8 34903.3 34978.6 35163.7 35388.4 35574.5 35650.6 Species 5 -35650.6 35898.8 36418.4 37029.2 37559.5 37817.3 +35650.6 35898.8 36418.3 37029.2 37559.5 37817.3 35574.5 35799.5 36277.1 36840 37326.6 37559.5 -35388.4 35572.3 35968.8 36437.5 36840 37029.2 -35163.7 35302 35606.7 35968.8 36277.1 36418.4 -34978.6 35076.5 35302 35572.3 35799.5 35898.8 +35388.4 35572.3 35968.7 36437.4 36840 37029.2 +35163.7 35301.9 35606.7 35968.7 36277.1 36418.3 +34978.6 35076.5 35301.9 35572.3 35799.5 35898.8 34903.3 34978.6 35163.7 35388.4 35574.5 35650.6 Species 6 -35650.6 35898.8 36418.4 37029.2 37559.5 37817.3 +35650.6 35898.8 36418.3 37029.2 37559.5 37817.3 35574.5 35799.5 36277.1 36840 37326.6 37559.5 -35388.4 35572.3 35968.8 36437.5 36840 37029.2 -35163.7 35302 35606.7 35968.8 36277.1 36418.4 -34978.6 35076.5 35302 35572.3 35799.5 35898.8 +35388.4 35572.3 35968.7 36437.4 36840 37029.2 +35163.7 35301.9 35606.7 35968.7 36277.1 36418.3 +34978.6 35076.5 35301.9 35572.3 35799.5 35898.8 34903.3 34978.6 35163.7 35388.4 35574.5 35650.6 @@ -422,20 +422,20 @@ Species 6 ARKStep integer workspace length = 131 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 - Number of steps = 266 + Number of steps = 190 Number of f-s (explicit) = 0 - Number of f-s (implicit) = 4394 - Number of f-s (SPGMR) = 8980 - Number of f-s (TOTAL) = 8980 - Number of setups = 121 - Number of nonlinear iterations = 2941 - Number of linear iterations = 8980 - Number of preconditioner evaluations = 121 - Number of preconditioner solves = 11819 - Number of error test failures = 23 - Number of nonlinear conv. failures = 17 - Number of linear convergence failures = 509 - Average Krylov subspace dimension = 3.053 + Number of f-s (implicit) = 3030 + Number of f-s (SPGMR) = 6097 + Number of f-s (TOTAL) = 6097 + Number of setups = 38 + Number of nonlinear iterations = 2072 + Number of linear iterations = 6097 + Number of preconditioner evaluations = 38 + Number of preconditioner solves = 8080 + Number of error test failures = 1 + Number of nonlinear conv. failures = 0 + Number of linear convergence failures = 182 + Average Krylov subspace dimension = 2.943 ---------------------------------------------------------------------------- @@ -459,29 +459,29 @@ t = 1.00e-04 nst = 106 nfe = 0 nfi = 1688 nni = 1155 hu = 1.70e-05 t = 1.00e-03 nst = 110 nfe = 0 nfi = 1750 nni = 1197 hu = 1.51e-03 -t = 1.00e-02 nst = 113 nfe = 0 nfi = 1797 nni = 1229 hu = 3.46e-03 +t = 1.00e-02 nst = 113 nfe = 0 nfi = 1797 nni = 1229 hu = 3.43e-03 -t = 1.00e-01 nst = 127 nfe = 0 nfi = 2024 nni = 1386 hu = 1.28e-02 +t = 1.00e-01 nst = 127 nfe = 0 nfi = 2023 nni = 1385 hu = 1.25e-02 -t = 1.00e+00 nst = 154 nfe = 0 nfi = 2491 nni = 1718 hu = 7.60e-02 +t = 1.00e+00 nst = 153 nfe = 0 nfi = 2474 nni = 1706 hu = 6.52e-02 -t = 2.00e+00 nst = 169 nfe = 0 nfi = 2746 nni = 1896 hu = 8.04e-02 +t = 2.00e+00 nst = 164 nfe = 0 nfi = 2647 nni = 1824 hu = 1.58e-01 -t = 3.00e+00 nst = 181 nfe = 0 nfi = 2950 nni = 2036 hu = 1.01e-01 +t = 3.00e+00 nst = 170 nfe = 0 nfi = 2737 nni = 1884 hu = 1.58e-01 -t = 4.00e+00 nst = 189 nfe = 0 nfi = 3073 nni = 2119 hu = 1.33e-01 +t = 4.00e+00 nst = 176 nfe = 0 nfi = 2843 nni = 1955 hu = 1.85e-01 -t = 5.00e+00 nst = 199 nfe = 0 nfi = 3242 nni = 2227 hu = 9.38e-02 +t = 5.00e+00 nst = 181 nfe = 0 nfi = 2911 nni = 1998 hu = 2.46e-01 -t = 6.00e+00 nst = 211 nfe = 0 nfi = 3442 nni = 2352 hu = 1.13e-01 +t = 6.00e+00 nst = 184 nfe = 0 nfi = 2950 nni = 2022 hu = 3.05e-01 -t = 7.00e+00 nst = 220 nfe = 0 nfi = 3612 nni = 2457 hu = 1.07e-01 +t = 7.00e+00 nst = 186 nfe = 0 nfi = 2975 nni = 2037 hu = 4.86e-01 -t = 8.00e+00 nst = 229 nfe = 0 nfi = 3747 nni = 2537 hu = 1.33e-01 +t = 8.00e+00 nst = 188 nfe = 0 nfi = 3003 nni = 2055 hu = 7.64e-01 -t = 9.00e+00 nst = 239 nfe = 0 nfi = 3897 nni = 2622 hu = 8.98e-02 +t = 9.00e+00 nst = 189 nfe = 0 nfi = 3015 nni = 2062 hu = 7.64e-01 -t = 1.00e+01 nst = 251 nfe = 0 nfi = 4101 nni = 2746 hu = 7.09e-02 +t = 1.00e+01 nst = 190 nfe = 0 nfi = 3030 nni = 2072 hu = 1.57e+00 @@ -491,20 +491,20 @@ t = 1.00e+01 nst = 251 nfe = 0 nfi = 4101 nni = 2746 hu = 7.09e-02 ARKStep integer workspace length = 136 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 - Number of steps = 251 + Number of steps = 190 Number of f-s (explicit) = 0 - Number of f-s (implicit) = 4101 - Number of f-s (SPGMR) = 8880 - Number of f-s (TOTAL) = 8880 - Number of setups = 91 - Number of nonlinear iterations = 2746 - Number of linear iterations = 8880 - Number of preconditioner evaluations = 91 - Number of preconditioner solves = 11537 - Number of error test failures = 18 - Number of nonlinear conv. failures = 13 - Number of linear convergence failures = 597 - Average Krylov subspace dimension = 3.234 + Number of f-s (implicit) = 3030 + Number of f-s (SPGMR) = 6096 + Number of f-s (TOTAL) = 6096 + Number of setups = 38 + Number of nonlinear iterations = 2072 + Number of linear iterations = 6096 + Number of preconditioner evaluations = 38 + Number of preconditioner solves = 8079 + Number of error test failures = 1 + Number of nonlinear conv. failures = 0 + Number of linear convergence failures = 182 + Average Krylov subspace dimension = 2.942 ---------------------------------------------------------------------------- @@ -526,31 +526,31 @@ t = 1.00e-05 nst = 27 nfe = 0 nfi = 407 nni = 269 hu = 4.79e-07 t = 1.00e-04 nst = 106 nfe = 0 nfi = 1688 nni = 1155 hu = 1.70e-05 -t = 1.00e-03 nst = 110 nfe = 0 nfi = 1750 nni = 1197 hu = 1.50e-03 +t = 1.00e-03 nst = 110 nfe = 0 nfi = 1750 nni = 1197 hu = 1.49e-03 -t = 1.00e-02 nst = 113 nfe = 0 nfi = 1797 nni = 1229 hu = 3.42e-03 +t = 1.00e-02 nst = 113 nfe = 0 nfi = 1799 nni = 1231 hu = 3.79e-03 -t = 1.00e-01 nst = 127 nfe = 0 nfi = 2023 nni = 1385 hu = 1.23e-02 +t = 1.00e-01 nst = 127 nfe = 0 nfi = 2028 nni = 1390 hu = 1.32e-02 -t = 1.00e+00 nst = 166 nfe = 0 nfi = 2714 nni = 1875 hu = 2.40e-02 +t = 1.00e+00 nst = 164 nfe = 0 nfi = 2669 nni = 1844 hu = 4.98e-02 -t = 2.00e+00 nst = 214 nfe = 0 nfi = 3550 nni = 2460 hu = 2.34e-02 +t = 2.00e+00 nst = 213 nfe = 0 nfi = 3526 nni = 2444 hu = 2.37e-02 -t = 3.00e+00 nst = 249 nfe = 0 nfi = 4111 nni = 2846 hu = 3.57e-02 +t = 3.00e+00 nst = 248 nfe = 0 nfi = 4087 nni = 2830 hu = 3.53e-02 -t = 4.00e+00 nst = 272 nfe = 0 nfi = 4472 nni = 3092 hu = 5.08e-02 +t = 4.00e+00 nst = 272 nfe = 0 nfi = 4465 nni = 3088 hu = 3.22e-02 -t = 5.00e+00 nst = 297 nfe = 0 nfi = 4851 nni = 3346 hu = 5.14e-02 +t = 5.00e+00 nst = 299 nfe = 0 nfi = 4876 nni = 3363 hu = 3.94e-02 -t = 6.00e+00 nst = 315 nfe = 0 nfi = 5117 nni = 3522 hu = 6.88e-02 +t = 6.00e+00 nst = 316 nfe = 0 nfi = 5130 nni = 3532 hu = 6.86e-02 -t = 7.00e+00 nst = 328 nfe = 0 nfi = 5302 nni = 3642 hu = 8.22e-02 +t = 7.00e+00 nst = 329 nfe = 0 nfi = 5315 nni = 3652 hu = 8.22e-02 -t = 8.00e+00 nst = 338 nfe = 0 nfi = 5441 nni = 3731 hu = 8.52e-02 +t = 8.00e+00 nst = 339 nfe = 0 nfi = 5455 nni = 3742 hu = 1.18e-01 -t = 9.00e+00 nst = 349 nfe = 0 nfi = 5592 nni = 3827 hu = 1.11e-01 +t = 9.00e+00 nst = 345 nfe = 0 nfi = 5536 nni = 3793 hu = 2.11e-01 -t = 1.00e+01 nst = 359 nfe = 0 nfi = 5722 nni = 3907 hu = 1.35e-01 +t = 1.00e+01 nst = 349 nfe = 0 nfi = 5589 nni = 3826 hu = 2.80e-01 @@ -560,20 +560,20 @@ t = 1.00e+01 nst = 359 nfe = 0 nfi = 5722 nni = 3907 hu = 1.35e-01 ARKStep integer workspace length = 141 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 - Number of steps = 359 + Number of steps = 349 Number of f-s (explicit) = 0 - Number of f-s (implicit) = 5722 - Number of f-s (SPGMR) = 12904 - Number of f-s (TOTAL) = 12904 - Number of setups = 253 - Number of nonlinear iterations = 3907 - Number of linear iterations = 12904 - Number of preconditioner evaluations = 253 - Number of preconditioner solves = 16594 + Number of f-s (implicit) = 5589 + Number of f-s (SPGMR) = 12378 + Number of f-s (TOTAL) = 12378 + Number of setups = 244 + Number of nonlinear iterations = 3826 + Number of linear iterations = 12378 + Number of preconditioner evaluations = 244 + Number of preconditioner solves = 15957 Number of error test failures = 0 - Number of nonlinear conv. failures = 117 - Number of linear convergence failures = 1072 - Average Krylov subspace dimension = 3.303 + Number of nonlinear conv. failures = 113 + Number of linear convergence failures = 977 + Average Krylov subspace dimension = 3.235 ---------------------------------------------------------------------------- @@ -595,54 +595,54 @@ t = 1.00e-05 nst = 27 nfe = 0 nfi = 407 nni = 269 hu = 4.79e-07 t = 1.00e-04 nst = 106 nfe = 0 nfi = 1688 nni = 1155 hu = 1.70e-05 -t = 1.00e-03 nst = 110 nfe = 0 nfi = 1750 nni = 1197 hu = 1.50e-03 +t = 1.00e-03 nst = 110 nfe = 0 nfi = 1750 nni = 1197 hu = 1.49e-03 -t = 1.00e-02 nst = 113 nfe = 0 nfi = 1797 nni = 1229 hu = 3.42e-03 +t = 1.00e-02 nst = 113 nfe = 0 nfi = 1799 nni = 1231 hu = 3.79e-03 -t = 1.00e-01 nst = 127 nfe = 0 nfi = 2023 nni = 1385 hu = 1.23e-02 +t = 1.00e-01 nst = 127 nfe = 0 nfi = 2028 nni = 1390 hu = 1.32e-02 -t = 1.00e+00 nst = 166 nfe = 0 nfi = 2714 nni = 1875 hu = 2.40e-02 +t = 1.00e+00 nst = 164 nfe = 0 nfi = 2669 nni = 1844 hu = 4.98e-02 -t = 2.00e+00 nst = 214 nfe = 0 nfi = 3556 nni = 2465 hu = 2.34e-02 +t = 2.00e+00 nst = 213 nfe = 0 nfi = 3526 nni = 2444 hu = 2.37e-02 -t = 3.00e+00 nst = 249 nfe = 0 nfi = 4117 nni = 2851 hu = 3.57e-02 +t = 3.00e+00 nst = 248 nfe = 0 nfi = 4087 nni = 2830 hu = 3.53e-02 -t = 4.00e+00 nst = 272 nfe = 0 nfi = 4478 nni = 3097 hu = 5.08e-02 +t = 4.00e+00 nst = 272 nfe = 0 nfi = 4465 nni = 3088 hu = 3.22e-02 -t = 5.00e+00 nst = 297 nfe = 0 nfi = 4857 nni = 3351 hu = 5.14e-02 +t = 5.00e+00 nst = 299 nfe = 0 nfi = 4876 nni = 3363 hu = 3.94e-02 -t = 6.00e+00 nst = 315 nfe = 0 nfi = 5123 nni = 3527 hu = 6.89e-02 +t = 6.00e+00 nst = 316 nfe = 0 nfi = 5130 nni = 3532 hu = 6.86e-02 -t = 7.00e+00 nst = 328 nfe = 0 nfi = 5308 nni = 3647 hu = 9.31e-02 +t = 7.00e+00 nst = 329 nfe = 0 nfi = 5315 nni = 3652 hu = 8.22e-02 -t = 8.00e+00 nst = 339 nfe = 0 nfi = 5464 nni = 3748 hu = 9.70e-02 +t = 8.00e+00 nst = 339 nfe = 0 nfi = 5455 nni = 3742 hu = 1.19e-01 -t = 9.00e+00 nst = 349 nfe = 0 nfi = 5598 nni = 3832 hu = 1.12e-01 +t = 9.00e+00 nst = 345 nfe = 0 nfi = 5536 nni = 3793 hu = 2.11e-01 -t = 1.00e+01 nst = 359 nfe = 0 nfi = 5728 nni = 3912 hu = 1.31e-01 +t = 1.00e+01 nst = 349 nfe = 0 nfi = 5589 nni = 3826 hu = 2.80e-01 Final statistics for this run: ARKStep real workspace length = 3557 - ARKStep integer workspace length = 146 + ARKStep integer workspace length = 146 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 - Number of steps = 359 + Number of steps = 349 Number of f-s (explicit) = 0 - Number of f-s (implicit) = 5728 - Number of f-s (SPGMR) = 12934 - Number of f-s (TOTAL) = 12934 - Number of setups = 254 - Number of nonlinear iterations = 3912 - Number of linear iterations = 12934 - Number of preconditioner evaluations = 254 - Number of preconditioner solves = 16627 + Number of f-s (implicit) = 5589 + Number of f-s (SPGMR) = 12378 + Number of f-s (TOTAL) = 12378 + Number of setups = 244 + Number of nonlinear iterations = 3826 + Number of linear iterations = 12378 + Number of preconditioner evaluations = 244 + Number of preconditioner solves = 15957 Number of error test failures = 0 - Number of nonlinear conv. failures = 118 - Number of linear convergence failures = 1076 - Average Krylov subspace dimension = 3.306 + Number of nonlinear conv. failures = 113 + Number of linear convergence failures = 976 + Average Krylov subspace dimension = 3.235 ---------------------------------------------------------------------------- diff --git a/examples/arkode/C_serial/ark_KrylovDemo_prec_1.out b/examples/arkode/C_serial/ark_KrylovDemo_prec_1.out index 58b34e703d..a3f589f739 100644 --- a/examples/arkode/C_serial/ark_KrylovDemo_prec_1.out +++ b/examples/arkode/C_serial/ark_KrylovDemo_prec_1.out @@ -190,18 +190,18 @@ Species 6 297691 307208 319252 319264 307245 297749 297229 297691 298276 298276 297692 297231 -t = 1.00e-02 nst = 113 nfe = 0 nfi = 1797 nni = 1229 hu = 3.46e-03 +t = 1.00e-02 nst = 113 nfe = 0 nfi = 1797 nni = 1229 hu = 3.43e-03 -t = 1.00e-01 nst = 127 nfe = 0 nfi = 2024 nni = 1386 hu = 1.28e-02 +t = 1.00e-01 nst = 127 nfe = 0 nfi = 2023 nni = 1385 hu = 1.25e-02 -t = 1.00e+00 nst = 154 nfe = 0 nfi = 2489 nni = 1716 hu = 6.84e-02 +t = 1.00e+00 nst = 153 nfe = 0 nfi = 2474 nni = 1706 hu = 6.52e-02 c values at t = 1: Species 1 -1.58851 1.59924 1.62152 1.64764 1.67036 1.68149 +1.58851 1.59924 1.62152 1.64765 1.67036 1.68149 1.58533 1.59503 1.61548 1.63952 1.66033 1.67036 -1.57757 1.58547 1.60239 1.62235 1.63952 1.64764 +1.57757 1.58547 1.60239 1.62235 1.63952 1.64765 1.5682 1.57412 1.58706 1.60239 1.61548 1.62152 1.56048 1.56463 1.57412 1.58547 1.59503 1.59924 1.55733 1.56048 1.5682 1.57757 1.58533 1.58851 @@ -210,7 +210,7 @@ Species 2 1.59067 1.60141 1.62371 1.64987 1.67261 1.68375 1.58748 1.5972 1.61766 1.64173 1.66257 1.67261 1.57971 1.58763 1.60457 1.62454 1.64173 1.64987 -1.57034 1.57626 1.58921 1.60457 1.61766 1.62371 +1.57034 1.57626 1.58922 1.60457 1.61766 1.62371 1.56261 1.56676 1.57626 1.58763 1.5972 1.60141 1.55945 1.56261 1.57034 1.57971 1.58748 1.59067 @@ -223,34 +223,34 @@ Species 3 1.56146 1.56462 1.57236 1.58174 1.58951 1.5927 Species 4 -47718.3 48040.3 48709 49493.5 50175.5 50509.4 +47718.4 48040.3 48709 49493.5 50175.5 50509.4 47622.8 47914 48527.8 49249.6 49874.4 50175.5 -47389.7 47627 48134.9 48734.2 49249.6 49493.5 -47108.5 47286 47674.6 48134.9 48527.8 48709 -46876.6 47001.2 47286 47627 47914 48040.3 -46781.9 46876.6 47108.5 47389.7 47622.8 47718.3 +47389.7 47627 48135 48734.2 49249.6 49493.5 +47108.5 47286.1 47674.6 48135 48527.8 48709 +46876.6 47001.1 47286.1 47627 47914 48040.3 +46781.9 46876.6 47108.5 47389.7 47622.8 47718.4 Species 5 -47718.3 48040.3 48709 49493.5 50175.5 50509.4 +47718.4 48040.3 48709 49493.5 50175.5 50509.4 47622.8 47914 48527.8 49249.6 49874.4 50175.5 -47389.7 47627 48134.9 48734.2 49249.6 49493.5 -47108.5 47286 47674.6 48134.9 48527.8 48709 -46876.6 47001.2 47286 47627 47914 48040.3 -46781.9 46876.6 47108.5 47389.7 47622.8 47718.3 +47389.7 47627 48135 48734.2 49249.6 49493.5 +47108.5 47286.1 47674.6 48135 48527.8 48709 +46876.6 47001.1 47286.1 47627 47914 48040.3 +46781.9 46876.6 47108.5 47389.7 47622.8 47718.4 Species 6 -47718.3 48040.3 48709 49493.5 50175.5 50509.4 +47718.4 48040.3 48709 49493.5 50175.5 50509.4 47622.8 47914 48527.8 49249.6 49874.4 50175.5 -47389.7 47627 48134.9 48734.2 49249.6 49493.5 -47108.5 47286 47674.6 48134.9 48527.8 48709 -46876.6 47001.2 47286 47627 47914 48040.3 -46781.9 46876.6 47108.5 47389.7 47622.8 47718.3 +47389.7 47627 48135 48734.2 49249.6 49493.5 +47108.5 47286.1 47674.6 48135 48527.8 48709 +46876.6 47001.1 47286.1 47627 47914 48040.3 +46781.9 46876.6 47108.5 47389.7 47622.8 47718.4 -t = 2.00e+00 nst = 165 nfe = 0 nfi = 2661 nni = 1833 hu = 4.14e-02 +t = 2.00e+00 nst = 164 nfe = 0 nfi = 2647 nni = 1824 hu = 1.58e-01 -t = 3.00e+00 nst = 177 nfe = 0 nfi = 2848 nni = 1960 hu = 1.08e-01 +t = 3.00e+00 nst = 170 nfe = 0 nfi = 2737 nni = 1884 hu = 1.58e-01 -t = 4.00e+00 nst = 187 nfe = 0 nfi = 3013 nni = 2073 hu = 1.23e-01 +t = 4.00e+00 nst = 176 nfe = 0 nfi = 2843 nni = 1955 hu = 1.85e-01 c values at t = 4: @@ -280,33 +280,33 @@ Species 3 Species 4 35860.6 36110.2 36632.4 37246.4 37779.5 38038.7 -35784.2 36010.4 36490.4 37056.3 37545.3 37779.5 +35784.2 36010.4 36490.4 37056.3 37545.4 37779.5 35597.2 35782 36180.5 36651.6 37056.3 37246.4 -35371.4 35510.4 35816.7 36180.5 36490.4 36632.4 -35185.4 35283.8 35510.4 35782 36010.4 36110.2 -35109.7 35185.4 35371.4 35597.2 35784.2 35860.6 +35371.4 35510.3 35816.7 36180.5 36490.4 36632.4 +35185.4 35283.8 35510.3 35782 36010.4 36110.2 +35109.8 35185.4 35371.4 35597.2 35784.2 35860.6 Species 5 35860.6 36110.2 36632.4 37246.4 37779.5 38038.7 -35784.2 36010.4 36490.4 37056.3 37545.3 37779.5 +35784.2 36010.4 36490.4 37056.3 37545.4 37779.5 35597.2 35782 36180.5 36651.6 37056.3 37246.4 -35371.4 35510.4 35816.7 36180.5 36490.4 36632.4 -35185.4 35283.8 35510.4 35782 36010.4 36110.2 -35109.7 35185.4 35371.4 35597.2 35784.2 35860.6 +35371.4 35510.3 35816.7 36180.5 36490.4 36632.4 +35185.4 35283.8 35510.3 35782 36010.4 36110.2 +35109.8 35185.4 35371.4 35597.2 35784.2 35860.6 Species 6 35860.6 36110.2 36632.4 37246.4 37779.5 38038.7 -35784.2 36010.4 36490.4 37056.3 37545.3 37779.5 +35784.2 36010.4 36490.4 37056.3 37545.4 37779.5 35597.2 35782 36180.5 36651.6 37056.3 37246.4 -35371.4 35510.4 35816.7 36180.5 36490.4 36632.4 -35185.4 35283.8 35510.4 35782 36010.4 36110.2 -35109.7 35185.4 35371.4 35597.2 35784.2 35860.6 +35371.4 35510.3 35816.7 36180.5 36490.4 36632.4 +35185.4 35283.8 35510.3 35782 36010.4 36110.2 +35109.8 35185.4 35371.4 35597.2 35784.2 35860.6 -t = 5.00e+00 nst = 198 nfe = 0 nfi = 3179 nni = 2182 hu = 9.99e-02 +t = 5.00e+00 nst = 181 nfe = 0 nfi = 2911 nni = 1998 hu = 2.46e-01 -t = 6.00e+00 nst = 207 nfe = 0 nfi = 3336 nni = 2284 hu = 9.66e-02 +t = 6.00e+00 nst = 184 nfe = 0 nfi = 2950 nni = 2022 hu = 3.05e-01 -t = 7.00e+00 nst = 216 nfe = 0 nfi = 3477 nni = 2375 hu = 1.51e-01 +t = 7.00e+00 nst = 186 nfe = 0 nfi = 2975 nni = 2037 hu = 4.87e-01 c values at t = 7: @@ -335,34 +335,34 @@ Species 3 1.16363 1.16614 1.17231 1.1798 1.18601 1.18854 Species 4 -35656.3 35903.1 36424.2 37033.8 37564.6 37822.3 -35578.4 35804.9 36281.3 36845.5 37330.9 37564.6 -35393.9 35575.9 35974.4 36441.4 36845.5 37033.8 -35167.5 35307.4 35610.6 35974.4 36281.3 36424.2 -34984.3 35080.2 35307.4 35575.9 35804.9 35903.1 -34907.5 34984.3 35167.5 35393.9 35578.4 35656.3 +35655.3 35903.6 36423.2 37034.1 37564.4 37822.3 +35579.3 35804.3 36281.9 36844.9 37331.5 37564.4 +35393.1 35577 35973.5 36442.3 36844.9 37034.1 +35168.4 35306.6 35611.5 35973.5 36281.9 36423.2 +34983.3 35081.1 35306.6 35577 35804.3 35903.6 +34907.9 34983.3 35168.4 35393.1 35579.3 35655.3 Species 5 -35656.3 35903.1 36424.2 37033.8 37564.6 37822.3 -35578.4 35804.9 36281.3 36845.5 37330.9 37564.6 -35393.9 35575.9 35974.4 36441.4 36845.5 37033.8 -35167.5 35307.4 35610.6 35974.4 36281.3 36424.2 -34984.3 35080.2 35307.4 35575.9 35804.9 35903.1 -34907.5 34984.3 35167.5 35393.9 35578.4 35656.3 +35655.3 35903.6 36423.2 37034.1 37564.4 37822.3 +35579.3 35804.3 36281.9 36844.9 37331.5 37564.4 +35393.1 35577 35973.5 36442.3 36844.9 37034.1 +35168.4 35306.6 35611.5 35973.5 36281.9 36423.2 +34983.3 35081.1 35306.6 35577 35804.3 35903.6 +34907.9 34983.3 35168.4 35393.1 35579.3 35655.3 Species 6 -35656.3 35903.1 36424.2 37033.8 37564.6 37822.3 -35578.4 35804.9 36281.3 36845.5 37330.9 37564.6 -35393.9 35575.9 35974.4 36441.4 36845.5 37033.8 -35167.5 35307.4 35610.6 35974.4 36281.3 36424.2 -34984.3 35080.2 35307.4 35575.9 35804.9 35903.1 -34907.5 34984.3 35167.5 35393.9 35578.4 35656.3 +35655.3 35903.6 36423.2 37034.1 37564.4 37822.3 +35579.3 35804.3 36281.9 36844.9 37331.5 37564.4 +35393.1 35577 35973.5 36442.3 36844.9 37034.1 +35168.4 35306.6 35611.5 35973.5 36281.9 36423.2 +34983.3 35081.1 35306.6 35577 35804.3 35903.6 +34907.9 34983.3 35168.4 35393.1 35579.3 35655.3 -t = 8.00e+00 nst = 232 nfe = 0 nfi = 3780 nni = 2567 hu = 1.06e-01 +t = 8.00e+00 nst = 188 nfe = 0 nfi = 3003 nni = 2055 hu = 7.64e-01 -t = 9.00e+00 nst = 249 nfe = 0 nfi = 4075 nni = 2742 hu = 8.61e-02 +t = 9.00e+00 nst = 189 nfe = 0 nfi = 3015 nni = 2062 hu = 7.64e-01 -t = 1.00e+01 nst = 266 nfe = 0 nfi = 4394 nni = 2941 hu = 8.37e-02 +t = 1.00e+01 nst = 190 nfe = 0 nfi = 3030 nni = 2072 hu = 1.57e+00 c values at t = 10: @@ -391,27 +391,27 @@ Species 3 1.16347 1.16598 1.17215 1.17964 1.18585 1.18838 Species 4 -35650.6 35898.8 36418.4 37029.2 37559.5 37817.3 +35650.6 35898.8 36418.3 37029.2 37559.5 37817.3 35574.5 35799.5 36277.1 36840 37326.6 37559.5 -35388.4 35572.3 35968.8 36437.5 36840 37029.2 -35163.7 35302 35606.7 35968.8 36277.1 36418.4 -34978.6 35076.5 35302 35572.3 35799.5 35898.8 +35388.4 35572.3 35968.7 36437.4 36840 37029.2 +35163.7 35301.9 35606.7 35968.7 36277.1 36418.3 +34978.6 35076.5 35301.9 35572.3 35799.5 35898.8 34903.3 34978.6 35163.7 35388.4 35574.5 35650.6 Species 5 -35650.6 35898.8 36418.4 37029.2 37559.5 37817.3 +35650.6 35898.8 36418.3 37029.2 37559.5 37817.3 35574.5 35799.5 36277.1 36840 37326.6 37559.5 -35388.4 35572.3 35968.8 36437.5 36840 37029.2 -35163.7 35302 35606.7 35968.8 36277.1 36418.4 -34978.6 35076.5 35302 35572.3 35799.5 35898.8 +35388.4 35572.3 35968.7 36437.4 36840 37029.2 +35163.7 35301.9 35606.7 35968.7 36277.1 36418.3 +34978.6 35076.5 35301.9 35572.3 35799.5 35898.8 34903.3 34978.6 35163.7 35388.4 35574.5 35650.6 Species 6 -35650.6 35898.8 36418.4 37029.2 37559.5 37817.3 +35650.6 35898.8 36418.3 37029.2 37559.5 37817.3 35574.5 35799.5 36277.1 36840 37326.6 37559.5 -35388.4 35572.3 35968.8 36437.5 36840 37029.2 -35163.7 35302 35606.7 35968.8 36277.1 36418.4 -34978.6 35076.5 35302 35572.3 35799.5 35898.8 +35388.4 35572.3 35968.7 36437.4 36840 37029.2 +35163.7 35301.9 35606.7 35968.7 36277.1 36418.3 +34978.6 35076.5 35301.9 35572.3 35799.5 35898.8 34903.3 34978.6 35163.7 35388.4 35574.5 35650.6 @@ -422,20 +422,20 @@ Species 6 ARKStep integer workspace length = 131 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 - Number of steps = 266 + Number of steps = 190 Number of f-s (explicit) = 0 - Number of f-s (implicit) = 4394 - Number of f-s (SPGMR) = 8980 - Number of f-s (TOTAL) = 8980 - Number of setups = 121 - Number of nonlinear iterations = 2941 - Number of linear iterations = 8980 - Number of preconditioner evaluations = 121 - Number of preconditioner solves = 11819 - Number of error test failures = 23 - Number of nonlinear conv. failures = 17 - Number of linear convergence failures = 509 - Average Krylov subspace dimension = 3.053 + Number of f-s (implicit) = 3030 + Number of f-s (SPGMR) = 6097 + Number of f-s (TOTAL) = 6097 + Number of setups = 38 + Number of nonlinear iterations = 2072 + Number of linear iterations = 6097 + Number of preconditioner evaluations = 38 + Number of preconditioner solves = 8080 + Number of error test failures = 1 + Number of nonlinear conv. failures = 0 + Number of linear convergence failures = 182 + Average Krylov subspace dimension = 2.943 ---------------------------------------------------------------------------- @@ -459,52 +459,52 @@ t = 1.00e-04 nst = 106 nfe = 0 nfi = 1688 nni = 1155 hu = 1.70e-05 t = 1.00e-03 nst = 110 nfe = 0 nfi = 1750 nni = 1197 hu = 1.51e-03 -t = 1.00e-02 nst = 113 nfe = 0 nfi = 1797 nni = 1229 hu = 3.46e-03 +t = 1.00e-02 nst = 113 nfe = 0 nfi = 1797 nni = 1229 hu = 3.43e-03 -t = 1.00e-01 nst = 127 nfe = 0 nfi = 2024 nni = 1386 hu = 1.28e-02 +t = 1.00e-01 nst = 127 nfe = 0 nfi = 2023 nni = 1385 hu = 1.25e-02 -t = 1.00e+00 nst = 154 nfe = 0 nfi = 2491 nni = 1718 hu = 7.60e-02 +t = 1.00e+00 nst = 153 nfe = 0 nfi = 2474 nni = 1706 hu = 6.52e-02 -t = 2.00e+00 nst = 169 nfe = 0 nfi = 2746 nni = 1896 hu = 8.04e-02 +t = 2.00e+00 nst = 164 nfe = 0 nfi = 2647 nni = 1824 hu = 1.58e-01 -t = 3.00e+00 nst = 181 nfe = 0 nfi = 2950 nni = 2036 hu = 1.01e-01 +t = 3.00e+00 nst = 170 nfe = 0 nfi = 2737 nni = 1884 hu = 1.58e-01 -t = 4.00e+00 nst = 189 nfe = 0 nfi = 3073 nni = 2119 hu = 1.33e-01 +t = 4.00e+00 nst = 176 nfe = 0 nfi = 2843 nni = 1955 hu = 1.85e-01 -t = 5.00e+00 nst = 199 nfe = 0 nfi = 3242 nni = 2227 hu = 9.38e-02 +t = 5.00e+00 nst = 181 nfe = 0 nfi = 2911 nni = 1998 hu = 2.46e-01 -t = 6.00e+00 nst = 211 nfe = 0 nfi = 3442 nni = 2352 hu = 1.13e-01 +t = 6.00e+00 nst = 184 nfe = 0 nfi = 2950 nni = 2022 hu = 3.05e-01 -t = 7.00e+00 nst = 220 nfe = 0 nfi = 3612 nni = 2457 hu = 1.07e-01 +t = 7.00e+00 nst = 186 nfe = 0 nfi = 2975 nni = 2037 hu = 4.86e-01 -t = 8.00e+00 nst = 229 nfe = 0 nfi = 3747 nni = 2537 hu = 1.33e-01 +t = 8.00e+00 nst = 188 nfe = 0 nfi = 3003 nni = 2055 hu = 7.64e-01 -t = 9.00e+00 nst = 239 nfe = 0 nfi = 3897 nni = 2622 hu = 8.98e-02 +t = 9.00e+00 nst = 189 nfe = 0 nfi = 3015 nni = 2062 hu = 7.64e-01 -t = 1.00e+01 nst = 251 nfe = 0 nfi = 4101 nni = 2746 hu = 7.09e-02 +t = 1.00e+01 nst = 190 nfe = 0 nfi = 3030 nni = 2072 hu = 1.57e+00 Final statistics for this run: ARKStep real workspace length = 3557 - ARKStep integer workspace length = 136 + ARKStep integer workspace length = 136 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 - Number of steps = 251 + Number of steps = 190 Number of f-s (explicit) = 0 - Number of f-s (implicit) = 4101 - Number of f-s (SPGMR) = 8880 - Number of f-s (TOTAL) = 8880 - Number of setups = 91 - Number of nonlinear iterations = 2746 - Number of linear iterations = 8880 - Number of preconditioner evaluations = 91 - Number of preconditioner solves = 11537 - Number of error test failures = 18 - Number of nonlinear conv. failures = 13 - Number of linear convergence failures = 597 - Average Krylov subspace dimension = 3.234 + Number of f-s (implicit) = 3030 + Number of f-s (SPGMR) = 6096 + Number of f-s (TOTAL) = 6096 + Number of setups = 38 + Number of nonlinear iterations = 2072 + Number of linear iterations = 6096 + Number of preconditioner evaluations = 38 + Number of preconditioner solves = 8079 + Number of error test failures = 1 + Number of nonlinear conv. failures = 0 + Number of linear convergence failures = 182 + Average Krylov subspace dimension = 2.942 ---------------------------------------------------------------------------- @@ -526,54 +526,54 @@ t = 1.00e-05 nst = 27 nfe = 0 nfi = 407 nni = 269 hu = 4.79e-07 t = 1.00e-04 nst = 106 nfe = 0 nfi = 1688 nni = 1155 hu = 1.70e-05 -t = 1.00e-03 nst = 110 nfe = 0 nfi = 1750 nni = 1197 hu = 1.50e-03 +t = 1.00e-03 nst = 110 nfe = 0 nfi = 1750 nni = 1197 hu = 1.49e-03 -t = 1.00e-02 nst = 113 nfe = 0 nfi = 1797 nni = 1229 hu = 3.42e-03 +t = 1.00e-02 nst = 113 nfe = 0 nfi = 1799 nni = 1231 hu = 3.79e-03 -t = 1.00e-01 nst = 127 nfe = 0 nfi = 2023 nni = 1385 hu = 1.23e-02 +t = 1.00e-01 nst = 127 nfe = 0 nfi = 2028 nni = 1390 hu = 1.32e-02 -t = 1.00e+00 nst = 166 nfe = 0 nfi = 2714 nni = 1875 hu = 2.40e-02 +t = 1.00e+00 nst = 164 nfe = 0 nfi = 2669 nni = 1844 hu = 4.98e-02 -t = 2.00e+00 nst = 214 nfe = 0 nfi = 3550 nni = 2460 hu = 2.34e-02 +t = 2.00e+00 nst = 213 nfe = 0 nfi = 3526 nni = 2444 hu = 2.37e-02 -t = 3.00e+00 nst = 249 nfe = 0 nfi = 4111 nni = 2846 hu = 3.57e-02 +t = 3.00e+00 nst = 248 nfe = 0 nfi = 4087 nni = 2830 hu = 3.53e-02 -t = 4.00e+00 nst = 272 nfe = 0 nfi = 4472 nni = 3092 hu = 5.08e-02 +t = 4.00e+00 nst = 272 nfe = 0 nfi = 4465 nni = 3088 hu = 3.22e-02 -t = 5.00e+00 nst = 297 nfe = 0 nfi = 4851 nni = 3346 hu = 5.14e-02 +t = 5.00e+00 nst = 299 nfe = 0 nfi = 4876 nni = 3363 hu = 3.94e-02 -t = 6.00e+00 nst = 315 nfe = 0 nfi = 5117 nni = 3522 hu = 6.88e-02 +t = 6.00e+00 nst = 316 nfe = 0 nfi = 5130 nni = 3532 hu = 6.86e-02 -t = 7.00e+00 nst = 328 nfe = 0 nfi = 5302 nni = 3642 hu = 8.22e-02 +t = 7.00e+00 nst = 329 nfe = 0 nfi = 5315 nni = 3652 hu = 8.22e-02 -t = 8.00e+00 nst = 338 nfe = 0 nfi = 5441 nni = 3731 hu = 8.52e-02 +t = 8.00e+00 nst = 339 nfe = 0 nfi = 5455 nni = 3742 hu = 1.18e-01 -t = 9.00e+00 nst = 349 nfe = 0 nfi = 5592 nni = 3827 hu = 1.11e-01 +t = 9.00e+00 nst = 345 nfe = 0 nfi = 5536 nni = 3793 hu = 2.11e-01 -t = 1.00e+01 nst = 359 nfe = 0 nfi = 5722 nni = 3907 hu = 1.35e-01 +t = 1.00e+01 nst = 349 nfe = 0 nfi = 5589 nni = 3826 hu = 2.80e-01 Final statistics for this run: ARKStep real workspace length = 3557 - ARKStep integer workspace length = 141 + ARKStep integer workspace length = 141 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 - Number of steps = 359 + Number of steps = 349 Number of f-s (explicit) = 0 - Number of f-s (implicit) = 5722 - Number of f-s (SPGMR) = 12904 - Number of f-s (TOTAL) = 12904 - Number of setups = 253 - Number of nonlinear iterations = 3907 - Number of linear iterations = 12904 - Number of preconditioner evaluations = 253 - Number of preconditioner solves = 16594 + Number of f-s (implicit) = 5589 + Number of f-s (SPGMR) = 12378 + Number of f-s (TOTAL) = 12378 + Number of setups = 244 + Number of nonlinear iterations = 3826 + Number of linear iterations = 12378 + Number of preconditioner evaluations = 244 + Number of preconditioner solves = 15957 Number of error test failures = 0 - Number of nonlinear conv. failures = 117 - Number of linear convergence failures = 1072 - Average Krylov subspace dimension = 3.303 + Number of nonlinear conv. failures = 113 + Number of linear convergence failures = 977 + Average Krylov subspace dimension = 3.235 ---------------------------------------------------------------------------- @@ -595,54 +595,54 @@ t = 1.00e-05 nst = 27 nfe = 0 nfi = 407 nni = 269 hu = 4.79e-07 t = 1.00e-04 nst = 106 nfe = 0 nfi = 1688 nni = 1155 hu = 1.70e-05 -t = 1.00e-03 nst = 110 nfe = 0 nfi = 1750 nni = 1197 hu = 1.50e-03 +t = 1.00e-03 nst = 110 nfe = 0 nfi = 1750 nni = 1197 hu = 1.49e-03 -t = 1.00e-02 nst = 113 nfe = 0 nfi = 1797 nni = 1229 hu = 3.42e-03 +t = 1.00e-02 nst = 113 nfe = 0 nfi = 1799 nni = 1231 hu = 3.79e-03 -t = 1.00e-01 nst = 127 nfe = 0 nfi = 2023 nni = 1385 hu = 1.23e-02 +t = 1.00e-01 nst = 127 nfe = 0 nfi = 2028 nni = 1390 hu = 1.32e-02 -t = 1.00e+00 nst = 166 nfe = 0 nfi = 2714 nni = 1875 hu = 2.40e-02 +t = 1.00e+00 nst = 164 nfe = 0 nfi = 2669 nni = 1844 hu = 4.98e-02 -t = 2.00e+00 nst = 214 nfe = 0 nfi = 3556 nni = 2465 hu = 2.34e-02 +t = 2.00e+00 nst = 213 nfe = 0 nfi = 3526 nni = 2444 hu = 2.37e-02 -t = 3.00e+00 nst = 249 nfe = 0 nfi = 4117 nni = 2851 hu = 3.57e-02 +t = 3.00e+00 nst = 248 nfe = 0 nfi = 4087 nni = 2830 hu = 3.53e-02 -t = 4.00e+00 nst = 272 nfe = 0 nfi = 4478 nni = 3097 hu = 5.08e-02 +t = 4.00e+00 nst = 272 nfe = 0 nfi = 4465 nni = 3088 hu = 3.22e-02 -t = 5.00e+00 nst = 297 nfe = 0 nfi = 4857 nni = 3351 hu = 5.14e-02 +t = 5.00e+00 nst = 299 nfe = 0 nfi = 4876 nni = 3363 hu = 3.94e-02 -t = 6.00e+00 nst = 315 nfe = 0 nfi = 5123 nni = 3527 hu = 6.89e-02 +t = 6.00e+00 nst = 316 nfe = 0 nfi = 5130 nni = 3532 hu = 6.86e-02 -t = 7.00e+00 nst = 328 nfe = 0 nfi = 5308 nni = 3647 hu = 9.31e-02 +t = 7.00e+00 nst = 329 nfe = 0 nfi = 5315 nni = 3652 hu = 8.22e-02 -t = 8.00e+00 nst = 339 nfe = 0 nfi = 5464 nni = 3748 hu = 9.70e-02 +t = 8.00e+00 nst = 339 nfe = 0 nfi = 5455 nni = 3742 hu = 1.19e-01 -t = 9.00e+00 nst = 349 nfe = 0 nfi = 5598 nni = 3832 hu = 1.12e-01 +t = 9.00e+00 nst = 345 nfe = 0 nfi = 5536 nni = 3793 hu = 2.11e-01 -t = 1.00e+01 nst = 359 nfe = 0 nfi = 5728 nni = 3912 hu = 1.31e-01 +t = 1.00e+01 nst = 349 nfe = 0 nfi = 5589 nni = 3826 hu = 2.80e-01 Final statistics for this run: ARKStep real workspace length = 3557 - ARKStep integer workspace length = 146 + ARKStep integer workspace length = 146 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 - Number of steps = 359 + Number of steps = 349 Number of f-s (explicit) = 0 - Number of f-s (implicit) = 5728 - Number of f-s (SPGMR) = 12934 - Number of f-s (TOTAL) = 12934 - Number of setups = 254 - Number of nonlinear iterations = 3912 - Number of linear iterations = 12934 - Number of preconditioner evaluations = 254 - Number of preconditioner solves = 16627 + Number of f-s (implicit) = 5589 + Number of f-s (SPGMR) = 12378 + Number of f-s (TOTAL) = 12378 + Number of setups = 244 + Number of nonlinear iterations = 3826 + Number of linear iterations = 12378 + Number of preconditioner evaluations = 244 + Number of preconditioner solves = 15957 Number of error test failures = 0 - Number of nonlinear conv. failures = 118 - Number of linear convergence failures = 1076 - Average Krylov subspace dimension = 3.306 + Number of nonlinear conv. failures = 113 + Number of linear convergence failures = 976 + Average Krylov subspace dimension = 3.235 ---------------------------------------------------------------------------- diff --git a/examples/arkode/C_serial/ark_KrylovDemo_prec_2.out b/examples/arkode/C_serial/ark_KrylovDemo_prec_2.out index 1af6fb8046..a3f589f739 100644 --- a/examples/arkode/C_serial/ark_KrylovDemo_prec_2.out +++ b/examples/arkode/C_serial/ark_KrylovDemo_prec_2.out @@ -190,18 +190,18 @@ Species 6 297691 307208 319252 319264 307245 297749 297229 297691 298276 298276 297692 297231 -t = 1.00e-02 nst = 113 nfe = 0 nfi = 1797 nni = 1229 hu = 3.46e-03 +t = 1.00e-02 nst = 113 nfe = 0 nfi = 1797 nni = 1229 hu = 3.43e-03 -t = 1.00e-01 nst = 127 nfe = 0 nfi = 2024 nni = 1386 hu = 1.28e-02 +t = 1.00e-01 nst = 127 nfe = 0 nfi = 2023 nni = 1385 hu = 1.25e-02 -t = 1.00e+00 nst = 154 nfe = 0 nfi = 2489 nni = 1716 hu = 6.84e-02 +t = 1.00e+00 nst = 153 nfe = 0 nfi = 2474 nni = 1706 hu = 6.52e-02 c values at t = 1: Species 1 -1.58851 1.59924 1.62152 1.64764 1.67036 1.68149 +1.58851 1.59924 1.62152 1.64765 1.67036 1.68149 1.58533 1.59503 1.61548 1.63952 1.66033 1.67036 -1.57757 1.58547 1.60239 1.62235 1.63952 1.64764 +1.57757 1.58547 1.60239 1.62235 1.63952 1.64765 1.5682 1.57412 1.58706 1.60239 1.61548 1.62152 1.56048 1.56463 1.57412 1.58547 1.59503 1.59924 1.55733 1.56048 1.5682 1.57757 1.58533 1.58851 @@ -210,7 +210,7 @@ Species 2 1.59067 1.60141 1.62371 1.64987 1.67261 1.68375 1.58748 1.5972 1.61766 1.64173 1.66257 1.67261 1.57971 1.58763 1.60457 1.62454 1.64173 1.64987 -1.57034 1.57626 1.58921 1.60457 1.61766 1.62371 +1.57034 1.57626 1.58922 1.60457 1.61766 1.62371 1.56261 1.56676 1.57626 1.58763 1.5972 1.60141 1.55945 1.56261 1.57034 1.57971 1.58748 1.59067 @@ -223,34 +223,34 @@ Species 3 1.56146 1.56462 1.57236 1.58174 1.58951 1.5927 Species 4 -47718.3 48040.3 48709 49493.5 50175.5 50509.4 +47718.4 48040.3 48709 49493.5 50175.5 50509.4 47622.8 47914 48527.8 49249.6 49874.4 50175.5 -47389.7 47627 48134.9 48734.2 49249.6 49493.5 -47108.5 47286 47674.6 48134.9 48527.8 48709 -46876.6 47001.2 47286 47627 47914 48040.3 -46781.9 46876.6 47108.5 47389.7 47622.8 47718.3 +47389.7 47627 48135 48734.2 49249.6 49493.5 +47108.5 47286.1 47674.6 48135 48527.8 48709 +46876.6 47001.1 47286.1 47627 47914 48040.3 +46781.9 46876.6 47108.5 47389.7 47622.8 47718.4 Species 5 -47718.3 48040.3 48709 49493.5 50175.5 50509.4 +47718.4 48040.3 48709 49493.5 50175.5 50509.4 47622.8 47914 48527.8 49249.6 49874.4 50175.5 -47389.7 47627 48134.9 48734.2 49249.6 49493.5 -47108.5 47286 47674.6 48134.9 48527.8 48709 -46876.6 47001.2 47286 47627 47914 48040.3 -46781.9 46876.6 47108.5 47389.7 47622.8 47718.3 +47389.7 47627 48135 48734.2 49249.6 49493.5 +47108.5 47286.1 47674.6 48135 48527.8 48709 +46876.6 47001.1 47286.1 47627 47914 48040.3 +46781.9 46876.6 47108.5 47389.7 47622.8 47718.4 Species 6 -47718.3 48040.3 48709 49493.5 50175.5 50509.4 +47718.4 48040.3 48709 49493.5 50175.5 50509.4 47622.8 47914 48527.8 49249.6 49874.4 50175.5 -47389.7 47627 48134.9 48734.2 49249.6 49493.5 -47108.5 47286 47674.6 48134.9 48527.8 48709 -46876.6 47001.2 47286 47627 47914 48040.3 -46781.9 46876.6 47108.5 47389.7 47622.8 47718.3 +47389.7 47627 48135 48734.2 49249.6 49493.5 +47108.5 47286.1 47674.6 48135 48527.8 48709 +46876.6 47001.1 47286.1 47627 47914 48040.3 +46781.9 46876.6 47108.5 47389.7 47622.8 47718.4 -t = 2.00e+00 nst = 165 nfe = 0 nfi = 2661 nni = 1833 hu = 4.14e-02 +t = 2.00e+00 nst = 164 nfe = 0 nfi = 2647 nni = 1824 hu = 1.58e-01 -t = 3.00e+00 nst = 177 nfe = 0 nfi = 2848 nni = 1960 hu = 1.08e-01 +t = 3.00e+00 nst = 170 nfe = 0 nfi = 2737 nni = 1884 hu = 1.58e-01 -t = 4.00e+00 nst = 187 nfe = 0 nfi = 3013 nni = 2073 hu = 1.23e-01 +t = 4.00e+00 nst = 176 nfe = 0 nfi = 2843 nni = 1955 hu = 1.85e-01 c values at t = 4: @@ -280,33 +280,33 @@ Species 3 Species 4 35860.6 36110.2 36632.4 37246.4 37779.5 38038.7 -35784.2 36010.4 36490.4 37056.3 37545.3 37779.5 +35784.2 36010.4 36490.4 37056.3 37545.4 37779.5 35597.2 35782 36180.5 36651.6 37056.3 37246.4 -35371.4 35510.4 35816.7 36180.5 36490.4 36632.4 -35185.4 35283.8 35510.4 35782 36010.4 36110.2 -35109.7 35185.4 35371.4 35597.2 35784.2 35860.6 +35371.4 35510.3 35816.7 36180.5 36490.4 36632.4 +35185.4 35283.8 35510.3 35782 36010.4 36110.2 +35109.8 35185.4 35371.4 35597.2 35784.2 35860.6 Species 5 35860.6 36110.2 36632.4 37246.4 37779.5 38038.7 -35784.2 36010.4 36490.4 37056.3 37545.3 37779.5 +35784.2 36010.4 36490.4 37056.3 37545.4 37779.5 35597.2 35782 36180.5 36651.6 37056.3 37246.4 -35371.4 35510.4 35816.7 36180.5 36490.4 36632.4 -35185.4 35283.8 35510.4 35782 36010.4 36110.2 -35109.7 35185.4 35371.4 35597.2 35784.2 35860.6 +35371.4 35510.3 35816.7 36180.5 36490.4 36632.4 +35185.4 35283.8 35510.3 35782 36010.4 36110.2 +35109.8 35185.4 35371.4 35597.2 35784.2 35860.6 Species 6 35860.6 36110.2 36632.4 37246.4 37779.5 38038.7 -35784.2 36010.4 36490.4 37056.3 37545.3 37779.5 +35784.2 36010.4 36490.4 37056.3 37545.4 37779.5 35597.2 35782 36180.5 36651.6 37056.3 37246.4 -35371.4 35510.4 35816.7 36180.5 36490.4 36632.4 -35185.4 35283.8 35510.4 35782 36010.4 36110.2 -35109.7 35185.4 35371.4 35597.2 35784.2 35860.6 +35371.4 35510.3 35816.7 36180.5 36490.4 36632.4 +35185.4 35283.8 35510.3 35782 36010.4 36110.2 +35109.8 35185.4 35371.4 35597.2 35784.2 35860.6 -t = 5.00e+00 nst = 198 nfe = 0 nfi = 3179 nni = 2182 hu = 9.99e-02 +t = 5.00e+00 nst = 181 nfe = 0 nfi = 2911 nni = 1998 hu = 2.46e-01 -t = 6.00e+00 nst = 207 nfe = 0 nfi = 3336 nni = 2284 hu = 9.66e-02 +t = 6.00e+00 nst = 184 nfe = 0 nfi = 2950 nni = 2022 hu = 3.05e-01 -t = 7.00e+00 nst = 216 nfe = 0 nfi = 3477 nni = 2375 hu = 1.51e-01 +t = 7.00e+00 nst = 186 nfe = 0 nfi = 2975 nni = 2037 hu = 4.87e-01 c values at t = 7: @@ -335,34 +335,34 @@ Species 3 1.16363 1.16614 1.17231 1.1798 1.18601 1.18854 Species 4 -35656.3 35903.1 36424.2 37033.8 37564.6 37822.3 -35578.4 35804.9 36281.3 36845.5 37330.9 37564.6 -35393.9 35575.9 35974.4 36441.4 36845.5 37033.8 -35167.5 35307.4 35610.6 35974.4 36281.3 36424.2 -34984.3 35080.2 35307.4 35575.9 35804.9 35903.1 -34907.5 34984.3 35167.5 35393.9 35578.4 35656.3 +35655.3 35903.6 36423.2 37034.1 37564.4 37822.3 +35579.3 35804.3 36281.9 36844.9 37331.5 37564.4 +35393.1 35577 35973.5 36442.3 36844.9 37034.1 +35168.4 35306.6 35611.5 35973.5 36281.9 36423.2 +34983.3 35081.1 35306.6 35577 35804.3 35903.6 +34907.9 34983.3 35168.4 35393.1 35579.3 35655.3 Species 5 -35656.3 35903.1 36424.2 37033.8 37564.6 37822.3 -35578.4 35804.9 36281.3 36845.5 37330.9 37564.6 -35393.9 35575.9 35974.4 36441.4 36845.5 37033.8 -35167.5 35307.4 35610.6 35974.4 36281.3 36424.2 -34984.3 35080.2 35307.4 35575.9 35804.9 35903.1 -34907.5 34984.3 35167.5 35393.9 35578.4 35656.3 +35655.3 35903.6 36423.2 37034.1 37564.4 37822.3 +35579.3 35804.3 36281.9 36844.9 37331.5 37564.4 +35393.1 35577 35973.5 36442.3 36844.9 37034.1 +35168.4 35306.6 35611.5 35973.5 36281.9 36423.2 +34983.3 35081.1 35306.6 35577 35804.3 35903.6 +34907.9 34983.3 35168.4 35393.1 35579.3 35655.3 Species 6 -35656.3 35903.1 36424.2 37033.8 37564.6 37822.3 -35578.4 35804.9 36281.3 36845.5 37330.9 37564.6 -35393.9 35575.9 35974.4 36441.4 36845.5 37033.8 -35167.5 35307.4 35610.6 35974.4 36281.3 36424.2 -34984.3 35080.2 35307.4 35575.9 35804.9 35903.1 -34907.5 34984.3 35167.5 35393.9 35578.4 35656.3 +35655.3 35903.6 36423.2 37034.1 37564.4 37822.3 +35579.3 35804.3 36281.9 36844.9 37331.5 37564.4 +35393.1 35577 35973.5 36442.3 36844.9 37034.1 +35168.4 35306.6 35611.5 35973.5 36281.9 36423.2 +34983.3 35081.1 35306.6 35577 35804.3 35903.6 +34907.9 34983.3 35168.4 35393.1 35579.3 35655.3 -t = 8.00e+00 nst = 232 nfe = 0 nfi = 3780 nni = 2567 hu = 1.06e-01 +t = 8.00e+00 nst = 188 nfe = 0 nfi = 3003 nni = 2055 hu = 7.64e-01 -t = 9.00e+00 nst = 249 nfe = 0 nfi = 4075 nni = 2742 hu = 8.61e-02 +t = 9.00e+00 nst = 189 nfe = 0 nfi = 3015 nni = 2062 hu = 7.64e-01 -t = 1.00e+01 nst = 266 nfe = 0 nfi = 4394 nni = 2941 hu = 8.37e-02 +t = 1.00e+01 nst = 190 nfe = 0 nfi = 3030 nni = 2072 hu = 1.57e+00 c values at t = 10: @@ -391,27 +391,27 @@ Species 3 1.16347 1.16598 1.17215 1.17964 1.18585 1.18838 Species 4 -35650.6 35898.8 36418.4 37029.2 37559.5 37817.3 +35650.6 35898.8 36418.3 37029.2 37559.5 37817.3 35574.5 35799.5 36277.1 36840 37326.6 37559.5 -35388.4 35572.3 35968.8 36437.5 36840 37029.2 -35163.7 35302 35606.7 35968.8 36277.1 36418.4 -34978.6 35076.5 35302 35572.3 35799.5 35898.8 +35388.4 35572.3 35968.7 36437.4 36840 37029.2 +35163.7 35301.9 35606.7 35968.7 36277.1 36418.3 +34978.6 35076.5 35301.9 35572.3 35799.5 35898.8 34903.3 34978.6 35163.7 35388.4 35574.5 35650.6 Species 5 -35650.6 35898.8 36418.4 37029.2 37559.5 37817.3 +35650.6 35898.8 36418.3 37029.2 37559.5 37817.3 35574.5 35799.5 36277.1 36840 37326.6 37559.5 -35388.4 35572.3 35968.8 36437.5 36840 37029.2 -35163.7 35302 35606.7 35968.8 36277.1 36418.4 -34978.6 35076.5 35302 35572.3 35799.5 35898.8 +35388.4 35572.3 35968.7 36437.4 36840 37029.2 +35163.7 35301.9 35606.7 35968.7 36277.1 36418.3 +34978.6 35076.5 35301.9 35572.3 35799.5 35898.8 34903.3 34978.6 35163.7 35388.4 35574.5 35650.6 Species 6 -35650.6 35898.8 36418.4 37029.2 37559.5 37817.3 +35650.6 35898.8 36418.3 37029.2 37559.5 37817.3 35574.5 35799.5 36277.1 36840 37326.6 37559.5 -35388.4 35572.3 35968.8 36437.5 36840 37029.2 -35163.7 35302 35606.7 35968.8 36277.1 36418.4 -34978.6 35076.5 35302 35572.3 35799.5 35898.8 +35388.4 35572.3 35968.7 36437.4 36840 37029.2 +35163.7 35301.9 35606.7 35968.7 36277.1 36418.3 +34978.6 35076.5 35301.9 35572.3 35799.5 35898.8 34903.3 34978.6 35163.7 35388.4 35574.5 35650.6 @@ -419,23 +419,23 @@ Species 6 Final statistics for this run: ARKStep real workspace length = 3557 - ARKStep integer workspace length = 131 + ARKStep integer workspace length = 131 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 - Number of steps = 266 + Number of steps = 190 Number of f-s (explicit) = 0 - Number of f-s (implicit) = 4394 - Number of f-s (SPGMR) = 8980 - Number of f-s (TOTAL) = 8980 - Number of setups = 121 - Number of nonlinear iterations = 2941 - Number of linear iterations = 8980 - Number of preconditioner evaluations = 121 - Number of preconditioner solves = 11819 - Number of error test failures = 23 - Number of nonlinear conv. failures = 17 - Number of linear convergence failures = 509 - Average Krylov subspace dimension = 3.053 + Number of f-s (implicit) = 3030 + Number of f-s (SPGMR) = 6097 + Number of f-s (TOTAL) = 6097 + Number of setups = 38 + Number of nonlinear iterations = 2072 + Number of linear iterations = 6097 + Number of preconditioner evaluations = 38 + Number of preconditioner solves = 8080 + Number of error test failures = 1 + Number of nonlinear conv. failures = 0 + Number of linear convergence failures = 182 + Average Krylov subspace dimension = 2.943 ---------------------------------------------------------------------------- @@ -459,52 +459,52 @@ t = 1.00e-04 nst = 106 nfe = 0 nfi = 1688 nni = 1155 hu = 1.70e-05 t = 1.00e-03 nst = 110 nfe = 0 nfi = 1750 nni = 1197 hu = 1.51e-03 -t = 1.00e-02 nst = 113 nfe = 0 nfi = 1797 nni = 1229 hu = 3.46e-03 +t = 1.00e-02 nst = 113 nfe = 0 nfi = 1797 nni = 1229 hu = 3.43e-03 -t = 1.00e-01 nst = 127 nfe = 0 nfi = 2024 nni = 1386 hu = 1.28e-02 +t = 1.00e-01 nst = 127 nfe = 0 nfi = 2023 nni = 1385 hu = 1.25e-02 -t = 1.00e+00 nst = 154 nfe = 0 nfi = 2491 nni = 1718 hu = 7.60e-02 +t = 1.00e+00 nst = 153 nfe = 0 nfi = 2474 nni = 1706 hu = 6.52e-02 -t = 2.00e+00 nst = 169 nfe = 0 nfi = 2746 nni = 1896 hu = 8.04e-02 +t = 2.00e+00 nst = 164 nfe = 0 nfi = 2647 nni = 1824 hu = 1.58e-01 -t = 3.00e+00 nst = 181 nfe = 0 nfi = 2950 nni = 2036 hu = 1.01e-01 +t = 3.00e+00 nst = 170 nfe = 0 nfi = 2737 nni = 1884 hu = 1.58e-01 -t = 4.00e+00 nst = 189 nfe = 0 nfi = 3073 nni = 2119 hu = 1.33e-01 +t = 4.00e+00 nst = 176 nfe = 0 nfi = 2843 nni = 1955 hu = 1.85e-01 -t = 5.00e+00 nst = 199 nfe = 0 nfi = 3242 nni = 2227 hu = 9.38e-02 +t = 5.00e+00 nst = 181 nfe = 0 nfi = 2911 nni = 1998 hu = 2.46e-01 -t = 6.00e+00 nst = 211 nfe = 0 nfi = 3442 nni = 2352 hu = 1.13e-01 +t = 6.00e+00 nst = 184 nfe = 0 nfi = 2950 nni = 2022 hu = 3.05e-01 -t = 7.00e+00 nst = 220 nfe = 0 nfi = 3612 nni = 2457 hu = 1.07e-01 +t = 7.00e+00 nst = 186 nfe = 0 nfi = 2975 nni = 2037 hu = 4.86e-01 -t = 8.00e+00 nst = 229 nfe = 0 nfi = 3747 nni = 2537 hu = 1.33e-01 +t = 8.00e+00 nst = 188 nfe = 0 nfi = 3003 nni = 2055 hu = 7.64e-01 -t = 9.00e+00 nst = 239 nfe = 0 nfi = 3897 nni = 2622 hu = 8.98e-02 +t = 9.00e+00 nst = 189 nfe = 0 nfi = 3015 nni = 2062 hu = 7.64e-01 -t = 1.00e+01 nst = 251 nfe = 0 nfi = 4101 nni = 2746 hu = 7.09e-02 +t = 1.00e+01 nst = 190 nfe = 0 nfi = 3030 nni = 2072 hu = 1.57e+00 Final statistics for this run: ARKStep real workspace length = 3557 - ARKStep integer workspace length = 136 + ARKStep integer workspace length = 136 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 - Number of steps = 251 + Number of steps = 190 Number of f-s (explicit) = 0 - Number of f-s (implicit) = 4101 - Number of f-s (SPGMR) = 8880 - Number of f-s (TOTAL) = 8880 - Number of setups = 91 - Number of nonlinear iterations = 2746 - Number of linear iterations = 8880 - Number of preconditioner evaluations = 91 - Number of preconditioner solves = 11537 - Number of error test failures = 18 - Number of nonlinear conv. failures = 13 - Number of linear convergence failures = 597 - Average Krylov subspace dimension = 3.234 + Number of f-s (implicit) = 3030 + Number of f-s (SPGMR) = 6096 + Number of f-s (TOTAL) = 6096 + Number of setups = 38 + Number of nonlinear iterations = 2072 + Number of linear iterations = 6096 + Number of preconditioner evaluations = 38 + Number of preconditioner solves = 8079 + Number of error test failures = 1 + Number of nonlinear conv. failures = 0 + Number of linear convergence failures = 182 + Average Krylov subspace dimension = 2.942 ---------------------------------------------------------------------------- @@ -526,54 +526,54 @@ t = 1.00e-05 nst = 27 nfe = 0 nfi = 407 nni = 269 hu = 4.79e-07 t = 1.00e-04 nst = 106 nfe = 0 nfi = 1688 nni = 1155 hu = 1.70e-05 -t = 1.00e-03 nst = 110 nfe = 0 nfi = 1750 nni = 1197 hu = 1.50e-03 +t = 1.00e-03 nst = 110 nfe = 0 nfi = 1750 nni = 1197 hu = 1.49e-03 -t = 1.00e-02 nst = 113 nfe = 0 nfi = 1797 nni = 1229 hu = 3.42e-03 +t = 1.00e-02 nst = 113 nfe = 0 nfi = 1799 nni = 1231 hu = 3.79e-03 -t = 1.00e-01 nst = 127 nfe = 0 nfi = 2023 nni = 1385 hu = 1.23e-02 +t = 1.00e-01 nst = 127 nfe = 0 nfi = 2028 nni = 1390 hu = 1.32e-02 -t = 1.00e+00 nst = 166 nfe = 0 nfi = 2714 nni = 1875 hu = 2.40e-02 +t = 1.00e+00 nst = 164 nfe = 0 nfi = 2669 nni = 1844 hu = 4.98e-02 -t = 2.00e+00 nst = 214 nfe = 0 nfi = 3550 nni = 2460 hu = 2.34e-02 +t = 2.00e+00 nst = 213 nfe = 0 nfi = 3526 nni = 2444 hu = 2.37e-02 -t = 3.00e+00 nst = 249 nfe = 0 nfi = 4111 nni = 2846 hu = 3.57e-02 +t = 3.00e+00 nst = 248 nfe = 0 nfi = 4087 nni = 2830 hu = 3.53e-02 -t = 4.00e+00 nst = 272 nfe = 0 nfi = 4472 nni = 3092 hu = 5.08e-02 +t = 4.00e+00 nst = 272 nfe = 0 nfi = 4465 nni = 3088 hu = 3.22e-02 -t = 5.00e+00 nst = 297 nfe = 0 nfi = 4851 nni = 3346 hu = 5.14e-02 +t = 5.00e+00 nst = 299 nfe = 0 nfi = 4876 nni = 3363 hu = 3.94e-02 -t = 6.00e+00 nst = 315 nfe = 0 nfi = 5117 nni = 3522 hu = 6.88e-02 +t = 6.00e+00 nst = 316 nfe = 0 nfi = 5130 nni = 3532 hu = 6.86e-02 -t = 7.00e+00 nst = 328 nfe = 0 nfi = 5302 nni = 3642 hu = 8.22e-02 +t = 7.00e+00 nst = 329 nfe = 0 nfi = 5315 nni = 3652 hu = 8.22e-02 -t = 8.00e+00 nst = 338 nfe = 0 nfi = 5441 nni = 3731 hu = 8.52e-02 +t = 8.00e+00 nst = 339 nfe = 0 nfi = 5455 nni = 3742 hu = 1.18e-01 -t = 9.00e+00 nst = 349 nfe = 0 nfi = 5592 nni = 3827 hu = 1.11e-01 +t = 9.00e+00 nst = 345 nfe = 0 nfi = 5536 nni = 3793 hu = 2.11e-01 -t = 1.00e+01 nst = 359 nfe = 0 nfi = 5722 nni = 3907 hu = 1.35e-01 +t = 1.00e+01 nst = 349 nfe = 0 nfi = 5589 nni = 3826 hu = 2.80e-01 Final statistics for this run: ARKStep real workspace length = 3557 - ARKStep integer workspace length = 141 + ARKStep integer workspace length = 141 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 - Number of steps = 359 + Number of steps = 349 Number of f-s (explicit) = 0 - Number of f-s (implicit) = 5722 - Number of f-s (SPGMR) = 12904 - Number of f-s (TOTAL) = 12904 - Number of setups = 253 - Number of nonlinear iterations = 3907 - Number of linear iterations = 12904 - Number of preconditioner evaluations = 253 - Number of preconditioner solves = 16594 + Number of f-s (implicit) = 5589 + Number of f-s (SPGMR) = 12378 + Number of f-s (TOTAL) = 12378 + Number of setups = 244 + Number of nonlinear iterations = 3826 + Number of linear iterations = 12378 + Number of preconditioner evaluations = 244 + Number of preconditioner solves = 15957 Number of error test failures = 0 - Number of nonlinear conv. failures = 117 - Number of linear convergence failures = 1072 - Average Krylov subspace dimension = 3.303 + Number of nonlinear conv. failures = 113 + Number of linear convergence failures = 977 + Average Krylov subspace dimension = 3.235 ---------------------------------------------------------------------------- @@ -595,54 +595,54 @@ t = 1.00e-05 nst = 27 nfe = 0 nfi = 407 nni = 269 hu = 4.79e-07 t = 1.00e-04 nst = 106 nfe = 0 nfi = 1688 nni = 1155 hu = 1.70e-05 -t = 1.00e-03 nst = 110 nfe = 0 nfi = 1750 nni = 1197 hu = 1.50e-03 +t = 1.00e-03 nst = 110 nfe = 0 nfi = 1750 nni = 1197 hu = 1.49e-03 -t = 1.00e-02 nst = 113 nfe = 0 nfi = 1797 nni = 1229 hu = 3.42e-03 +t = 1.00e-02 nst = 113 nfe = 0 nfi = 1799 nni = 1231 hu = 3.79e-03 -t = 1.00e-01 nst = 127 nfe = 0 nfi = 2023 nni = 1385 hu = 1.23e-02 +t = 1.00e-01 nst = 127 nfe = 0 nfi = 2028 nni = 1390 hu = 1.32e-02 -t = 1.00e+00 nst = 166 nfe = 0 nfi = 2714 nni = 1875 hu = 2.40e-02 +t = 1.00e+00 nst = 164 nfe = 0 nfi = 2669 nni = 1844 hu = 4.98e-02 -t = 2.00e+00 nst = 214 nfe = 0 nfi = 3556 nni = 2465 hu = 2.34e-02 +t = 2.00e+00 nst = 213 nfe = 0 nfi = 3526 nni = 2444 hu = 2.37e-02 -t = 3.00e+00 nst = 249 nfe = 0 nfi = 4117 nni = 2851 hu = 3.57e-02 +t = 3.00e+00 nst = 248 nfe = 0 nfi = 4087 nni = 2830 hu = 3.53e-02 -t = 4.00e+00 nst = 272 nfe = 0 nfi = 4478 nni = 3097 hu = 5.08e-02 +t = 4.00e+00 nst = 272 nfe = 0 nfi = 4465 nni = 3088 hu = 3.22e-02 -t = 5.00e+00 nst = 297 nfe = 0 nfi = 4857 nni = 3351 hu = 5.14e-02 +t = 5.00e+00 nst = 299 nfe = 0 nfi = 4876 nni = 3363 hu = 3.94e-02 -t = 6.00e+00 nst = 315 nfe = 0 nfi = 5123 nni = 3527 hu = 6.89e-02 +t = 6.00e+00 nst = 316 nfe = 0 nfi = 5130 nni = 3532 hu = 6.86e-02 -t = 7.00e+00 nst = 328 nfe = 0 nfi = 5308 nni = 3647 hu = 9.31e-02 +t = 7.00e+00 nst = 329 nfe = 0 nfi = 5315 nni = 3652 hu = 8.22e-02 -t = 8.00e+00 nst = 339 nfe = 0 nfi = 5464 nni = 3748 hu = 9.70e-02 +t = 8.00e+00 nst = 339 nfe = 0 nfi = 5455 nni = 3742 hu = 1.19e-01 -t = 9.00e+00 nst = 349 nfe = 0 nfi = 5598 nni = 3832 hu = 1.12e-01 +t = 9.00e+00 nst = 345 nfe = 0 nfi = 5536 nni = 3793 hu = 2.11e-01 -t = 1.00e+01 nst = 359 nfe = 0 nfi = 5728 nni = 3912 hu = 1.31e-01 +t = 1.00e+01 nst = 349 nfe = 0 nfi = 5589 nni = 3826 hu = 2.80e-01 Final statistics for this run: ARKStep real workspace length = 3557 - ARKStep integer workspace length = 146 + ARKStep integer workspace length = 146 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 - Number of steps = 359 + Number of steps = 349 Number of f-s (explicit) = 0 - Number of f-s (implicit) = 5728 - Number of f-s (SPGMR) = 12934 - Number of f-s (TOTAL) = 12934 - Number of setups = 254 - Number of nonlinear iterations = 3912 - Number of linear iterations = 12934 - Number of preconditioner evaluations = 254 - Number of preconditioner solves = 16627 + Number of f-s (implicit) = 5589 + Number of f-s (SPGMR) = 12378 + Number of f-s (TOTAL) = 12378 + Number of setups = 244 + Number of nonlinear iterations = 3826 + Number of linear iterations = 12378 + Number of preconditioner evaluations = 244 + Number of preconditioner solves = 15957 Number of error test failures = 0 - Number of nonlinear conv. failures = 118 - Number of linear convergence failures = 1076 - Average Krylov subspace dimension = 3.306 + Number of nonlinear conv. failures = 113 + Number of linear convergence failures = 976 + Average Krylov subspace dimension = 3.235 ---------------------------------------------------------------------------- diff --git a/examples/arkode/C_serial/ark_brusselator1D.out b/examples/arkode/C_serial/ark_brusselator1D.out index abe61d1f47..fed3032856 100644 --- a/examples/arkode/C_serial/ark_brusselator1D.out +++ b/examples/arkode/C_serial/ark_brusselator1D.out @@ -8,102 +8,102 @@ t ||u||_rms ||v||_rms ||w||_rms ---------------------------------------------- 0.100000 0.673914 3.377329 1.999987 - 0.200000 0.684316 3.356619 1.999987 + 0.200000 0.684316 3.356619 1.999986 0.300000 0.695306 3.334633 1.999986 0.400000 0.706918 3.311313 1.999986 0.500000 0.719185 3.286601 1.999986 0.600000 0.732137 3.260442 1.999986 0.700000 0.745798 3.232787 1.999985 0.800000 0.760185 3.203596 1.999985 - 0.900000 0.775303 3.172839 1.999985 + 0.900000 0.775302 3.172839 1.999985 1.000000 0.791135 3.140510 1.999984 1.100000 0.807648 3.106624 1.999984 1.200000 0.824771 3.071233 1.999984 1.300000 0.842402 3.034426 1.999983 1.400000 0.860384 2.996350 1.999983 - 1.500000 0.878514 2.957206 1.999983 + 1.500000 0.878514 2.957207 1.999983 1.600000 0.896525 2.917266 1.999982 1.700000 0.914089 2.876873 1.999982 1.800000 0.930823 2.836438 1.999982 1.900000 0.946292 2.796446 1.999982 - 2.000000 0.960033 2.757430 1.999981 - 2.100000 0.971576 2.719962 1.999981 - 2.200000 0.980475 2.684623 1.999981 + 2.000000 0.960034 2.757430 1.999981 + 2.100000 0.971577 2.719961 1.999981 + 2.200000 0.980476 2.684622 1.999981 2.300000 0.986338 2.651980 1.999981 - 2.400000 0.988852 2.622560 1.999981 - 2.500000 0.987815 2.596818 1.999981 - 2.600000 0.983141 2.575128 1.999981 - 2.700000 0.974858 2.557766 1.999981 - 2.800000 0.963114 2.544903 1.999981 - 2.900000 0.948154 2.536611 1.999981 - 3.000000 0.930299 2.532868 1.999982 - 3.100000 0.909930 2.533567 1.999982 - 3.200000 0.887464 2.538529 1.999983 - 3.300000 0.863335 2.547515 1.999983 - 3.400000 0.837978 2.560241 1.999983 + 2.400000 0.988853 2.622559 1.999981 + 2.500000 0.987816 2.596818 1.999981 + 2.600000 0.983141 2.575127 1.999981 + 2.700000 0.974859 2.557765 1.999981 + 2.800000 0.963115 2.544902 1.999981 + 2.900000 0.948155 2.536610 1.999981 + 3.000000 0.930300 2.532867 1.999982 + 3.100000 0.909931 2.533566 1.999982 + 3.200000 0.887464 2.538528 1.999983 + 3.300000 0.863335 2.547514 1.999983 + 3.400000 0.837978 2.560240 1.999983 3.500000 0.811818 2.576391 1.999984 3.600000 0.785255 2.595624 1.999984 - 3.700000 0.758659 2.617587 1.999985 - 3.800000 0.732363 2.641922 1.999986 + 3.700000 0.758658 2.617586 1.999985 + 3.800000 0.732363 2.641921 1.999986 3.900000 0.706662 2.668274 1.999986 4.000000 0.681809 2.696300 1.999986 - 4.100000 0.658012 2.725670 1.999987 + 4.100000 0.658011 2.725670 1.999987 4.200000 0.635435 2.756075 1.999987 - 4.300000 0.614205 2.787228 1.999988 + 4.300000 0.614204 2.787228 1.999988 4.400000 0.594404 2.818869 1.999988 4.500000 0.576082 2.850764 1.999989 - 4.600000 0.559255 2.882710 1.999989 + 4.600000 0.559254 2.882710 1.999989 4.700000 0.543909 2.914529 1.999989 4.800000 0.530011 2.946071 1.999990 - 4.900000 0.517506 2.977209 1.999990 + 4.900000 0.517506 2.977210 1.999990 5.000000 0.506326 3.007843 1.999990 - 5.100000 0.496394 3.037889 1.999990 - 5.200000 0.487626 3.067283 1.999990 + 5.100000 0.496393 3.037889 1.999990 + 5.200000 0.487625 3.067283 1.999990 5.300000 0.479935 3.095976 1.999991 5.400000 0.473237 3.123932 1.999991 - 5.500000 0.467445 3.151125 1.999991 + 5.500000 0.467445 3.151126 1.999991 5.600000 0.462480 3.177540 1.999991 5.700000 0.458264 3.203165 1.999991 5.800000 0.454726 3.227997 1.999991 - 5.900000 0.451800 3.252035 1.999991 + 5.900000 0.451799 3.252035 1.999991 6.000000 0.449425 3.275283 1.999991 - 6.100000 0.447546 3.297744 1.999991 + 6.100000 0.447546 3.297745 1.999991 6.200000 0.446115 3.319428 1.999991 - 6.300000 0.445086 3.340340 1.999991 - 6.400000 0.444419 3.360491 1.999991 - 6.500000 0.444079 3.379890 1.999991 + 6.300000 0.445085 3.340341 1.999991 + 6.400000 0.444419 3.360492 1.999991 + 6.500000 0.444079 3.379891 1.999991 6.600000 0.444034 3.398547 1.999991 6.700000 0.444257 3.416470 1.999991 6.800000 0.444722 3.433669 1.999991 6.900000 0.445409 3.450154 1.999991 - 7.000000 0.446297 3.465934 1.999991 + 7.000000 0.446297 3.465935 1.999991 7.100000 0.447370 3.481018 1.999991 - 7.200000 0.448614 3.495414 1.999991 + 7.200000 0.448614 3.495415 1.999991 7.300000 0.450016 3.509131 1.999991 7.400000 0.451564 3.522176 1.999991 7.500000 0.453249 3.534557 1.999991 7.600000 0.455064 3.546280 1.999991 7.700000 0.457000 3.557353 1.999991 7.800000 0.459052 3.567781 1.999991 - 7.900000 0.461216 3.577571 1.999991 - 8.000000 0.463486 3.586728 1.999991 + 7.900000 0.461215 3.577572 1.999991 + 8.000000 0.463486 3.586729 1.999991 8.100000 0.465860 3.595257 1.999991 8.200000 0.468335 3.603162 1.999991 8.300000 0.470909 3.610447 1.999991 8.400000 0.473582 3.617116 1.999991 - 8.500000 0.476352 3.623171 1.999991 + 8.500000 0.476352 3.623172 1.999991 8.600000 0.479220 3.628616 1.999991 8.700000 0.482186 3.633451 1.999991 8.800000 0.485250 3.637679 1.999990 8.900000 0.488416 3.641299 1.999990 - 9.000000 0.491684 3.644311 1.999990 - 9.100000 0.495058 3.646715 1.999990 - 9.200000 0.498540 3.648509 1.999990 - 9.300000 0.502134 3.649691 1.999990 - 9.400000 0.505844 3.650257 1.999990 - 9.500000 0.509675 3.650202 1.999990 - 9.600000 0.513632 3.649521 1.999990 - 9.700000 0.517722 3.648209 1.999990 + 9.000000 0.491684 3.644312 1.999990 + 9.100000 0.495058 3.646716 1.999990 + 9.200000 0.498539 3.648510 1.999990 + 9.300000 0.502133 3.649691 1.999990 + 9.400000 0.505843 3.650257 1.999990 + 9.500000 0.509674 3.650202 1.999990 + 9.600000 0.513632 3.649522 1.999990 + 9.700000 0.517722 3.648210 1.999990 9.800000 0.521951 3.646257 1.999990 9.900000 0.526326 3.643656 1.999990 10.000000 0.530857 3.640396 1.999990 diff --git a/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.out b/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.out index 28851a7ed1..863032a717 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.out +++ b/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.out @@ -13,68 +13,68 @@ 0.300000 0.648532 3.334867 1.999989 0.400000 0.654362 3.323350 1.999989 0.500000 0.660542 3.311172 1.999988 - 0.600000 0.667093 3.298310 1.999988 - 0.700000 0.674031 3.284739 1.999988 + 0.600000 0.667093 3.298309 1.999988 + 0.700000 0.674031 3.284739 1.999989 0.800000 0.681370 3.270442 1.999988 0.900000 0.689121 3.255404 1.999988 - 1.000000 0.697285 3.239620 1.999988 - 1.100000 0.705854 3.223093 1.999987 + 1.000000 0.697284 3.239620 1.999988 + 1.100000 0.705853 3.223093 1.999987 1.200000 0.714805 3.205842 1.999987 - 1.300000 0.724099 3.187902 1.999987 - 1.400000 0.733671 3.169332 1.999987 - 1.500000 0.743429 3.150211 1.999987 - 1.600000 0.753249 3.130653 1.999987 - 1.700000 0.762974 3.110800 1.999986 - 1.800000 0.772412 3.090827 1.999986 - 1.900000 0.781337 3.070944 1.999986 - 2.000000 0.789501 3.051388 1.999986 - 2.100000 0.796639 3.032420 1.999986 - 2.200000 0.802490 3.014317 1.999986 - 2.300000 0.806810 2.997358 1.999986 - 2.400000 0.809386 2.981818 1.999986 - 2.500000 0.810060 2.967949 1.999986 - 2.600000 0.808729 2.955977 1.999986 - 2.700000 0.805360 2.946085 1.999986 - 2.800000 0.799989 2.938410 1.999986 - 2.900000 0.792711 2.933039 1.999986 - 3.000000 0.783680 2.930010 1.999986 - 3.100000 0.773095 2.929307 1.999986 - 3.200000 0.761187 2.930873 1.999986 - 3.300000 0.748207 2.934612 1.999987 - 3.400000 0.734416 2.940393 1.999987 - 3.500000 0.720073 2.948062 1.999987 + 1.300000 0.724098 3.187903 1.999987 + 1.400000 0.733670 3.169332 1.999987 + 1.500000 0.743428 3.150212 1.999987 + 1.600000 0.753248 3.130655 1.999987 + 1.700000 0.762974 3.110801 1.999986 + 1.800000 0.772411 3.090829 1.999986 + 1.900000 0.781336 3.070946 1.999986 + 2.000000 0.789499 3.051390 1.999986 + 2.100000 0.796638 3.032422 1.999986 + 2.200000 0.802489 3.014319 1.999986 + 2.300000 0.806808 2.997360 1.999986 + 2.400000 0.809386 2.981819 1.999986 + 2.500000 0.810059 2.967951 1.999986 + 2.600000 0.808728 2.955979 1.999986 + 2.700000 0.805361 2.946086 1.999986 + 2.800000 0.799988 2.938411 1.999986 + 2.900000 0.792711 2.933041 1.999986 + 3.000000 0.783681 2.930010 1.999986 + 3.100000 0.773096 2.929307 1.999986 + 3.200000 0.761187 2.930874 1.999986 + 3.300000 0.748207 2.934613 1.999987 + 3.400000 0.734416 2.940394 1.999987 + 3.500000 0.720074 2.948062 1.999987 3.600000 0.705429 2.957444 1.999987 - 3.700000 0.690714 2.968354 1.999988 + 3.700000 0.690715 2.968354 1.999988 3.800000 0.676141 2.980600 1.999988 - 3.900000 0.661891 2.993989 1.999988 - 4.000000 0.648122 3.008331 1.999989 - 4.100000 0.634961 3.023445 1.999989 + 3.900000 0.661892 2.993989 1.999988 + 4.000000 0.648123 3.008331 1.999989 + 4.100000 0.634962 3.023445 1.999989 4.200000 0.622506 3.039157 1.999989 4.300000 0.610828 3.055308 1.999989 - 4.400000 0.599972 3.071752 1.999989 + 4.400000 0.599972 3.071751 1.999989 4.500000 0.589962 3.088356 1.999990 4.600000 0.580801 3.105007 1.999990 - 4.700000 0.572477 3.121603 1.999990 - 4.800000 0.564964 3.138059 1.999990 + 4.700000 0.572477 3.121602 1.999990 + 4.800000 0.564964 3.138058 1.999990 4.900000 0.558227 3.154303 1.999990 - 5.000000 0.552224 3.170278 1.999990 + 5.000000 0.552224 3.170277 1.999990 5.100000 0.546907 3.185935 1.999991 - 5.200000 0.542228 3.201239 1.999991 - 5.300000 0.538137 3.216162 1.999991 - 5.400000 0.534585 3.230683 1.999991 + 5.200000 0.542229 3.201239 1.999991 + 5.300000 0.538138 3.216162 1.999991 + 5.400000 0.534586 3.230682 1.999991 5.500000 0.531525 3.244788 1.999991 - 5.600000 0.528910 3.258469 1.999991 - 5.700000 0.526699 3.271720 1.999991 + 5.600000 0.528910 3.258468 1.999991 + 5.700000 0.526699 3.271719 1.999991 5.800000 0.524852 3.284539 1.999991 5.900000 0.523334 3.296928 1.999991 - 6.000000 0.522111 3.308889 1.999991 - 6.100000 0.521154 3.320427 1.999991 + 6.000000 0.522112 3.308889 1.999991 + 6.100000 0.521154 3.320426 1.999991 6.200000 0.520436 3.331545 1.999991 - 6.300000 0.519932 3.342251 1.999991 + 6.300000 0.519932 3.342250 1.999991 6.400000 0.519621 3.352549 1.999991 - 6.500000 0.519484 3.362447 1.999991 - 6.600000 0.519503 3.371950 1.999991 - 6.700000 0.519664 3.381065 1.999991 + 6.500000 0.519484 3.362446 1.999991 + 6.600000 0.519503 3.371949 1.999991 + 6.700000 0.519664 3.381064 1.999991 6.800000 0.519953 3.389797 1.999991 6.900000 0.520358 3.398153 1.999991 7.000000 0.520869 3.406139 1.999991 @@ -87,37 +87,37 @@ 7.700000 0.526775 3.452091 1.999991 7.800000 0.527887 3.457288 1.999991 7.900000 0.529055 3.462154 1.999991 - 8.000000 0.530276 3.466693 1.999991 - 8.100000 0.531549 3.470907 1.999991 + 8.000000 0.530276 3.466692 1.999991 + 8.100000 0.531549 3.470906 1.999991 8.200000 0.532872 3.474798 1.999991 8.300000 0.534244 3.478370 1.999991 8.400000 0.535665 3.481625 1.999991 - 8.500000 0.537133 3.484563 1.999991 + 8.500000 0.537133 3.484564 1.999991 8.600000 0.538649 3.487188 1.999991 8.700000 0.540213 3.489499 1.999991 - 8.800000 0.541825 3.491497 1.999991 - 8.900000 0.543486 3.493184 1.999991 + 8.800000 0.541825 3.491498 1.999991 + 8.900000 0.543486 3.493185 1.999991 9.000000 0.545196 3.494560 1.999991 9.100000 0.546957 3.495624 1.999991 9.200000 0.548771 3.496375 1.999991 9.300000 0.550638 3.496814 1.999990 - 9.400000 0.552562 3.496938 1.999990 + 9.400000 0.552561 3.496938 1.999990 9.500000 0.554543 3.496746 1.999990 - 9.600000 0.556585 3.496235 1.999990 + 9.600000 0.556585 3.496236 1.999990 9.700000 0.558691 3.495404 1.999990 - 9.800000 0.560864 3.494247 1.999990 + 9.800000 0.560864 3.494248 1.999990 9.900000 0.563108 3.492763 1.999990 10.000000 0.565426 3.490945 1.999990 ---------------------------------------------- Final Solver Statistics: Internal solver steps = 95 (attempted = 95) - Total RHS evals: Fe = 0, Fi = 1605 + Total RHS evals: Fe = 0, Fi = 1596 Total mass matrix setups = 1 - Total mass matrix solves = 288 - Total mass times evals = 1697 + Total mass matrix solves = 193 + Total mass times evals = 1688 Total linear solver setups = 31 Total number of Jacobian evaluations = 11 - Total number of Newton iterations = 1127 + Total number of Newton iterations = 1118 Total number of nonlinear solver convergence failures = 10 Total number of error test failures = 0 diff --git a/examples/arkode/C_serial/ark_brusselator1D_imexmri_0_0.001.out b/examples/arkode/C_serial/ark_brusselator1D_imexmri_0_0.001.out index 6dd1721d1b..cadd7e5310 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_imexmri_0_0.001.out +++ b/examples/arkode/C_serial/ark_brusselator1D_imexmri_0_0.001.out @@ -30,7 +30,7 @@ Final Solver Statistics: Slow Steps: nsts = 10001 Fast Steps: nstf = 120012 - Total RHS evals: Fs = 30004, Ff = 994988 + Total RHS evals: Fs = 30004, Ff = 864983 Fast Newton iters = 504937 Fast Newton conv fails = 0 Fast Jacobian evals = 2308 diff --git a/examples/arkode/C_serial/ark_brusselator1D_imexmri_2_0.001.out b/examples/arkode/C_serial/ark_brusselator1D_imexmri_2_0.001.out index 1fa9294fa1..d8f1801e46 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_imexmri_2_0.001.out +++ b/examples/arkode/C_serial/ark_brusselator1D_imexmri_2_0.001.out @@ -30,7 +30,7 @@ Final Solver Statistics: Slow Steps: nsts = 10001 Fast Steps: nstf = 120012 - Total RHS evals: Fs = 68887, Ff = 400041 + Total RHS evals: Fs = 68887, Ff = 360046 Slow Newton iters = 38883 Slow Newton conv fails = 0 Slow Jacobian evals = 501 diff --git a/examples/arkode/C_serial/ark_brusselator1D_imexmri_3_0.001.out b/examples/arkode/C_serial/ark_brusselator1D_imexmri_3_0.001.out index 89fe3e2cc0..0e3c13961a 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_imexmri_3_0.001.out +++ b/examples/arkode/C_serial/ark_brusselator1D_imexmri_3_0.001.out @@ -30,7 +30,7 @@ Final Solver Statistics: Slow Steps: nsts = 10001 Fast Steps: nstf = 120012 - Total RHS evals: Fs = 68887, Ff = 1000128 + Total RHS evals: Fs = 68887, Ff = 840121 Slow Newton iters = 38883 Slow Newton conv fails = 0 Slow Jacobian evals = 501 diff --git a/examples/arkode/C_serial/ark_brusselator1D_imexmri_4_0.001.out b/examples/arkode/C_serial/ark_brusselator1D_imexmri_4_0.001.out index 65c7a6f99b..7059273d48 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_imexmri_4_0.001.out +++ b/examples/arkode/C_serial/ark_brusselator1D_imexmri_4_0.001.out @@ -30,7 +30,7 @@ Final Solver Statistics: Slow Steps: nsts = 10001 Fast Steps: nstf = 110011 - Total RHS evals: Fse = 40005, Fsi = 78888, Ff = 370038 + Total RHS evals: Fse = 40005, Fsi = 78888, Ff = 330043 Slow Newton iters = 38883 Slow Newton conv fails = 0 Slow Jacobian evals = 501 diff --git a/examples/arkode/C_serial/ark_brusselator1D_imexmri_5_0.001.out b/examples/arkode/C_serial/ark_brusselator1D_imexmri_5_0.001.out index cc8fb37508..827c560b02 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_imexmri_5_0.001.out +++ b/examples/arkode/C_serial/ark_brusselator1D_imexmri_5_0.001.out @@ -30,7 +30,7 @@ Final Solver Statistics: Slow Steps: nsts = 10001 Fast Steps: nstf = 110011 - Total RHS evals: Fse = 40005, Fsi = 78888, Ff = 1174341 + Total RHS evals: Fse = 40005, Fsi = 78888, Ff = 1024335 Slow Newton iters = 38883 Slow Newton conv fails = 0 Slow Jacobian evals = 501 diff --git a/examples/arkode/C_serial/ark_brusselator1D_imexmri_6_0.001.out b/examples/arkode/C_serial/ark_brusselator1D_imexmri_6_0.001.out index b567a7e624..79287bd749 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_imexmri_6_0.001.out +++ b/examples/arkode/C_serial/ark_brusselator1D_imexmri_6_0.001.out @@ -30,7 +30,7 @@ Final Solver Statistics: Slow Steps: nsts = 10001 Fast Steps: nstf = 130013 - Total RHS evals: Fse = 60007, Fsi = 118894, Ff = 580059 + Total RHS evals: Fse = 60007, Fsi = 118894, Ff = 520062 Slow Newton iters = 58887 Slow Newton conv fails = 0 Slow Jacobian evals = 501 diff --git a/examples/arkode/C_serial/ark_brusselator1D_imexmri_7_0.001.out b/examples/arkode/C_serial/ark_brusselator1D_imexmri_7_0.001.out index 0ebb4a0a14..c8dd757582 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_imexmri_7_0.001.out +++ b/examples/arkode/C_serial/ark_brusselator1D_imexmri_7_0.001.out @@ -30,7 +30,7 @@ Final Solver Statistics: Slow Steps: nsts = 10001 Fast Steps: nstf = 130013 - Total RHS evals: Fse = 60007, Fsi = 118894, Ff = 1946003 + Total RHS evals: Fse = 60007, Fsi = 118894, Ff = 1936011 Slow Newton iters = 58887 Slow Newton conv fails = 0 Slow Jacobian evals = 501 diff --git a/examples/arkode/C_serial/ark_brusselator1D_klu.out b/examples/arkode/C_serial/ark_brusselator1D_klu.out index 7e6bc33063..453cd212f8 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_klu.out +++ b/examples/arkode/C_serial/ark_brusselator1D_klu.out @@ -8,14 +8,14 @@ t ||u||_rms ||v||_rms ||w||_rms ---------------------------------------------- 1.000000 0.791135 3.140510 1.999984 - 2.000000 0.960033 2.757430 1.999981 - 3.000000 0.930299 2.532868 1.999982 + 2.000000 0.960034 2.757430 1.999981 + 3.000000 0.930300 2.532867 1.999982 4.000000 0.681809 2.696300 1.999986 5.000000 0.506326 3.007843 1.999990 6.000000 0.449425 3.275283 1.999991 - 7.000000 0.446297 3.465934 1.999991 - 8.000000 0.463486 3.586728 1.999991 - 9.000000 0.491684 3.644311 1.999990 + 7.000000 0.446297 3.465935 1.999991 + 8.000000 0.463486 3.586729 1.999991 + 9.000000 0.491684 3.644312 1.999990 10.000000 0.530857 3.640396 1.999990 ---------------------------------------------- diff --git a/examples/arkode/C_serial/ark_brusselator_1D_mri.out b/examples/arkode/C_serial/ark_brusselator_1D_mri.out index 2c61e45ad1..b1968f6e9d 100644 --- a/examples/arkode/C_serial/ark_brusselator_1D_mri.out +++ b/examples/arkode/C_serial/ark_brusselator_1D_mri.out @@ -16,18 +16,18 @@ 0.700000 1.351462 3.164033 3.499995 0.800000 1.423123 3.067751 3.499995 0.900000 1.497639 2.964524 3.499995 - 1.000000 1.568626 2.859012 3.499995 + 1.000000 1.568626 2.859013 3.499995 1.100000 1.628547 2.756573 3.499994 1.200000 1.671110 2.661914 3.499994 - 1.300000 1.693135 2.578240 3.499994 + 1.300000 1.693135 2.578241 3.499994 1.400000 1.694728 2.507261 3.499994 - 1.500000 1.678186 2.449677 3.499994 + 1.500000 1.678185 2.449678 3.499994 1.600000 1.646706 2.405676 3.499994 1.700000 1.603527 2.375228 3.499994 1.800000 1.551521 2.358213 3.499995 1.900000 1.493097 2.354426 3.499995 2.000000 1.430225 2.363536 3.499995 - 2.100000 1.364513 2.385031 3.499995 + 2.100000 1.364513 2.385032 3.499995 2.200000 1.297276 2.418172 3.499995 2.300000 1.229586 2.461974 3.499996 2.400000 1.162306 2.515228 3.499996 @@ -37,14 +37,14 @@ 2.800000 0.908402 2.794764 3.499997 2.900000 0.850317 2.874565 3.499997 3.000000 0.794740 2.956151 3.499997 - 3.100000 0.741797 3.038762 3.499998 + 3.100000 0.741798 3.038762 3.499998 3.200000 0.691633 3.121815 3.499998 3.300000 0.644408 3.204867 3.499998 3.400000 0.600305 3.287588 3.499998 3.500000 0.559517 3.369729 3.499998 3.600000 0.522228 3.451100 3.499998 3.700000 0.488593 3.531554 3.499998 - 3.800000 0.458712 3.610979 3.499998 + 3.800000 0.458713 3.610979 3.499998 3.900000 0.432611 3.689292 3.499999 4.000000 0.410222 3.766440 3.499999 4.100000 0.391383 3.842396 3.499999 @@ -60,7 +60,7 @@ 5.100000 0.331684 4.544600 3.499999 5.200000 0.332605 4.610297 3.499999 5.300000 0.334109 4.675326 3.499999 - 5.400000 0.336121 4.739695 3.499999 + 5.400000 0.336121 4.739694 3.499999 5.500000 0.338588 4.803402 3.499999 5.600000 0.341472 4.866439 3.499999 5.700000 0.344747 4.928787 3.499999 @@ -86,33 +86,33 @@ 7.700000 0.571996 5.870367 3.499998 7.800000 0.615233 5.869891 3.499998 7.900000 0.674190 5.850430 3.499998 - 8.000000 0.760486 5.800612 3.499997 - 8.100000 0.900806 5.696886 3.499997 - 8.200000 1.168701 5.483555 3.499996 - 8.300000 1.788983 5.030862 3.499994 - 8.400000 2.907583 4.325491 3.499991 - 8.500000 3.613526 3.702356 3.499989 - 8.600000 3.894341 3.130135 3.499987 - 8.700000 4.022608 2.516756 3.499987 - 8.800000 4.111043 1.781192 3.499986 - 8.900000 4.178068 1.047217 3.499985 - 9.000000 3.999350 0.887627 3.499986 - 9.100000 3.670986 0.942791 3.499987 - 9.200000 3.345964 1.020200 3.499988 - 9.300000 3.043896 1.105109 3.499990 - 9.400000 2.764752 1.196143 3.499990 - 9.500000 2.506590 1.293161 3.499991 - 9.600000 2.267456 1.396103 3.499992 - 9.700000 2.045656 1.504786 3.499993 - 9.800000 1.839810 1.618829 3.499994 - 9.900000 1.648872 1.737602 3.499994 - 10.000000 1.472127 1.860205 3.499995 + 8.000000 0.760485 5.800612 3.499997 + 8.100000 0.900804 5.696888 3.499997 + 8.200000 1.168696 5.483559 3.499996 + 8.300000 1.788966 5.030873 3.499994 + 8.400000 2.907564 4.325501 3.499991 + 8.500000 3.613521 3.702362 3.499989 + 8.600000 3.894340 3.130139 3.499987 + 8.700000 4.022609 2.516760 3.499987 + 8.800000 4.111045 1.781195 3.499986 + 8.900000 4.178071 1.047218 3.499985 + 9.000000 3.999353 0.887627 3.499986 + 9.100000 3.670989 0.942790 3.499987 + 9.200000 3.345967 1.020198 3.499988 + 9.300000 3.043900 1.105107 3.499990 + 9.400000 2.764755 1.196140 3.499990 + 9.500000 2.506593 1.293158 3.499991 + 9.600000 2.267459 1.396100 3.499992 + 9.700000 2.045658 1.504783 3.499993 + 9.800000 1.839812 1.618826 3.499994 + 9.900000 1.648874 1.737600 3.499994 + 10.000000 1.472129 1.860203 3.499995 ---------------------------------------------- Final Solver Statistics: Slow Steps: nsts = 1001 Fast Steps: nstf = 3171 (attempted = 3171) - Total RHS evals: Fs = 3004, Ff = 34684 + Total RHS evals: Fs = 3004, Ff = 30611 Total number of fast error test failures = 0 Total linear solver setups = 3118 Total RHS evals for setting up the linear system = 0 diff --git a/examples/arkode/C_serial/ark_brusselator_fp.out b/examples/arkode/C_serial/ark_brusselator_fp.out index 041ebe3d2a..ed5ca0e6f3 100644 --- a/examples/arkode/C_serial/ark_brusselator_fp.out +++ b/examples/arkode/C_serial/ark_brusselator_fp.out @@ -9,8 +9,8 @@ Brusselator ODE test problem, fixed-point solver: 1.000000 1.897255 1.274939 2.997155 2.000000 0.346125 2.366448 2.999481 3.000000 0.147442 2.862061 2.999781 - 4.000000 0.140733 3.226731 2.999788 - 5.000000 0.142659 3.583206 2.999788 + 4.000000 0.140733 3.226731 2.999780 + 5.000000 0.142659 3.583206 2.999789 6.000000 0.145095 3.936910 2.999782 7.000000 0.147720 4.287893 2.999780 8.000000 0.150542 4.635957 2.999775 @@ -20,7 +20,7 @@ Brusselator ODE test problem, fixed-point solver: Final Solver Statistics: Internal solver steps = 729 (attempted = 730) - Total RHS evals: Fe = 4383, Fi = 18793 + Total RHS evals: Fe = 4382, Fi = 18792 Total number of fixed-point iterations = 14410 Total number of nonlinear solver convergence failures = 0 Total number of error test failures = 1 diff --git a/examples/arkode/C_serial/ark_brusselator_fp_1.out b/examples/arkode/C_serial/ark_brusselator_fp_1.out index 041ebe3d2a..ed5ca0e6f3 100644 --- a/examples/arkode/C_serial/ark_brusselator_fp_1.out +++ b/examples/arkode/C_serial/ark_brusselator_fp_1.out @@ -9,8 +9,8 @@ Brusselator ODE test problem, fixed-point solver: 1.000000 1.897255 1.274939 2.997155 2.000000 0.346125 2.366448 2.999481 3.000000 0.147442 2.862061 2.999781 - 4.000000 0.140733 3.226731 2.999788 - 5.000000 0.142659 3.583206 2.999788 + 4.000000 0.140733 3.226731 2.999780 + 5.000000 0.142659 3.583206 2.999789 6.000000 0.145095 3.936910 2.999782 7.000000 0.147720 4.287893 2.999780 8.000000 0.150542 4.635957 2.999775 @@ -20,7 +20,7 @@ Brusselator ODE test problem, fixed-point solver: Final Solver Statistics: Internal solver steps = 729 (attempted = 730) - Total RHS evals: Fe = 4383, Fi = 18793 + Total RHS evals: Fe = 4382, Fi = 18792 Total number of fixed-point iterations = 14410 Total number of nonlinear solver convergence failures = 0 Total number of error test failures = 1 diff --git a/examples/arkode/C_serial/ark_brusselator_mri.out b/examples/arkode/C_serial/ark_brusselator_mri.out index 7cfb07b9cf..602c2e4177 100644 --- a/examples/arkode/C_serial/ark_brusselator_mri.out +++ b/examples/arkode/C_serial/ark_brusselator_mri.out @@ -31,4 +31,4 @@ Brusselator ODE test problem: Final Solver Statistics: Steps: nsts = 81, nstf = 2187 - Total RHS evals: Fs = 244, Ff = 8831 + Total RHS evals: Fs = 244, Ff = 6581 diff --git a/examples/arkode/C_serial/ark_conserved_exp_entropy_ark.c b/examples/arkode/C_serial/ark_conserved_exp_entropy_ark.c index 9064c56987..359f458f17 100644 --- a/examples/arkode/C_serial/ark_conserved_exp_entropy_ark.c +++ b/examples/arkode/C_serial/ark_conserved_exp_entropy_ark.c @@ -264,6 +264,10 @@ int main(int argc, char* argv[]) flag = ARKStepSetTableName(arkode_mem, "ARKODE_ARK2_DIRK_3_1_2", "ARKODE_ERK_NONE"); if (check_flag(flag, "ARKStepSetTableName")) return 1; + + /* Tighten nonlinear solver tolerance */ + flag = ARKStepSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); + if (check_flag(flag, "ARKStepSetNonlinConvCoef")) return 1; } if (fixed_h > SUN_RCONST(0.0)) diff --git a/examples/arkode/C_serial/ark_conserved_exp_entropy_ark_1_0.out b/examples/arkode/C_serial/ark_conserved_exp_entropy_ark_1_0.out index 05f6b3f4ce..76cfdd2a7e 100644 --- a/examples/arkode/C_serial/ark_conserved_exp_entropy_ark_1_0.out +++ b/examples/arkode/C_serial/ark_conserved_exp_entropy_ark_1_0.out @@ -8,18 +8,18 @@ Conserved Exponential Entropy problem: step t u v e delta e ------------------------------------------------------------------------------- 0 0.000000e+00 1.000000e+00 5.000000e-01 4.367003e+00 0.000000e+00 - 40 6.911091e-01 -1.121528e+00 1.396547e+00 4.367003e+00 -1.776357e-15 - 80 1.946408e+00 -6.526227e+00 1.473742e+00 4.367003e+00 4.440892e-15 + 40 7.671134e-01 -1.432143e+00 1.417843e+00 4.367003e+00 5.329071e-15 + 80 2.733674e+00 -9.963899e+00 1.474066e+00 4.367003e+00 8.881784e-15 ------------------------------------------------------------------------------- Final Solver Statistics: - Internal solver steps = 99 (attempted = 124) + Internal solver steps = 86 (attempted = 86) Total number of error test failures = 0 - Total RHS evals: Fe = 722, Fi = 0 - Total Relaxation Fn evals = 622 - Total Relaxation Jac evals = 1019 - Total Relaxation fails = 25 + Total RHS evals: Fe = 432, Fi = 0 + Total Relaxation Fn evals = 266 + Total Relaxation Jac evals = 524 + Total Relaxation fails = 0 Total Relaxation bound fails = 0 - Total Relaxation NLS fails = 25 - Total Relaxation NLS iters = 399 + Total Relaxation NLS fails = 0 + Total Relaxation NLS iters = 94 diff --git a/examples/arkode/C_serial/ark_conserved_exp_entropy_ark_1_1.out b/examples/arkode/C_serial/ark_conserved_exp_entropy_ark_1_1.out index 77742dc2bd..8ab099ceb4 100644 --- a/examples/arkode/C_serial/ark_conserved_exp_entropy_ark_1_1.out +++ b/examples/arkode/C_serial/ark_conserved_exp_entropy_ark_1_1.out @@ -8,46 +8,40 @@ Conserved Exponential Entropy problem: step t u v e delta e ------------------------------------------------------------------------------- 0 0.000000e+00 1.000000e+00 5.000000e-01 4.367003e+00 0.000000e+00 - 40 4.754706e-02 9.164641e-01 6.241023e-01 4.367003e+00 8.881784e-16 - 80 8.098591e-02 8.514226e-01 7.050883e-01 4.367003e+00 0.000000e+00 - 120 1.285350e-01 7.498036e-01 8.111164e-01 4.367003e+00 1.776357e-15 - 160 1.711613e-01 6.495637e-01 8.970255e-01 4.367003e+00 8.881784e-16 - 200 2.117650e-01 5.461535e-01 9.709320e-01 4.367003e+00 5.329071e-15 - 240 2.453290e-01 4.549914e-01 1.026344e+00 4.367003e+00 0.000000e+00 - 280 2.845614e-01 3.421715e-01 1.084852e+00 4.367003e+00 1.776357e-15 - 320 3.187813e-01 2.385199e-01 1.130639e+00 4.367003e+00 1.776357e-15 - 360 3.470183e-01 1.495118e-01 1.164942e+00 4.367003e+00 4.440892e-15 - 400 3.679487e-01 8.161060e-02 1.188444e+00 4.367003e+00 1.776357e-15 - 440 3.849834e-01 2.519301e-02 1.206417e+00 4.367003e+00 7.105427e-15 - 480 3.919101e-01 1.965927e-03 1.213438e+00 4.367003e+00 3.552714e-15 - 520 3.949458e-01 -8.265002e-03 1.216465e+00 4.367003e+00 2.664535e-15 - 560 4.054406e-01 -4.387006e-02 1.226690e+00 4.367003e+00 -1.776357e-15 - 600 4.224627e-01 -1.023806e-01 1.242516e+00 4.367003e+00 0.000000e+00 - 640 4.483804e-01 -1.931947e-01 1.264884e+00 4.367003e+00 -1.776357e-15 - 680 4.858087e-01 -3.277677e-01 1.293760e+00 4.367003e+00 1.776357e-15 - 720 5.292378e-01 -4.885049e-01 1.322678e+00 4.367003e+00 -4.440892e-15 - 760 5.861685e-01 -7.057075e-01 1.354092e+00 4.367003e+00 -6.217249e-15 - 800 6.559300e-01 -9.802131e-01 1.384235e+00 4.367003e+00 -2.664535e-15 - 840 7.351394e-01 -1.300674e+00 1.409682e+00 4.367003e+00 8.881784e-16 - 880 8.653344e-01 -1.841818e+00 1.437100e+00 4.367003e+00 -8.881784e-16 - 920 1.014019e+00 -2.473635e+00 1.454590e+00 4.367003e+00 8.881784e-16 - 960 1.342023e+00 -3.891227e+00 1.469390e+00 4.367003e+00 3.552714e-15 - 1000 2.028294e+00 -6.883726e+00 1.473842e+00 4.367003e+00 5.329071e-15 + 40 4.817852e-02 9.152845e-01 6.256803e-01 4.367003e+00 3.552714e-15 + 80 9.764003e-02 8.170556e-01 7.434499e-01 4.367003e+00 7.105427e-15 + 120 1.471282e-01 7.071386e-01 8.496481e-01 4.367003e+00 8.881784e-15 + 160 1.965497e-01 5.857982e-01 9.441311e-01 4.367003e+00 8.881784e-15 + 200 2.457811e-01 4.537292e-01 1.027056e+00 4.367003e+00 2.753353e-14 + 240 2.947183e-01 3.119036e-01 1.098939e+00 4.367003e+00 4.440892e-14 + 280 3.389142e-01 1.753685e-01 1.155408e+00 4.367003e+00 4.973799e-14 + 320 3.715233e-01 6.985629e-02 1.192300e+00 4.367003e+00 4.618528e-14 + 360 3.897050e-01 9.378019e-03 1.211221e+00 4.367003e+00 4.973799e-14 + 400 3.941218e-01 -5.484616e-03 1.215646e+00 4.367003e+00 6.306067e-14 + 440 4.041300e-01 -3.940365e-02 1.225433e+00 4.367003e+00 5.861978e-14 + 480 4.249355e-01 -1.109566e-01 1.244738e+00 4.367003e+00 6.394885e-14 + 520 4.567105e-01 -2.228060e-01 1.271650e+00 4.367003e+00 7.283063e-14 + 560 5.018939e-01 -3.867565e-01 1.305016e+00 4.367003e+00 8.082424e-14 + 600 5.637002e-01 -6.191770e-01 1.342503e+00 4.367003e+00 8.526513e-14 + 640 6.475411e-01 -9.467796e-01 1.381034e+00 4.367003e+00 9.148238e-14 + 680 7.633005e-01 -1.416410e+00 1.416925e+00 4.367003e+00 9.769963e-14 + 720 9.297484e-01 -2.114173e+00 1.446041e+00 4.367003e+00 1.039169e-13 + 760 1.217690e+00 -3.351631e+00 1.466024e+00 4.367003e+00 1.145750e-13 + 800 2.256864e+00 -7.881740e+00 1.473991e+00 4.367003e+00 1.207923e-13 ------------------------------------------------------------------------------- Final Solver Statistics: - Internal solver steps = 1024 (attempted = 1376) - Total number of error test failures = 86 - Total RHS evals: Fe = 0, Fi = 9934 - Total number of Newton iterations = 5803 - Total number of linear solver convergence failures = 37 - Total linear solver setups = 844 - Total number of Jacobian evaluations = 304 + Internal solver steps = 814 (attempted = 832) + Total number of error test failures = 3 + Total RHS evals: Fe = 0, Fi = 6827 + Total number of Newton iterations = 4347 + Total number of linear solver convergence failures = 117 + Total linear solver setups = 195 + Total number of Jacobian evaluations = 136 Total RHS evals for setting up the linear system = 0 - Total Relaxation Fn evals = 7023 - Total Relaxation Jac evals = 8651 - Total Relaxation fails = 266 - Total Relaxation bound fails = 14 - Total Relaxation NLS fails = 252 - Total Relaxation NLS iters = 4523 - + Total Relaxation Fn evals = 2689 + Total Relaxation Jac evals = 3521 + Total Relaxation fails = 15 + Total Relaxation bound fails = 15 + Total Relaxation NLS fails = 0 + Total Relaxation NLS iters = 1025 diff --git a/examples/arkode/C_serial/ark_conserved_exp_entropy_erk_1.out b/examples/arkode/C_serial/ark_conserved_exp_entropy_erk_1.out index 9e1649f48e..e39d0b1160 100644 --- a/examples/arkode/C_serial/ark_conserved_exp_entropy_erk_1.out +++ b/examples/arkode/C_serial/ark_conserved_exp_entropy_erk_1.out @@ -8,18 +8,18 @@ Conserved Exponential Entropy problem: step t u v e delta e ------------------------------------------------------------------------------- 0 0.000000e+00 1.000000e+00 5.000000e-01 4.367003e+00 0.000000e+00 - 40 6.759227e-01 -1.060311e+00 1.391445e+00 4.367003e+00 -1.776357e-15 - 80 1.694830e+00 -5.428257e+00 1.473071e+00 4.367003e+00 -8.881784e-16 + 40 6.829631e-01 -1.088653e+00 1.393849e+00 4.367003e+00 7.993606e-15 + 80 3.316326e+00 -1.250833e+01 1.474076e+00 4.367003e+00 1.332268e-14 ------------------------------------------------------------------------------- Final Solver Statistics: - Internal solver steps = 95 (attempted = 121) + Internal solver steps = 83 (attempted = 85) Total number of error test failures = 2 - Total RHS evals = 582 - Total Relaxation Fn evals = 608 - Total Relaxation Jac evals = 995 - Total Relaxation fails = 24 + Total RHS evals = 425 + Total Relaxation Fn evals = 267 + Total Relaxation Jac evals = 522 + Total Relaxation fails = 0 Total Relaxation bound fails = 0 - Total Relaxation NLS fails = 24 - Total Relaxation NLS iters = 390 + Total Relaxation NLS fails = 0 + Total Relaxation NLS iters = 97 diff --git a/examples/arkode/C_serial/ark_damped_harmonic_symplectic.out b/examples/arkode/C_serial/ark_damped_harmonic_symplectic.out index 943d2875e7..f7c3c21208 100644 --- a/examples/arkode/C_serial/ark_damped_harmonic_symplectic.out +++ b/examples/arkode/C_serial/ark_damped_harmonic_symplectic.out @@ -22,5 +22,5 @@ Inequality constraint fails = 0 Initial step size = 0.001 Last step size = 0.0009908169824406335 Current step size = 0.001 -f1 RHS fn evals = 125665 -f2 RHS fn evals = 125665 +f1 RHS fn evals = 125664 +f2 RHS fn evals = 125664 diff --git a/examples/arkode/C_serial/ark_dissipated_exp_entropy.c b/examples/arkode/C_serial/ark_dissipated_exp_entropy.c index 76da27a0c1..dbb62ec83e 100644 --- a/examples/arkode/C_serial/ark_dissipated_exp_entropy.c +++ b/examples/arkode/C_serial/ark_dissipated_exp_entropy.c @@ -244,6 +244,10 @@ int main(int argc, char* argv[]) flag = ARKStepSetTableName(arkode_mem, "ARKODE_ARK2_DIRK_3_1_2", "ARKODE_ERK_NONE"); if (check_flag(flag, "ARKStepSetTableName")) return 1; + + /* Tighten nonlinear solver tolerance */ + flag = ARKStepSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); + if (check_flag(flag, "ARKStepSetNonlinConvCoef")) return 1; } if (fixed_h > SUN_RCONST(0.0)) diff --git a/examples/arkode/C_serial/ark_dissipated_exp_entropy_1_0.out b/examples/arkode/C_serial/ark_dissipated_exp_entropy_1_0.out index 90df8380be..35872dff8b 100644 --- a/examples/arkode/C_serial/ark_dissipated_exp_entropy_1_0.out +++ b/examples/arkode/C_serial/ark_dissipated_exp_entropy_1_0.out @@ -16,11 +16,11 @@ Dissipated Exponential Entropy problem: Final Solver Statistics: Internal solver steps = 130 (attempted = 130) Total number of error test failures = 0 - Total RHS evals: Fe = 783, Fi = 0 - Total Relaxation Fn evals = 392 - Total Relaxation Jac evals = 782 + Total RHS evals: Fe = 652, Fi = 0 + Total Relaxation Fn evals = 391 + Total Relaxation Jac evals = 781 Total Relaxation fails = 0 Total Relaxation bound fails = 0 Total Relaxation NLS fails = 0 - Total Relaxation NLS iters = 132 + Total Relaxation NLS iters = 131 diff --git a/examples/arkode/C_serial/ark_dissipated_exp_entropy_1_1.out b/examples/arkode/C_serial/ark_dissipated_exp_entropy_1_1.out index 49be4a5967..176dffd2b8 100644 --- a/examples/arkode/C_serial/ark_dissipated_exp_entropy_1_1.out +++ b/examples/arkode/C_serial/ark_dissipated_exp_entropy_1_1.out @@ -8,52 +8,51 @@ Dissipated Exponential Entropy problem: step t u e u_err delta e ------------------------------------------------------------------------------- 0 0.000000e+00 1.000000e+00 2.718282e+00 0.000000e+00 0.000000e+00 - 40 5.532834e-02 8.598921e-01 2.362906e+00 1.272595e+00 -3.553760e-01 - 80 1.097061e-01 7.390122e-01 2.093866e+00 1.072757e+00 -6.244157e-01 - 120 1.621192e-01 6.348810e-01 1.886798e+00 8.980007e-01 -8.314842e-01 - 160 2.128767e-01 5.434247e-01 1.721894e+00 7.425986e-01 -9.963881e-01 - 200 2.816359e-01 4.315291e-01 1.539610e+00 5.501251e-01 -1.178672e+00 - 240 3.484648e-01 3.335947e-01 1.395977e+00 3.796434e-01 -1.322305e+00 - 280 4.133160e-01 2.469303e-01 1.280090e+00 2.272780e-01 -1.438192e+00 - 320 4.764552e-01 1.692067e-01 1.184365e+00 8.948479e-02 -1.533917e+00 - 360 5.342836e-01 1.029604e-01 1.108447e+00 -2.878187e-02 -1.609834e+00 - 400 5.805889e-01 5.290718e-02 1.054332e+00 -1.186227e-01 -1.663950e+00 - 440 6.131438e-01 1.915938e-02 1.019344e+00 -1.794246e-01 -1.698938e+00 - 480 6.301872e-01 1.935497e-03 1.001937e+00 -2.105255e-01 -1.716344e+00 - 520 6.350100e-01 -2.884950e-03 9.971192e-01 -2.192380e-01 -1.721163e+00 - 560 6.468882e-01 -1.465940e-02 9.854475e-01 -2.405343e-01 -1.732834e+00 - 600 6.693569e-01 -3.655950e-02 9.641007e-01 -2.802015e-01 -1.754181e+00 - 640 7.021244e-01 -6.766195e-02 9.345763e-01 -3.366619e-01 -1.783705e+00 - 680 7.450858e-01 -1.070275e-01 8.985009e-01 -4.083288e-01 -1.819781e+00 - 720 8.015384e-01 -1.565058e-01 8.551265e-01 -4.987252e-01 -1.863155e+00 - 760 8.754911e-01 -2.178256e-01 8.042657e-01 -6.112329e-01 -1.914016e+00 - 800 9.627556e-01 -2.856560e-01 7.515211e-01 -7.362769e-01 -1.966761e+00 - 840 1.068726e+00 -3.622828e-01 6.960855e-01 -8.782493e-01 -2.022196e+00 - 880 1.205356e+00 -4.531342e-01 6.356328e-01 -1.047503e+00 -2.082649e+00 - 920 1.360691e+00 -5.472947e-01 5.785127e-01 -1.223917e+00 -2.139769e+00 - 960 1.555080e+00 -6.538651e-01 5.200319e-01 -1.424719e+00 -2.198250e+00 - 1000 1.799105e+00 -7.733362e-01 4.614709e-01 -1.651150e+00 -2.256811e+00 - 1040 2.083363e+00 -8.965948e-01 4.079565e-01 -1.886097e+00 -2.310325e+00 - 1080 2.428941e+00 -1.028483e+00 3.575490e-01 -2.138850e+00 -2.360733e+00 - 1120 2.880022e+00 -1.178008e+00 3.078913e-01 -2.426922e+00 -2.410391e+00 - 1160 3.423853e+00 -1.332822e+00 2.637319e-01 -2.726684e+00 -2.454550e+00 - 1200 4.082008e+00 -1.492878e+00 2.247249e-01 -3.037999e+00 -2.493557e+00 - 1240 4.890808e+00 -1.659881e+00 1.901617e-01 -3.364145e+00 -2.528120e+00 + 40 5.537896e-02 8.597725e-01 2.362623e+00 1.272399e+00 -3.556587e-01 + 80 1.099922e-01 7.384132e-01 2.092612e+00 1.071758e+00 -6.256694e-01 + 120 1.627168e-01 6.337541e-01 1.884673e+00 8.960967e-01 -8.336092e-01 + 160 2.138163e-01 5.418080e-01 1.719112e+00 7.398360e-01 -9.991696e-01 + 200 2.785993e-01 4.362152e-01 1.546842e+00 5.582361e-01 -1.171440e+00 + 240 3.461651e-01 3.368102e-01 1.400473e+00 3.852698e-01 -1.317809e+00 + 280 4.117847e-01 2.488924e-01 1.282604e+00 2.307427e-01 -1.435678e+00 + 320 4.756921e-01 1.701108e-01 1.185436e+00 9.109375e-02 -1.532846e+00 + 360 5.336712e-01 1.036393e-01 1.109200e+00 -2.756595e-02 -1.609081e+00 + 400 5.801378e-01 5.338279e-02 1.054833e+00 -1.177670e-01 -1.663448e+00 + 440 6.128657e-01 1.944281e-02 1.019633e+00 -1.789132e-01 -1.698649e+00 + 480 6.300899e-01 2.032891e-03 1.002035e+00 -2.103494e-01 -1.716247e+00 + 520 6.349961e-01 -2.871232e-03 9.971329e-01 -2.192131e-01 -1.721149e+00 + 560 6.468398e-01 -1.461180e-02 9.854944e-01 -2.404481e-01 -1.732787e+00 + 600 6.694857e-01 -3.668376e-02 9.639809e-01 -2.804267e-01 -1.754301e+00 + 640 7.021782e-01 -6.771235e-02 9.345293e-01 -3.367534e-01 -1.783753e+00 + 680 7.458296e-01 -1.076957e-01 8.979008e-01 -4.095471e-01 -1.820381e+00 + 720 8.007409e-01 -1.558236e-01 8.557101e-01 -4.974764e-01 -1.862572e+00 + 760 8.752295e-01 -2.176153e-01 8.044349e-01 -6.108460e-01 -1.913847e+00 + 800 9.636774e-01 -2.863486e-01 7.510007e-01 -7.375568e-01 -1.967281e+00 + 840 1.066491e+00 -3.607260e-01 6.971700e-01 -8.753575e-01 -2.021112e+00 + 880 1.204472e+00 -4.525718e-01 6.359904e-01 -1.046452e+00 -2.082291e+00 + 920 1.362583e+00 -5.483883e-01 5.778804e-01 -1.225972e+00 -2.140401e+00 + 960 1.551610e+00 -6.520589e-01 5.209720e-01 -1.421306e+00 -2.197310e+00 + 1000 1.797284e+00 -7.724956e-01 4.618590e-01 -1.649553e+00 -2.256423e+00 + 1040 2.083087e+00 -8.964821e-01 4.080024e-01 -1.885881e+00 -2.310279e+00 + 1080 2.422755e+00 -1.026269e+00 3.583415e-01 -2.134596e+00 -2.359940e+00 + 1120 2.874633e+00 -1.176348e+00 3.084029e-01 -2.423715e+00 -2.409879e+00 + 1160 3.418118e+00 -1.331309e+00 2.641313e-01 -2.723747e+00 -2.454151e+00 + 1200 4.078701e+00 -1.492135e+00 2.248921e-01 -3.036550e+00 -2.493390e+00 + 1240 4.884676e+00 -1.658714e+00 1.903836e-01 -3.361862e+00 -2.527898e+00 ------------------------------------------------------------------------------- Final Solver Statistics: - Internal solver steps = 1244 (attempted = 1246) - Total number of error test failures = 2 - Total RHS evals: Fe = 0, Fi = 9633 - Total number of Newton iterations = 5892 - Total number of linear solver convergence failures = 81 - Total linear solver setups = 149 - Total number of Jacobian evaluations = 93 + Internal solver steps = 1245 (attempted = 1246) + Total number of error test failures = 1 + Total RHS evals: Fe = 0, Fi = 10907 + Total number of Newton iterations = 7168 + Total number of linear solver convergence failures = 111 + Total linear solver setups = 179 + Total number of Jacobian evaluations = 125 Total RHS evals for setting up the linear system = 0 - Total Relaxation Fn evals = 3773 - Total Relaxation Jac evals = 5019 + Total Relaxation Fn evals = 4403 + Total Relaxation Jac evals = 5649 Total Relaxation fails = 0 Total Relaxation bound fails = 0 Total Relaxation NLS fails = 0 - Total Relaxation NLS iters = 1281 - + Total Relaxation NLS iters = 1911 diff --git a/examples/arkode/C_serial/ark_harmonic_symplectic.out b/examples/arkode/C_serial/ark_harmonic_symplectic.out index 60e081223b..6033ea1668 100644 --- a/examples/arkode/C_serial/ark_harmonic_symplectic.out +++ b/examples/arkode/C_serial/ark_harmonic_symplectic.out @@ -22,5 +22,5 @@ Inequality constraint fails = 0 Initial step size = 0.001 Last step size = 0.0003981633971861239 Current step size = 0.001 -f1 RHS fn evals = 25153 -f2 RHS fn evals = 25153 +f1 RHS fn evals = 25152 +f2 RHS fn evals = 25152 diff --git a/examples/arkode/C_serial/ark_heat1D.out b/examples/arkode/C_serial/ark_heat1D.out index 2f33b506c3..4b1068888c 100644 --- a/examples/arkode/C_serial/ark_heat1D.out +++ b/examples/arkode/C_serial/ark_heat1D.out @@ -18,12 +18,12 @@ ------------------------- Final Solver Statistics: - Internal solver steps = 191 (attempted = 191) - Total RHS evals: Fe = 0, Fi = 1913 + Internal solver steps = 190 (attempted = 190) + Total RHS evals: Fe = 0, Fi = 1903 Total linear solver setups = 0 - Total linear iterations = 18265 - Total number of Jacobian-vector products = 18265 + Total linear iterations = 17826 + Total number of Jacobian-vector products = 17826 Total number of linear solver convergence failures = 0 - Total number of Newton iterations = 955 + Total number of Newton iterations = 950 Total number of nonlinear solver convergence failures = 0 Total number of error test failures = 0 diff --git a/examples/arkode/C_serial/ark_heat1D_adapt.out b/examples/arkode/C_serial/ark_heat1D_adapt.out index 4eb02c8a18..8135e3df32 100644 --- a/examples/arkode/C_serial/ark_heat1D_adapt.out +++ b/examples/arkode/C_serial/ark_heat1D_adapt.out @@ -6,154 +6,135 @@ ---------------------------------------------------------------------------------------- 0 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 21 0 0 1 3.629021901461023e-12 7.505751048377368e-09 2.979166031180459e-12 21 5 5 - 2 7.505751048377368e-09 1.501150209675474e-07 6.164657920191316e-09 21 5 5 - 3 1.501150209675474e-07 3.002300419350948e-06 1.293969127944767e-07 21 5 10 - 4 3.002300419350948e-06 6.004600838701896e-05 2.593514282990854e-06 21 5 10 - 5 6.004600838701896e-05 2.853823712852094e-04 5.166758334560010e-05 21 5 20 - 6 2.853823712852094e-04 2.575255578901065e-04 2.798555766932917e-04 21 5 25 - 7 2.575255578901065e-04 4.094541218029253e-04 4.794249606742115e-04 21 5 25 - 8 4.094541218029253e-04 4.094541218029253e-04 7.863858593533243e-04 21 5 29 - 9 4.094541218029253e-04 6.522910582302937e-04 1.082809153607867e-03 21 5 29 - 10 6.522910582302937e-04 5.699097250687579e-04 1.606859000290955e-03 23 5 40 - 11 5.699097250687579e-04 1.007836408495680e-03 2.005669608336064e-03 23 5 35 - 12 1.007836408495680e-03 1.007836408495680e-03 2.683041089905320e-03 23 5 40 - 13 1.007836408495680e-03 8.453991987969423e-04 3.678394954727681e-03 25 5 40 - 14 8.453991987969423e-04 1.990429430223850e-03 4.265068071685453e-03 25 5 34 - 15 1.990429430223850e-03 1.990429430223850e-03 5.574933877447707e-03 25 5 41 - 16 1.990429430223850e-03 3.606540539819520e-03 6.798364735960519e-03 25 5 35 - 17 4.980839747684550e-04 4.980839747684550e-04 6.927003506629248e-03 27 15 180 - 18 4.980839747684550e-04 4.980839747684550e-04 7.441563625964739e-03 29 5 30 - 19 4.980839747684550e-04 1.668131272315291e-03 7.722574952892512e-03 29 5 29 - 20 1.668131272315291e-03 3.659992327983156e-03 8.637136102347247e-03 29 5 44 - 21 3.659992327983156e-03 7.226886812998415e-03 1.050785838365518e-02 29 5 65 - 22 2.276503454413033e-04 2.223970105833804e-04 1.033577924663066e-02 32 20 250 - 23 2.223970105833804e-04 4.397896042992326e-04 1.092271235598801e-02 34 5 24 - 24 4.397896042992326e-04 1.023105619938674e-03 1.113382898409555e-02 34 5 33 - 25 1.023105619938674e-03 1.023105619938674e-03 1.161589583401345e-02 34 5 36 - 26 1.023105619938674e-03 3.930141141574615e-03 1.208588377404162e-02 34 5 38 - 27 3.930141141574615e-03 3.871064201787735e-03 1.378515153788083e-02 34 5 84 - 28 3.871064201787735e-03 1.255329001281564e-02 1.530995222029954e-02 34 5 59 - 29 1.601537140384145e-03 1.457835824294224e-03 1.581392684966786e-02 36 15 234 - 30 1.457835824294224e-03 3.743501735515000e-03 1.633976217518591e-02 36 5 29 - 31 2.870420514795557e-03 2.465672685089582e-03 1.732506340515539e-02 38 10 143 - 32 5.515562262925350e-04 5.470070369949626e-04 1.714361637592621e-02 40 15 253 - 33 5.470070369949626e-04 9.932912795468831e-04 1.731823052548390e-02 40 5 43 - 34 9.932912795468831e-04 2.851877222558192e-03 1.763020341932926e-02 40 5 47 - 35 2.851877222558192e-03 8.592060762682407e-03 1.849017614042958e-02 40 5 96 - 36 1.753358828184278e-03 1.753358828184278e-03 1.899364054123662e-02 40 15 259 - 37 1.753358828184278e-03 8.066441335477586e-03 1.947884133485359e-02 40 5 60 - 38 6.367831766622205e-04 6.367831766622205e-04 1.897985914604649e-02 44 15 269 - 39 6.367831766622205e-04 1.262468320666752e-03 1.914535124132059e-02 44 5 47 - 40 1.262468320666752e-03 3.587735441717919e-03 1.946692075971101e-02 44 5 62 - 41 2.843421467160759e-03 2.408215671837289e-03 1.976846530535780e-02 46 10 199 - 42 2.408215671837289e-03 4.077980222533944e-03 2.031687522001488e-02 46 5 72 - 43 4.077980222533944e-03 1.071890797618786e-02 2.118660808690947e-02 46 5 88 - 44 1.071890797618786e-02 1.071890797618786e-02 2.316134512731487e-02 46 5 105 - 45 2.694639841378283e-03 2.650454280532623e-03 2.346008222533597e-02 48 10 208 - 46 5.834157269803085e-04 5.834157269803085e-04 2.328708620673918e-02 50 15 268 - 47 5.834157269803085e-04 1.193846932419712e-03 2.337621483760628e-02 50 5 55 - 48 1.193846932419712e-03 3.258366515093616e-03 2.355525946951272e-02 50 5 66 - 49 3.258366515093616e-03 6.418173913904015e-03 2.402308335632452e-02 50 5 104 - 50 3.844477373368192e-03 3.844477373368192e-03 2.453874392666302e-02 50 10 210 - 51 3.844477373368192e-03 1.778266602162782e-02 2.501810350379247e-02 50 5 91 - 52 4.165560835571891e-03 4.165560835571891e-03 2.549975323954108e-02 50 10 209 - 53 4.165560835571891e-03 4.165560835571891e-03 2.594523957554863e-02 50 5 105 - 54 4.165560835571891e-03 1.187099370779400e-02 2.635751897001287e-02 50 5 103 - 55 7.990286205672150e-03 7.990286205672150e-03 2.706496621836213e-02 50 10 210 - 56 7.990286205672150e-03 7.366258582155646e-03 2.767656709536814e-02 50 5 105 - 57 3.192957423660317e-03 2.690992361017143e-03 2.898705700684332e-02 54 10 210 - 58 2.690992361017143e-03 4.595411828908103e-03 2.916901398660043e-02 54 5 103 - 59 4.595411828908103e-03 1.148959244582437e-02 2.946060998170889e-02 54 5 105 - 60 3.392951963605576e-03 3.392951963605576e-03 2.934282134054850e-02 56 10 210 - 61 3.392951963605576e-03 1.266181052388950e-02 2.953044118771774e-02 56 5 75 - 62 1.266181052388950e-02 2.070977380726893e-02 3.014157400043279e-02 56 5 105 - 63 4.582873894130091e-03 4.582873894130091e-03 2.988631128376999e-02 58 10 210 - 64 4.582873894130091e-03 9.607054797980071e-03 2.957561272951538e-02 60 5 105 - 65 9.607054797980071e-03 1.949020745582244e-02 2.989673188100094e-02 60 5 105 - 66 1.054807485438376e-02 1.054807485438376e-02 3.019699587646915e-02 60 10 210 - 67 2.168783293816825e-03 2.168783293816825e-03 3.025284168346583e-02 60 10 210 - 68 2.168783293816825e-03 2.168783293816825e-03 3.030686555035694e-02 60 5 104 - 69 2.168783293816825e-03 9.519769922039302e-03 3.035913346641964e-02 60 5 79 - 70 9.519769922039302e-03 3.689745921797256e-02 3.056948236696047e-02 60 5 105 - 71 5.027376845883330e-03 5.027376845883330e-03 3.066924792565106e-02 60 10 210 - 72 5.027376845883330e-03 1.680323823916145e-02 3.076207689001887e-02 60 5 84 - 73 1.190695511366464e-02 1.190695511366464e-02 3.095765596831891e-02 60 10 210 - 74 8.824020991017463e-03 8.824020991017463e-03 3.108370439289872e-02 60 10 210 - 75 8.824020991017463e-03 7.492138529693538e-03 3.119630288799381e-02 60 5 105 - 76 7.492138529693538e-03 1.126027020832041e-02 3.128267383642943e-02 60 5 105 - 77 7.641572371714925e-03 7.641572371714925e-03 3.136324481005783e-02 60 10 210 - 78 7.641572371714925e-03 1.384651466179487e-02 3.143706333937704e-02 60 5 105 - 79 1.384651466179487e-02 1.168352852310369e-02 3.155622058156962e-02 60 5 105 - 80 7.186697995423493e-03 6.679717823882544e-03 3.161160219834706e-02 60 10 210 - 81 6.679717823882544e-03 6.679717823882544e-03 3.165979180134944e-02 60 5 105 - 82 6.679717823882544e-03 1.036597822978498e-02 3.170495968309999e-02 60 5 105 - 83 1.036597822978498e-02 2.078683878676566e-02 3.176988825989206e-02 60 5 105 - 84 9.416934538800317e-03 9.416934538800317e-03 3.182402943647551e-02 60 10 210 - 85 9.416934538800317e-03 2.931003455946657e-02 3.187416014076831e-02 60 5 105 - 86 2.931003455946657e-02 2.522099385522949e-02 3.200899311332644e-02 60 5 105 - 87 9.855600599572635e-04 8.688271778628972e-04 3.201326296052575e-02 60 20 384 - 88 8.688271778628972e-04 1.468146563475753e-03 3.201682378904077e-02 60 5 52 - 89 1.468146563475753e-03 4.343969048002700e-03 3.202279095225564e-02 60 5 74 - 90 4.343969048002700e-03 1.055819789459882e-02 3.204011973102326e-02 60 5 105 - 91 1.055819789459882e-02 2.209065533222391e-02 3.208023614326307e-02 60 5 105 - 92 2.386319631553004e-03 2.386319631553004e-03 3.208893412153121e-02 60 10 201 - 93 2.386319631553004e-03 1.364130552312118e-02 3.209750202157599e-02 60 5 55 - 94 1.364130552312118e-02 3.804643259996037e-02 3.214413129385055e-02 60 5 105 - 95 1.350012470133744e-02 1.350012470133744e-02 3.218665147855618e-02 60 10 210 - 96 9.639737373424729e-03 9.639737373424729e-03 3.221511600193919e-02 60 10 210 - 97 9.639737373424729e-03 1.590630674910340e-02 3.224203283811158e-02 60 5 105 - 98 9.367414453891131e-03 9.367414453891131e-03 3.226685525508665e-02 60 10 210 - 99 9.367414453891131e-03 9.367414453891131e-03 3.229047473304966e-02 60 5 105 - 100 9.367414453891131e-03 9.367414453891131e-03 3.231292205847536e-02 60 5 105 - 101 9.367414453891131e-03 9.367414453891131e-03 3.233430846708617e-02 60 5 105 - 102 9.367414453891131e-03 1.668718345780916e-02 3.235467947113296e-02 60 5 105 - 103 5.906021531128903e-03 5.906021531128903e-03 3.236703325098769e-02 60 10 210 - 104 5.906021531128903e-03 2.471346837871190e-02 3.237901834705667e-02 60 5 96 - 105 2.471346837871190e-02 2.201998950790008e-02 3.242549498508623e-02 60 5 105 - 106 3.894024974675171e-04 3.761680700537104e-04 3.242617044596968e-02 60 20 349 - 107 3.761680700537104e-04 7.748843143493643e-04 3.242683007682674e-02 60 5 46 - 108 7.748843143493643e-04 1.939359550616336e-03 3.242818962548284e-02 60 5 48 - 109 1.939359550616336e-03 3.113184611872983e-03 3.243157178567092e-02 60 5 97 - 110 3.113184611872983e-03 1.134238283346586e-02 3.243693386177211e-02 60 5 56 - 111 1.134238283346586e-02 1.796931919942777e-02 3.245578846135799e-02 60 5 105 - 112 1.796931919942777e-02 1.796931919942777e-02 3.248360322275518e-02 60 5 105 - 113 8.830774846120172e-03 8.830774846120172e-03 3.249636376759852e-02 60 10 210 - 114 8.830774846120172e-03 1.498507899698427e-02 3.250861147195047e-02 60 5 105 - 115 1.498507899698427e-02 2.400192116112091e-02 3.252822783037751e-02 60 5 105 - 116 1.834491808739763e-02 1.623377394364994e-02 3.255035322145888e-02 60 10 210 - 117 3.788212246854621e-03 3.773941147494160e-03 3.255469746916730e-02 60 15 315 - 118 3.773941147494160e-03 7.682030983754903e-03 3.255893334479040e-02 60 5 102 - 119 7.682030983754903e-03 2.180723185927965e-02 3.256732024800101e-02 60 5 105 - 120 2.180723185927965e-02 2.180723185927965e-02 3.258952126393384e-02 60 5 105 - 121 7.835737782770146e-03 7.835737782770146e-03 3.259691115681246e-02 60 10 210 - 122 7.835737782770146e-03 7.835737782770146e-03 3.260403532591830e-02 60 5 105 - 123 7.835737782770146e-03 1.521701267403009e-02 3.261090627152081e-02 60 5 105 - 124 1.521701267403009e-02 1.453434366415250e-02 3.262350907909189e-02 60 5 105 - 125 8.703052343239644e-03 8.703052343239644e-03 3.263033111822743e-02 60 10 210 - 126 8.703052343239644e-03 1.579670548089376e-02 3.263681960135667e-02 60 5 105 - 127 1.579670548089376e-02 1.579670548089376e-02 3.264798736584679e-02 60 5 105 - 128 1.579670548089376e-02 1.579670548089376e-02 3.265832267481519e-02 60 5 105 - 129 1.579670548089376e-02 1.579670548089376e-02 3.266783834117996e-02 60 5 105 - 130 1.579670548089376e-02 1.579670548089376e-02 3.267678702878758e-02 60 5 105 - 131 1.579670548089376e-02 1.579670548089376e-02 3.268496551666714e-02 60 5 105 - 132 1.579670548089376e-02 1.579670548089376e-02 3.269259030998119e-02 60 5 105 - 133 1.579670548089376e-02 1.579670548089376e-02 3.269967993118440e-02 60 5 105 - 134 9.442981671750042e-03 9.442981671750042e-03 3.270354813120258e-02 60 10 210 - 135 9.442981671750042e-03 1.498194099824085e-02 3.270736206011246e-02 60 5 105 - 136 1.498194099824085e-02 1.498194099824085e-02 3.271299843859180e-02 60 5 105 - 137 1.498194099824085e-02 1.498194099824085e-02 3.271824887923226e-02 60 5 105 - 138 1.498194099824085e-02 1.498194099824085e-02 3.272312899128821e-02 60 5 105 - 139 1.498194099824085e-02 1.498194099824085e-02 3.272766675941034e-02 60 5 105 - 140 1.498194099824085e-02 2.323511524381186e-02 3.273188003348305e-02 60 5 105 - 141 2.323511524381186e-02 2.323511524381186e-02 3.273782698896385e-02 60 5 105 - 142 2.323511524381186e-02 2.323511524381186e-02 3.274312637533745e-02 60 5 105 - 143 2.323511524381186e-02 2.042949136658555e-02 3.274788476870443e-02 60 5 105 - 144 2.042949136658555e-02 2.042949136658555e-02 3.275161072878752e-02 60 5 105 - 145 2.042949136658555e-02 1.314912365010589e-02 3.275500884737036e-02 60 5 105 - 146 1.314912365010589e-02 1.314912365010589e-02 3.275701308437982e-02 60 5 105 + 2 7.505751048377368e-09 1.501150209675474e-07 6.164657920190889e-09 21 5 5 + 3 1.501150209675474e-07 3.002300419350948e-06 1.293969127943737e-07 21 5 10 + 4 3.002300419350948e-06 6.004600838701896e-05 2.593514282988711e-06 21 5 10 + 5 6.004600838701896e-05 2.853823679832573e-04 5.166758334555005e-05 21 5 20 + 6 2.853823679832573e-04 2.575255434332890e-04 2.798555740976005e-04 21 5 25 + 7 2.575255434332890e-04 4.094541134469988e-04 4.794249470975060e-04 21 5 25 + 8 4.094541134469988e-04 4.094541134469988e-04 7.863858401326194e-04 21 5 29 + 9 4.094541134469988e-04 6.522908622655267e-04 1.082809129037782e-03 21 5 29 + 10 6.522908622655267e-04 5.699096897079724e-04 1.606858836596097e-03 23 5 40 + 11 5.699096897079724e-04 1.007836116841849e-03 2.005669425160000e-03 23 5 35 + 12 1.007836116841849e-03 1.007836116841849e-03 2.683040723903781e-03 23 5 40 + 13 1.007836116841849e-03 8.453991367856834e-04 3.678394364905319e-03 25 5 40 + 14 8.453991367856834e-04 1.990429632970147e-03 4.265067457277110e-03 25 5 34 + 15 1.990429632970147e-03 1.990429632970147e-03 5.574933430469675e-03 25 5 41 + 16 1.990429632970147e-03 3.606542084539227e-03 6.798364394830465e-03 25 5 35 + 17 4.980841065373463e-04 4.980841065373463e-04 6.927003185856736e-03 27 15 180 + 18 4.980841065373463e-04 4.980841065373463e-04 7.441563969778088e-03 29 5 30 + 19 4.980841065373463e-04 1.669338950987901e-03 7.722575172690612e-03 29 5 29 + 20 1.669338950987901e-03 3.660363409600048e-03 8.637783681073969e-03 29 5 44 + 21 3.660363409600048e-03 7.228866504893484e-03 1.050862732430420e-02 29 5 66 + 22 2.277066494413550e-04 2.223939246469188e-04 1.033655098852881e-02 32 20 250 + 23 2.223939246469188e-04 4.398048897676356e-04 1.092351423512213e-02 34 5 24 + 24 4.398048897676356e-04 1.023058876200847e-03 1.113462885573467e-02 34 5 33 + 25 1.023058876200847e-03 1.023058876200847e-03 1.161665279683433e-02 34 5 36 + 26 1.023058876200847e-03 3.919845082560766e-03 1.208659994169145e-02 34 5 38 + 27 3.919845082560766e-03 3.863020439217562e-03 1.378155752244160e-02 34 5 81 + 28 3.863020439217562e-03 1.257825200903444e-02 1.530364032030464e-02 34 5 59 + 29 1.533031872906549e-03 1.436302440195315e-03 1.578270750227194e-02 36 15 221 + 30 1.436302440195315e-03 3.755629101798260e-03 1.630186567569052e-02 36 5 31 + 31 2.870300468364886e-03 2.460481648357659e-03 1.728893354958566e-02 38 10 144 + 32 5.484132002743671e-04 5.448534872232822e-04 1.710787102567137e-02 40 15 251 + 33 5.448534872232822e-04 9.911472786863407e-04 1.728222131772621e-02 40 5 43 + 34 9.911472786863407e-04 2.853828564040550e-03 1.759429056441933e-02 40 5 47 + 35 2.853828564040550e-03 8.346188420319504e-03 1.845696364866320e-02 40 5 98 + 36 4.184969207140296e-03 4.184969207140296e-03 1.963139612674647e-02 40 10 209 + 37 7.891664187375526e-04 7.780072216640708e-04 1.916618790361855e-02 44 15 270 + 38 7.780072216640708e-04 1.432006588296146e-03 1.936507264204106e-02 44 5 51 + 39 1.432006588296146e-03 1.432006588296146e-03 1.933721559864914e-02 46 5 63 + 40 1.432006588296146e-03 2.920150155413109e-03 1.967900635018854e-02 46 5 59 + 41 2.920150155413109e-03 8.021410496618760e-03 2.034576732622878e-02 46 5 91 + 42 8.021410496618760e-03 8.021410496618760e-03 2.198707476731612e-02 46 5 105 + 43 8.021410496618760e-03 8.021410496618760e-03 2.338592734070328e-02 46 5 105 + 44 7.749248836531081e-04 7.712524403928612e-04 2.311665583789623e-02 50 15 273 + 45 7.712524403928612e-04 1.454207673515780e-03 2.323643927854141e-02 50 5 59 + 46 1.454207673515780e-03 3.893553595468784e-03 2.345743682946040e-02 50 5 75 + 47 3.893553595468784e-03 8.577785831996225e-03 2.401981148625224e-02 50 5 105 + 48 3.583582798475919e-03 3.583582798475919e-03 2.450182832136591e-02 50 10 210 + 49 3.583582798475919e-03 1.225842385200837e-02 2.495216274153317e-02 50 5 88 + 50 4.962462241849634e-03 4.962462241849634e-03 2.552759545114530e-02 50 10 208 + 51 4.962462241849634e-03 1.668087632819629e-02 2.605197291673569e-02 50 5 95 + 52 4.505316812294505e-03 4.505316812294505e-03 2.648793970156092e-02 50 10 201 + 53 4.505316812294505e-03 2.222468245231715e-02 2.688916611820219e-02 50 5 101 + 54 4.746858164506530e-03 4.746858164506530e-03 2.727761588174917e-02 50 15 298 + 55 4.746858164506530e-03 4.349218756600245e-03 2.848305395101498e-02 52 5 105 + 56 4.349218756600245e-03 4.349218756600245e-03 2.902306824658978e-02 54 5 105 + 57 4.349218756600245e-03 1.066724741463221e-02 2.931026262297523e-02 54 5 105 + 58 6.268748418325634e-03 6.268748418325634e-03 2.936878001655390e-02 56 10 210 + 59 6.268748418325634e-03 1.161381148923531e-02 2.970425918866458e-02 56 5 105 + 60 1.161381148923531e-02 1.028179098818762e-02 2.979356337650783e-02 58 5 105 + 61 1.028179098818762e-02 1.028179098818762e-02 2.969467522937706e-02 60 5 105 + 62 1.028179098818762e-02 3.106655738625877e-02 3.001826469123505e-02 60 5 105 + 63 1.471496945828350e-02 1.469024921725142e-02 3.039908149974539e-02 60 10 210 + 64 1.085599032570171e-02 1.085599032570171e-02 3.063067318046183e-02 60 10 210 + 65 1.085599032570171e-02 1.085599032570171e-02 3.082863809383847e-02 60 5 105 + 66 1.085599032570171e-02 1.085599032570171e-02 3.099902977389579e-02 60 5 105 + 67 7.618142079252098e-03 7.618142079252098e-03 3.110458948722743e-02 60 10 210 + 68 7.618142079252098e-03 3.289115457484437e-02 3.120052296435948e-02 60 5 105 + 69 3.289115457484437e-02 2.984967095026484e-02 3.153119483133013e-02 60 5 105 + 70 7.462417737566209e-03 7.462417737566209e-03 3.159027055714576e-02 60 6 126 + 71 7.462417737566209e-03 1.532601802900749e-02 3.164512521044466e-02 60 5 105 + 72 5.317294174445867e-03 5.317294174445867e-03 3.168191671045904e-02 60 10 210 + 73 5.317294174445867e-03 1.637705260014558e-02 3.171694897858042e-02 60 5 105 + 74 1.637705260014558e-02 5.597209894014091e-02 3.181506419526589e-02 60 5 105 + 75 9.763057448204533e-03 9.763057448204533e-03 3.186752063019930e-02 60 10 210 + 76 9.763057448204533e-03 3.404927513904092e-02 3.191613054349100e-02 60 5 105 + 77 3.404927513904092e-02 2.968548341756130e-02 3.206067821894520e-02 60 5 105 + 78 1.178500969634106e-02 1.178500969634106e-02 3.210368406300197e-02 60 10 210 + 79 1.178500969634106e-02 2.585117047072884e-02 3.214367493868805e-02 60 5 105 + 80 1.411007380226322e-02 1.411007380226322e-02 3.218801588316333e-02 60 10 210 + 81 1.411007380226322e-02 1.411007380226322e-02 3.222893682105193e-02 60 5 105 + 82 1.411007380226322e-02 1.401864440990195e-02 3.226656117886238e-02 60 5 105 + 83 1.401864440990195e-02 1.401864440990195e-02 3.230147951662023e-02 60 5 105 + 84 1.401864440990195e-02 1.303768352877046e-02 3.233369732860109e-02 60 5 105 + 85 7.810676399949200e-03 7.810676399949200e-03 3.235074731143681e-02 60 10 210 + 86 7.810676399949200e-03 7.810676399949200e-03 3.236714343315446e-02 60 5 105 + 87 7.810676399949200e-03 1.411979073878545e-02 3.238290227600748e-02 60 5 105 + 88 1.411979073878545e-02 3.418255178001077e-02 3.240986169975903e-02 60 5 105 + 89 1.683729734872759e-02 1.683729734872759e-02 3.243961052649499e-02 60 10 210 + 90 5.293743003823701e-03 5.293743003823701e-03 3.244847429329385e-02 60 10 210 + 91 5.293743003823701e-03 8.291768498653825e-03 3.245709535299850e-02 60 5 105 + 92 8.291768498653825e-03 1.880612123267676e-02 3.247017621575291e-02 60 5 105 + 93 1.173402792581162e-02 1.173402792581162e-02 3.248779528914644e-02 60 10 209 + 94 1.173402792581162e-02 1.173402792581162e-02 3.250442716997714e-02 60 5 105 + 95 1.173402792581162e-02 3.281754406804230e-02 3.252013886269631e-02 60 5 105 + 96 6.424707662957514e-03 6.424707662957514e-03 3.252836644102348e-02 60 10 197 + 97 6.424707662957514e-03 4.714988041054190e-02 3.253634036181408e-02 60 5 72 + 98 4.714988041054191e-03 4.714988041054191e-03 3.254203651909890e-02 60 10 171 + 99 4.714988041054191e-03 4.282144720721703e-02 3.254760362002126e-02 60 5 56 + 100 4.282144720721703e-02 3.592705003681280e-02 3.259281046463217e-02 60 5 105 + 101 7.349314806790228e-03 7.349314806790228e-03 3.259965013816767e-02 60 15 315 + 102 7.349314806790228e-03 3.112322123785429e-02 3.260625388050781e-02 60 5 96 + 103 3.112322123785429e-02 3.112322123785429e-02 3.263174602069833e-02 60 5 105 + 104 6.839739280813347e-03 6.839739280813347e-03 3.263685222363544e-02 60 15 315 + 105 6.839739280813347e-03 3.638819250655535e-02 3.264179137178386e-02 60 5 77 + 106 3.638819250655535e-02 3.638819250655535e-02 3.266544357612065e-02 60 5 105 + 107 1.812430795718352e-02 1.812430795718352e-02 3.267571852602801e-02 60 10 210 + 108 3.325944651421952e-03 3.325944651421952e-03 3.267751436841327e-02 60 15 315 + 109 3.325944651421952e-03 1.705033487710399e-02 3.267928353707002e-02 60 5 79 + 110 4.262583719275997e-03 4.262583719275997e-03 3.268151038658581e-02 60 6 118 + 111 4.262583719275997e-03 1.551192985487607e-02 3.268369082817933e-02 60 5 87 + 112 1.551192985487607e-02 2.477145186640316e-02 3.269122491441458e-02 60 5 105 + 113 1.660178108793211e-02 1.660178108793211e-02 3.269867454817608e-02 60 10 210 + 114 1.660178108793211e-02 1.660178108793211e-02 3.270557188991038e-02 60 5 105 + 115 1.660178108793211e-02 1.660178108793211e-02 3.271192363723516e-02 60 5 105 + 116 1.660178108793211e-02 3.371605679577483e-02 3.271779428194488e-02 60 5 105 + 117 1.522144924734310e-02 1.522144924734310e-02 3.272271516928414e-02 60 10 210 + 118 1.522144924734310e-02 1.396058321278275e-02 3.272735805276025e-02 60 5 105 + 119 1.396058321278275e-02 2.708386296373138e-02 3.273131056482627e-02 60 5 105 + 120 1.784278714797101e-02 1.559390397930733e-02 3.273593683845105e-02 60 10 210 + 121 1.108547745869386e-02 1.108547745869386e-02 3.273862071549129e-02 60 10 210 + 122 1.108547745869386e-02 3.935975276857615e-02 3.274118608200519e-02 60 5 105 + 123 9.839938192144036e-03 9.839938192144036e-03 3.274329592751463e-02 60 6 126 + 124 9.839938192144036e-03 3.408840272553354e-02 3.274535508616430e-02 60 5 105 + 125 2.571312978993083e-02 2.384800532128622e-02 3.274985374478378e-02 60 10 210 + 126 2.384800532128622e-02 1.550804686753758e-02 3.275393582150888e-02 60 5 105 + 127 1.550804686753758e-02 1.550804686753758e-02 3.275635661747035e-02 60 5 105 ---------------------------------------------------------------------------------------- Final solver statistics: - Total number of time steps = 146 - Total nonlinear iterations = 980 - Total linear iterations = 17015 + Total number of time steps = 127 + Total nonlinear iterations = 868 + Total linear iterations = 15028 diff --git a/examples/arkode/C_serial/ark_kepler.out b/examples/arkode/C_serial/ark_kepler.out index dd1e2f7f21..1ed58346ac 100644 --- a/examples/arkode/C_serial/ark_kepler.out +++ b/examples/arkode/C_serial/ark_kepler.out @@ -72,5 +72,5 @@ Inequality constraint fails = 0 Initial step size = 0.01 Last step size = 0.009999999998981926 Current step size = 0.01 -f1 RHS fn evals = 40001 -f2 RHS fn evals = 40001 +f1 RHS fn evals = 40000 +f2 RHS fn evals = 40000 diff --git a/examples/arkode/C_serial/ark_kepler_--stepper_ERK_--step-mode_adapt.out b/examples/arkode/C_serial/ark_kepler_--stepper_ERK_--step-mode_adapt.out index 36873efa02..845e6dbb9b 100644 --- a/examples/arkode/C_serial/ark_kepler_--stepper_ERK_--step-mode_adapt.out +++ b/examples/arkode/C_serial/ark_kepler_--stepper_ERK_--step-mode_adapt.out @@ -72,7 +72,7 @@ Inequality constraint fails = 0 Initial step size = 1.836231979046091e-06 Last step size = 0.2400202274108805 Current step size = 0.2400202274108805 -Explicit RHS fn evals = 2564 +Explicit RHS fn evals = 2125 Implicit RHS fn evals = 0 NLS iters = 0 NLS fails = 0 diff --git a/examples/arkode/C_serial/ark_kepler_--stepper_ERK_--step-mode_fixed_--count-orbits.out b/examples/arkode/C_serial/ark_kepler_--stepper_ERK_--step-mode_fixed_--count-orbits.out index 617c413a32..a53c7f1542 100644 --- a/examples/arkode/C_serial/ark_kepler_--stepper_ERK_--step-mode_fixed_--count-orbits.out +++ b/examples/arkode/C_serial/ark_kepler_--stepper_ERK_--step-mode_fixed_--count-orbits.out @@ -135,7 +135,7 @@ Initial step size = 0.01 Last step size = 0.009999999998981926 Current step size = 0.01 Root fn evals = 10288 -Explicit RHS fn evals = 60001 +Explicit RHS fn evals = 50000 Implicit RHS fn evals = 0 NLS iters = 0 NLS fails = 0 diff --git a/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--count-orbits_--use-compensated-sums.out b/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--count-orbits_--use-compensated-sums.out index c63591e498..4ac4c1c821 100644 --- a/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--count-orbits_--use-compensated-sums.out +++ b/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--count-orbits_--use-compensated-sums.out @@ -135,5 +135,5 @@ Initial step size = 0.01 Last step size = 0.01 Current step size = 0.01 Root fn evals = 10297 -f1 RHS fn evals = 40032 -f2 RHS fn evals = 40032 +f1 RHS fn evals = 40031 +f2 RHS fn evals = 40031 diff --git a/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_EULER_1_1_--tf_50_--check-order_--nout_1.out b/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_EULER_1_1_--tf_50_--check-order_--nout_1.out index 3a5b411e29..d32b06fb11 100644 --- a/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_EULER_1_1_--tf_50_--check-order_--nout_1.out +++ b/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_EULER_1_1_--tf_50_--check-order_--nout_1.out @@ -23,7 +23,7 @@ Inequality constraint fails = 0 Initial step size = 0.001 Last step size = 2.582822844487962e-11 Current step size = 0.001 -Explicit RHS fn evals = 400009 +Explicit RHS fn evals = 400008 Implicit RHS fn evals = 0 NLS iters = 0 NLS fails = 0 @@ -54,8 +54,8 @@ Inequality constraint fails = 0 Initial step size = 0.001 Last step size = 2.582822844487962e-11 Current step size = 0.001 -f1 RHS fn evals = 50002 -f2 RHS fn evals = 50002 +f1 RHS fn evals = 50001 +f2 RHS fn evals = 50001 Begin Kepler Problem @@ -82,8 +82,8 @@ Inequality constraint fails = 0 Initial step size = 0.0005 Last step size = 0.0004999999432868658 Current step size = 0.0005 -f1 RHS fn evals = 100001 -f2 RHS fn evals = 100001 +f1 RHS fn evals = 100000 +f2 RHS fn evals = 100000 Begin Kepler Problem @@ -110,8 +110,8 @@ Inequality constraint fails = 0 Initial step size = 0.00025 Last step size = 0.0002499998522722533 Current step size = 0.00025 -f1 RHS fn evals = 200001 -f2 RHS fn evals = 200001 +f1 RHS fn evals = 200000 +f2 RHS fn evals = 200000 Begin Kepler Problem @@ -138,8 +138,8 @@ Inequality constraint fails = 0 Initial step size = 0.000125 Last step size = 3.183586727573126e-10 Current step size = 0.000125 -f1 RHS fn evals = 400002 -f2 RHS fn evals = 400002 +f1 RHS fn evals = 400001 +f2 RHS fn evals = 400001 Begin Kepler Problem @@ -166,8 +166,8 @@ Inequality constraint fails = 0 Initial step size = 6.25e-05 Last step size = 7.503473398173804e-10 Current step size = 6.25e-05 -f1 RHS fn evals = 800002 -f2 RHS fn evals = 800002 +f1 RHS fn evals = 800001 +f2 RHS fn evals = 800001 Begin Kepler Problem @@ -194,8 +194,8 @@ Inequality constraint fails = 0 Initial step size = 3.125e-05 Last step size = 9.66345226061093e-10 Current step size = 3.125e-05 -f1 RHS fn evals = 1600002 -f2 RHS fn evals = 1600002 +f1 RHS fn evals = 1600001 +f2 RHS fn evals = 1600001 Begin Kepler Problem @@ -222,8 +222,8 @@ Inequality constraint fails = 0 Initial step size = 1.5625e-05 Last step size = 1.562198162474714e-05 Current step size = 1.5625e-05 -f1 RHS fn evals = 3200001 -f2 RHS fn evals = 3200001 +f1 RHS fn evals = 3200000 +f2 RHS fn evals = 3200000 Begin Kepler Problem @@ -250,8 +250,8 @@ Inequality constraint fails = 0 Initial step size = 7.8125e-06 Last step size = 7.805897645596353e-06 Current step size = 7.8125e-06 -f1 RHS fn evals = 6400001 -f2 RHS fn evals = 6400001 +f1 RHS fn evals = 6400000 +f2 RHS fn evals = 6400000 Order of accuracy wrt solution: expected = 1, max = 1.6317, avg = 1.0843, overall = 1.0418 Order of accuracy wrt Hamiltonian: expected = 1, max = 0.9999, avg = 0.9979, overall = 0.9983 diff --git a/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_LEAPFROG_2_2_--tf_50_--check-order_--nout_1.out b/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_LEAPFROG_2_2_--tf_50_--check-order_--nout_1.out index 7a3cc7e234..f6270cd29f 100644 --- a/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_LEAPFROG_2_2_--tf_50_--check-order_--nout_1.out +++ b/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_LEAPFROG_2_2_--tf_50_--check-order_--nout_1.out @@ -23,7 +23,7 @@ Inequality constraint fails = 0 Initial step size = 0.001 Last step size = 2.582822844487962e-11 Current step size = 0.001 -Explicit RHS fn evals = 400009 +Explicit RHS fn evals = 400008 Implicit RHS fn evals = 0 NLS iters = 0 NLS fails = 0 @@ -54,8 +54,8 @@ Inequality constraint fails = 0 Initial step size = 0.001 Last step size = 2.582822844487962e-11 Current step size = 0.001 -f1 RHS fn evals = 100003 -f2 RHS fn evals = 100003 +f1 RHS fn evals = 100002 +f2 RHS fn evals = 100002 Begin Kepler Problem @@ -82,8 +82,8 @@ Inequality constraint fails = 0 Initial step size = 0.0005 Last step size = 0.0004999999432868658 Current step size = 0.0005 -f1 RHS fn evals = 200001 -f2 RHS fn evals = 200001 +f1 RHS fn evals = 200000 +f2 RHS fn evals = 200000 Begin Kepler Problem @@ -110,8 +110,8 @@ Inequality constraint fails = 0 Initial step size = 0.00025 Last step size = 0.0002499998522722533 Current step size = 0.00025 -f1 RHS fn evals = 400001 -f2 RHS fn evals = 400001 +f1 RHS fn evals = 400000 +f2 RHS fn evals = 400000 Begin Kepler Problem @@ -138,8 +138,8 @@ Inequality constraint fails = 0 Initial step size = 0.000125 Last step size = 3.183586727573126e-10 Current step size = 0.000125 -f1 RHS fn evals = 800003 -f2 RHS fn evals = 800003 +f1 RHS fn evals = 800002 +f2 RHS fn evals = 800002 Begin Kepler Problem @@ -166,8 +166,8 @@ Inequality constraint fails = 0 Initial step size = 6.25e-05 Last step size = 7.503473398173804e-10 Current step size = 6.25e-05 -f1 RHS fn evals = 1600003 -f2 RHS fn evals = 1600003 +f1 RHS fn evals = 1600002 +f2 RHS fn evals = 1600002 Begin Kepler Problem @@ -194,8 +194,8 @@ Inequality constraint fails = 0 Initial step size = 3.125e-05 Last step size = 9.66345226061093e-10 Current step size = 3.125e-05 -f1 RHS fn evals = 3200003 -f2 RHS fn evals = 3200003 +f1 RHS fn evals = 3200002 +f2 RHS fn evals = 3200002 Begin Kepler Problem @@ -222,8 +222,8 @@ Inequality constraint fails = 0 Initial step size = 1.5625e-05 Last step size = 1.562198162474714e-05 Current step size = 1.5625e-05 -f1 RHS fn evals = 6400001 -f2 RHS fn evals = 6400001 +f1 RHS fn evals = 6400000 +f2 RHS fn evals = 6400000 Begin Kepler Problem @@ -250,8 +250,8 @@ Inequality constraint fails = 0 Initial step size = 7.8125e-06 Last step size = 7.805897645596353e-06 Current step size = 7.8125e-06 -f1 RHS fn evals = 12800001 -f2 RHS fn evals = 12800001 +f1 RHS fn evals = 12800000 +f2 RHS fn evals = 12800000 Order of accuracy wrt solution: expected = 2, max = 2.0097, avg = 1.8616, overall = 1.9108 Order of accuracy wrt Hamiltonian: expected = 2, max = 2.0636, avg = 2.0087, overall = 2.0051 diff --git a/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_MCLACHLAN_2_2_--tf_50_--check-order_--nout_1.out b/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_MCLACHLAN_2_2_--tf_50_--check-order_--nout_1.out index 3749e79c62..588a1cd511 100644 --- a/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_MCLACHLAN_2_2_--tf_50_--check-order_--nout_1.out +++ b/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_MCLACHLAN_2_2_--tf_50_--check-order_--nout_1.out @@ -23,7 +23,7 @@ Inequality constraint fails = 0 Initial step size = 0.001 Last step size = 2.582822844487962e-11 Current step size = 0.001 -Explicit RHS fn evals = 400009 +Explicit RHS fn evals = 400008 Implicit RHS fn evals = 0 NLS iters = 0 NLS fails = 0 @@ -54,8 +54,8 @@ Inequality constraint fails = 0 Initial step size = 0.001 Last step size = 2.582822844487962e-11 Current step size = 0.001 -f1 RHS fn evals = 100003 -f2 RHS fn evals = 100003 +f1 RHS fn evals = 100002 +f2 RHS fn evals = 100002 Begin Kepler Problem @@ -82,8 +82,8 @@ Inequality constraint fails = 0 Initial step size = 0.0005 Last step size = 0.0004999999432868658 Current step size = 0.0005 -f1 RHS fn evals = 200001 -f2 RHS fn evals = 200001 +f1 RHS fn evals = 200000 +f2 RHS fn evals = 200000 Begin Kepler Problem @@ -110,8 +110,8 @@ Inequality constraint fails = 0 Initial step size = 0.00025 Last step size = 0.0002499998522722533 Current step size = 0.00025 -f1 RHS fn evals = 400001 -f2 RHS fn evals = 400001 +f1 RHS fn evals = 400000 +f2 RHS fn evals = 400000 Begin Kepler Problem @@ -138,8 +138,8 @@ Inequality constraint fails = 0 Initial step size = 0.000125 Last step size = 3.183586727573126e-10 Current step size = 0.000125 -f1 RHS fn evals = 800003 -f2 RHS fn evals = 800003 +f1 RHS fn evals = 800002 +f2 RHS fn evals = 800002 Begin Kepler Problem @@ -166,8 +166,8 @@ Inequality constraint fails = 0 Initial step size = 6.25e-05 Last step size = 7.503473398173804e-10 Current step size = 6.25e-05 -f1 RHS fn evals = 1600003 -f2 RHS fn evals = 1600003 +f1 RHS fn evals = 1600002 +f2 RHS fn evals = 1600002 Begin Kepler Problem @@ -194,8 +194,8 @@ Inequality constraint fails = 0 Initial step size = 3.125e-05 Last step size = 9.66345226061093e-10 Current step size = 3.125e-05 -f1 RHS fn evals = 3200003 -f2 RHS fn evals = 3200003 +f1 RHS fn evals = 3200002 +f2 RHS fn evals = 3200002 Begin Kepler Problem @@ -222,8 +222,8 @@ Inequality constraint fails = 0 Initial step size = 1.5625e-05 Last step size = 1.562198162474714e-05 Current step size = 1.5625e-05 -f1 RHS fn evals = 6400001 -f2 RHS fn evals = 6400001 +f1 RHS fn evals = 6400000 +f2 RHS fn evals = 6400000 Begin Kepler Problem @@ -250,8 +250,8 @@ Inequality constraint fails = 0 Initial step size = 7.8125e-06 Last step size = 7.805897645596353e-06 Current step size = 7.8125e-06 -f1 RHS fn evals = 12800001 -f2 RHS fn evals = 12800001 +f1 RHS fn evals = 12800000 +f2 RHS fn evals = 12800000 Order of accuracy wrt solution: expected = 2, max = 2.0069, avg = 1.8941, overall = 1.9322 Order of accuracy wrt Hamiltonian: expected = 2, max = 2.0006, avg = 1.9998, overall = 1.9999 diff --git a/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_MCLACHLAN_3_3_--tf_50_--check-order_--nout_1.out b/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_MCLACHLAN_3_3_--tf_50_--check-order_--nout_1.out index 369230aab9..defe328ece 100644 --- a/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_MCLACHLAN_3_3_--tf_50_--check-order_--nout_1.out +++ b/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_MCLACHLAN_3_3_--tf_50_--check-order_--nout_1.out @@ -23,7 +23,7 @@ Inequality constraint fails = 0 Initial step size = 0.001 Last step size = 2.582822844487962e-11 Current step size = 0.001 -Explicit RHS fn evals = 400009 +Explicit RHS fn evals = 400008 Implicit RHS fn evals = 0 NLS iters = 0 NLS fails = 0 @@ -54,8 +54,8 @@ Inequality constraint fails = 0 Initial step size = 0.1 Last step size = 0.0999999999995608 Current step size = 0.1 -f1 RHS fn evals = 1501 -f2 RHS fn evals = 1501 +f1 RHS fn evals = 1500 +f2 RHS fn evals = 1500 Begin Kepler Problem @@ -82,8 +82,8 @@ Inequality constraint fails = 0 Initial step size = 0.05 Last step size = 0.05 Current step size = 0.05 -f1 RHS fn evals = 3001 -f2 RHS fn evals = 3001 +f1 RHS fn evals = 3000 +f2 RHS fn evals = 3000 Begin Kepler Problem @@ -110,8 +110,8 @@ Inequality constraint fails = 0 Initial step size = 0.025 Last step size = 1.769251412042648e-12 Current step size = 0.025 -f1 RHS fn evals = 6004 -f2 RHS fn evals = 6004 +f1 RHS fn evals = 6003 +f2 RHS fn evals = 6003 Begin Kepler Problem @@ -138,8 +138,8 @@ Inequality constraint fails = 0 Initial step size = 0.0125 Last step size = 0.01249999999719619 Current step size = 0.0125 -f1 RHS fn evals = 12001 -f2 RHS fn evals = 12001 +f1 RHS fn evals = 12000 +f2 RHS fn evals = 12000 Begin Kepler Problem @@ -166,8 +166,8 @@ Inequality constraint fails = 0 Initial step size = 0.00625 Last step size = 0.006249999992917305 Current step size = 0.00625 -f1 RHS fn evals = 24001 -f2 RHS fn evals = 24001 +f1 RHS fn evals = 24000 +f2 RHS fn evals = 24000 Begin Kepler Problem @@ -194,8 +194,8 @@ Inequality constraint fails = 0 Initial step size = 0.003125 Last step size = 1.124078607972478e-11 Current step size = 0.003125 -f1 RHS fn evals = 48004 -f2 RHS fn evals = 48004 +f1 RHS fn evals = 48003 +f2 RHS fn evals = 48003 Begin Kepler Problem @@ -222,8 +222,8 @@ Inequality constraint fails = 0 Initial step size = 0.0015625 Last step size = 2.835776058418557e-11 Current step size = 0.0015625 -f1 RHS fn evals = 96004 -f2 RHS fn evals = 96004 +f1 RHS fn evals = 96003 +f2 RHS fn evals = 96003 Begin Kepler Problem @@ -250,8 +250,8 @@ Inequality constraint fails = 0 Initial step size = 0.00078125 Last step size = 0.0007812499550681189 Current step size = 0.00078125 -f1 RHS fn evals = 192001 -f2 RHS fn evals = 192001 +f1 RHS fn evals = 192000 +f2 RHS fn evals = 192000 Order of accuracy wrt solution: expected = 3, max = 3.9687, avg = 3.7860, overall = 3.8206 Order of accuracy wrt Hamiltonian: expected = 3, max = 3.1635, avg = 3.0431, overall = 3.0566 diff --git a/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_MCLACHLAN_4_4_--tf_50_--check-order_--nout_1.out b/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_MCLACHLAN_4_4_--tf_50_--check-order_--nout_1.out index 0984d2b7c2..f87244403c 100644 --- a/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_MCLACHLAN_4_4_--tf_50_--check-order_--nout_1.out +++ b/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_MCLACHLAN_4_4_--tf_50_--check-order_--nout_1.out @@ -23,7 +23,7 @@ Inequality constraint fails = 0 Initial step size = 0.001 Last step size = 2.582822844487962e-11 Current step size = 0.001 -Explicit RHS fn evals = 400009 +Explicit RHS fn evals = 400008 Implicit RHS fn evals = 0 NLS iters = 0 NLS fails = 0 @@ -54,8 +54,8 @@ Inequality constraint fails = 0 Initial step size = 0.1 Last step size = 0.0999999999995608 Current step size = 0.1 -f1 RHS fn evals = 2001 -f2 RHS fn evals = 2001 +f1 RHS fn evals = 2000 +f2 RHS fn evals = 2000 Begin Kepler Problem @@ -82,8 +82,8 @@ Inequality constraint fails = 0 Initial step size = 0.05 Last step size = 0.05 Current step size = 0.05 -f1 RHS fn evals = 4001 -f2 RHS fn evals = 4001 +f1 RHS fn evals = 4000 +f2 RHS fn evals = 4000 Begin Kepler Problem @@ -110,8 +110,8 @@ Inequality constraint fails = 0 Initial step size = 0.025 Last step size = 1.769251412042648e-12 Current step size = 0.025 -f1 RHS fn evals = 8005 -f2 RHS fn evals = 8005 +f1 RHS fn evals = 8004 +f2 RHS fn evals = 8004 Begin Kepler Problem @@ -138,8 +138,8 @@ Inequality constraint fails = 0 Initial step size = 0.0125 Last step size = 0.01249999999719619 Current step size = 0.0125 -f1 RHS fn evals = 16001 -f2 RHS fn evals = 16001 +f1 RHS fn evals = 16000 +f2 RHS fn evals = 16000 Begin Kepler Problem @@ -166,8 +166,8 @@ Inequality constraint fails = 0 Initial step size = 0.00625 Last step size = 0.006249999992917305 Current step size = 0.00625 -f1 RHS fn evals = 32001 -f2 RHS fn evals = 32001 +f1 RHS fn evals = 32000 +f2 RHS fn evals = 32000 Begin Kepler Problem @@ -194,8 +194,8 @@ Inequality constraint fails = 0 Initial step size = 0.003125 Last step size = 1.124078607972478e-11 Current step size = 0.003125 -f1 RHS fn evals = 64005 -f2 RHS fn evals = 64005 +f1 RHS fn evals = 64004 +f2 RHS fn evals = 64004 Begin Kepler Problem @@ -222,8 +222,8 @@ Inequality constraint fails = 0 Initial step size = 0.0015625 Last step size = 2.835776058418557e-11 Current step size = 0.0015625 -f1 RHS fn evals = 128005 -f2 RHS fn evals = 128005 +f1 RHS fn evals = 128004 +f2 RHS fn evals = 128004 Begin Kepler Problem @@ -250,8 +250,8 @@ Inequality constraint fails = 0 Initial step size = 0.00078125 Last step size = 0.0007812499550681189 Current step size = 0.00078125 -f1 RHS fn evals = 256001 -f2 RHS fn evals = 256001 +f1 RHS fn evals = 256000 +f2 RHS fn evals = 256000 Order of accuracy wrt solution: expected = 4, max = 3.9974, avg = 3.5943, overall = 3.7564 Order of accuracy wrt Hamiltonian: expected = 4, max = 4.2742, avg = 3.8327, overall = 3.8935 diff --git a/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_MCLACHLAN_5_6_--tf_50_--check-order_--nout_1.out b/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_MCLACHLAN_5_6_--tf_50_--check-order_--nout_1.out index a421b8dc9b..78f14dd179 100644 --- a/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_MCLACHLAN_5_6_--tf_50_--check-order_--nout_1.out +++ b/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_MCLACHLAN_5_6_--tf_50_--check-order_--nout_1.out @@ -23,7 +23,7 @@ Inequality constraint fails = 0 Initial step size = 0.001 Last step size = 2.582822844487962e-11 Current step size = 0.001 -Explicit RHS fn evals = 400009 +Explicit RHS fn evals = 400008 Implicit RHS fn evals = 0 NLS iters = 0 NLS fails = 0 @@ -54,8 +54,8 @@ Inequality constraint fails = 0 Initial step size = 0.1 Last step size = 0.0999999999995608 Current step size = 0.1 -f1 RHS fn evals = 3001 -f2 RHS fn evals = 3001 +f1 RHS fn evals = 3000 +f2 RHS fn evals = 3000 Begin Kepler Problem @@ -82,8 +82,8 @@ Inequality constraint fails = 0 Initial step size = 0.05 Last step size = 0.05 Current step size = 0.05 -f1 RHS fn evals = 6001 -f2 RHS fn evals = 6001 +f1 RHS fn evals = 6000 +f2 RHS fn evals = 6000 Begin Kepler Problem @@ -110,8 +110,8 @@ Inequality constraint fails = 0 Initial step size = 0.025 Last step size = 1.769251412042648e-12 Current step size = 0.025 -f1 RHS fn evals = 12007 -f2 RHS fn evals = 12007 +f1 RHS fn evals = 12006 +f2 RHS fn evals = 12006 Begin Kepler Problem @@ -138,8 +138,8 @@ Inequality constraint fails = 0 Initial step size = 0.0125 Last step size = 0.01249999999719619 Current step size = 0.0125 -f1 RHS fn evals = 24001 -f2 RHS fn evals = 24001 +f1 RHS fn evals = 24000 +f2 RHS fn evals = 24000 Begin Kepler Problem @@ -166,8 +166,8 @@ Inequality constraint fails = 0 Initial step size = 0.00625 Last step size = 0.006249999992917305 Current step size = 0.00625 -f1 RHS fn evals = 48001 -f2 RHS fn evals = 48001 +f1 RHS fn evals = 48000 +f2 RHS fn evals = 48000 Begin Kepler Problem @@ -194,8 +194,8 @@ Inequality constraint fails = 0 Initial step size = 0.003125 Last step size = 1.124078607972478e-11 Current step size = 0.003125 -f1 RHS fn evals = 96007 -f2 RHS fn evals = 96007 +f1 RHS fn evals = 96006 +f2 RHS fn evals = 96006 Begin Kepler Problem @@ -222,8 +222,8 @@ Inequality constraint fails = 0 Initial step size = 0.0015625 Last step size = 2.835776058418557e-11 Current step size = 0.0015625 -f1 RHS fn evals = 192007 -f2 RHS fn evals = 192007 +f1 RHS fn evals = 192006 +f2 RHS fn evals = 192006 Begin Kepler Problem @@ -250,8 +250,8 @@ Inequality constraint fails = 0 Initial step size = 0.00078125 Last step size = 0.0007812499550681189 Current step size = 0.00078125 -f1 RHS fn evals = 384001 -f2 RHS fn evals = 384001 +f1 RHS fn evals = 384000 +f2 RHS fn evals = 384000 Order of accuracy wrt solution: expected = 5, max = 5.9898, avg = 3.4143, overall = 3.7927 Order of accuracy wrt Hamiltonian: expected = 5, max = 5.8607, avg = 3.9728, overall = 4.4560 diff --git a/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_PSEUDO_LEAPFROG_2_2_--tf_50_--check-order_--nout_1.out b/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_PSEUDO_LEAPFROG_2_2_--tf_50_--check-order_--nout_1.out index b32d0a4fa9..1289fd72b9 100644 --- a/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_PSEUDO_LEAPFROG_2_2_--tf_50_--check-order_--nout_1.out +++ b/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_PSEUDO_LEAPFROG_2_2_--tf_50_--check-order_--nout_1.out @@ -23,7 +23,7 @@ Inequality constraint fails = 0 Initial step size = 0.001 Last step size = 2.582822844487962e-11 Current step size = 0.001 -Explicit RHS fn evals = 400009 +Explicit RHS fn evals = 400008 Implicit RHS fn evals = 0 NLS iters = 0 NLS fails = 0 @@ -54,8 +54,8 @@ Inequality constraint fails = 0 Initial step size = 0.001 Last step size = 2.582822844487962e-11 Current step size = 0.001 -f1 RHS fn evals = 100003 -f2 RHS fn evals = 100003 +f1 RHS fn evals = 100002 +f2 RHS fn evals = 100002 Begin Kepler Problem @@ -82,8 +82,8 @@ Inequality constraint fails = 0 Initial step size = 0.0005 Last step size = 0.0004999999432868658 Current step size = 0.0005 -f1 RHS fn evals = 200001 -f2 RHS fn evals = 200001 +f1 RHS fn evals = 200000 +f2 RHS fn evals = 200000 Begin Kepler Problem @@ -110,8 +110,8 @@ Inequality constraint fails = 0 Initial step size = 0.00025 Last step size = 0.0002499998522722533 Current step size = 0.00025 -f1 RHS fn evals = 400001 -f2 RHS fn evals = 400001 +f1 RHS fn evals = 400000 +f2 RHS fn evals = 400000 Begin Kepler Problem @@ -138,8 +138,8 @@ Inequality constraint fails = 0 Initial step size = 0.000125 Last step size = 3.183586727573126e-10 Current step size = 0.000125 -f1 RHS fn evals = 800003 -f2 RHS fn evals = 800003 +f1 RHS fn evals = 800002 +f2 RHS fn evals = 800002 Begin Kepler Problem @@ -166,8 +166,8 @@ Inequality constraint fails = 0 Initial step size = 6.25e-05 Last step size = 7.503473398173804e-10 Current step size = 6.25e-05 -f1 RHS fn evals = 1600003 -f2 RHS fn evals = 1600003 +f1 RHS fn evals = 1600002 +f2 RHS fn evals = 1600002 Begin Kepler Problem @@ -194,8 +194,8 @@ Inequality constraint fails = 0 Initial step size = 3.125e-05 Last step size = 9.66345226061093e-10 Current step size = 3.125e-05 -f1 RHS fn evals = 3200003 -f2 RHS fn evals = 3200003 +f1 RHS fn evals = 3200002 +f2 RHS fn evals = 3200002 Begin Kepler Problem @@ -222,8 +222,8 @@ Inequality constraint fails = 0 Initial step size = 1.5625e-05 Last step size = 1.562198162474714e-05 Current step size = 1.5625e-05 -f1 RHS fn evals = 6400001 -f2 RHS fn evals = 6400001 +f1 RHS fn evals = 6400000 +f2 RHS fn evals = 6400000 Begin Kepler Problem @@ -250,8 +250,8 @@ Inequality constraint fails = 0 Initial step size = 7.8125e-06 Last step size = 7.805897645596353e-06 Current step size = 7.8125e-06 -f1 RHS fn evals = 12800001 -f2 RHS fn evals = 12800001 +f1 RHS fn evals = 12800000 +f2 RHS fn evals = 12800000 Order of accuracy wrt solution: expected = 2, max = 2.0019, avg = 1.9630, overall = 1.9766 Order of accuracy wrt Hamiltonian: expected = 2, max = 2.0012, avg = 2.0000, overall = 2.0001 diff --git a/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_RUTH_3_3_--tf_50_--check-order_--nout_1.out b/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_RUTH_3_3_--tf_50_--check-order_--nout_1.out index 28a629e3c0..eca72a0654 100644 --- a/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_RUTH_3_3_--tf_50_--check-order_--nout_1.out +++ b/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_RUTH_3_3_--tf_50_--check-order_--nout_1.out @@ -23,7 +23,7 @@ Inequality constraint fails = 0 Initial step size = 0.001 Last step size = 2.582822844487962e-11 Current step size = 0.001 -Explicit RHS fn evals = 400009 +Explicit RHS fn evals = 400008 Implicit RHS fn evals = 0 NLS iters = 0 NLS fails = 0 @@ -54,8 +54,8 @@ Inequality constraint fails = 0 Initial step size = 0.1 Last step size = 0.0999999999995608 Current step size = 0.1 -f1 RHS fn evals = 1501 -f2 RHS fn evals = 1501 +f1 RHS fn evals = 1500 +f2 RHS fn evals = 1500 Begin Kepler Problem @@ -82,8 +82,8 @@ Inequality constraint fails = 0 Initial step size = 0.05 Last step size = 0.05 Current step size = 0.05 -f1 RHS fn evals = 3001 -f2 RHS fn evals = 3001 +f1 RHS fn evals = 3000 +f2 RHS fn evals = 3000 Begin Kepler Problem @@ -110,8 +110,8 @@ Inequality constraint fails = 0 Initial step size = 0.025 Last step size = 1.769251412042648e-12 Current step size = 0.025 -f1 RHS fn evals = 6004 -f2 RHS fn evals = 6004 +f1 RHS fn evals = 6003 +f2 RHS fn evals = 6003 Begin Kepler Problem @@ -138,8 +138,8 @@ Inequality constraint fails = 0 Initial step size = 0.0125 Last step size = 0.01249999999719619 Current step size = 0.0125 -f1 RHS fn evals = 12001 -f2 RHS fn evals = 12001 +f1 RHS fn evals = 12000 +f2 RHS fn evals = 12000 Begin Kepler Problem @@ -166,8 +166,8 @@ Inequality constraint fails = 0 Initial step size = 0.00625 Last step size = 0.006249999992917305 Current step size = 0.00625 -f1 RHS fn evals = 24001 -f2 RHS fn evals = 24001 +f1 RHS fn evals = 24000 +f2 RHS fn evals = 24000 Begin Kepler Problem @@ -194,8 +194,8 @@ Inequality constraint fails = 0 Initial step size = 0.003125 Last step size = 1.124078607972478e-11 Current step size = 0.003125 -f1 RHS fn evals = 48004 -f2 RHS fn evals = 48004 +f1 RHS fn evals = 48003 +f2 RHS fn evals = 48003 Begin Kepler Problem @@ -222,8 +222,8 @@ Inequality constraint fails = 0 Initial step size = 0.0015625 Last step size = 2.835776058418557e-11 Current step size = 0.0015625 -f1 RHS fn evals = 96004 -f2 RHS fn evals = 96004 +f1 RHS fn evals = 96003 +f2 RHS fn evals = 96003 Begin Kepler Problem @@ -250,8 +250,8 @@ Inequality constraint fails = 0 Initial step size = 0.00078125 Last step size = 0.0007812499550681189 Current step size = 0.00078125 -f1 RHS fn evals = 192001 -f2 RHS fn evals = 192001 +f1 RHS fn evals = 192000 +f2 RHS fn evals = 192000 Order of accuracy wrt solution: expected = 3, max = 4.0232, avg = 3.9269, overall = 3.9563 Order of accuracy wrt Hamiltonian: expected = 3, max = 5.1799, avg = 3.3283, overall = 3.1911 diff --git a/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_YOSHIDA_6_8_--tf_50_--check-order_--nout_1.out b/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_YOSHIDA_6_8_--tf_50_--check-order_--nout_1.out index d01c6cbeef..f2651ffd39 100644 --- a/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_YOSHIDA_6_8_--tf_50_--check-order_--nout_1.out +++ b/examples/arkode/C_serial/ark_kepler_--stepper_SPRK_--step-mode_fixed_--method_ARKODE_SPRK_YOSHIDA_6_8_--tf_50_--check-order_--nout_1.out @@ -23,7 +23,7 @@ Inequality constraint fails = 0 Initial step size = 0.001 Last step size = 2.582822844487962e-11 Current step size = 0.001 -Explicit RHS fn evals = 400009 +Explicit RHS fn evals = 400008 Implicit RHS fn evals = 0 NLS iters = 0 NLS fails = 0 @@ -54,8 +54,8 @@ Inequality constraint fails = 0 Initial step size = 0.1 Last step size = 0.0999999999995608 Current step size = 0.1 -f1 RHS fn evals = 4001 -f2 RHS fn evals = 4001 +f1 RHS fn evals = 4000 +f2 RHS fn evals = 4000 Begin Kepler Problem @@ -82,8 +82,8 @@ Inequality constraint fails = 0 Initial step size = 0.05 Last step size = 0.05 Current step size = 0.05 -f1 RHS fn evals = 8001 -f2 RHS fn evals = 8001 +f1 RHS fn evals = 8000 +f2 RHS fn evals = 8000 Begin Kepler Problem @@ -110,8 +110,8 @@ Inequality constraint fails = 0 Initial step size = 0.025 Last step size = 1.769251412042648e-12 Current step size = 0.025 -f1 RHS fn evals = 16009 -f2 RHS fn evals = 16009 +f1 RHS fn evals = 16008 +f2 RHS fn evals = 16008 Begin Kepler Problem @@ -138,8 +138,8 @@ Inequality constraint fails = 0 Initial step size = 0.0125 Last step size = 0.01249999999719619 Current step size = 0.0125 -f1 RHS fn evals = 32001 -f2 RHS fn evals = 32001 +f1 RHS fn evals = 32000 +f2 RHS fn evals = 32000 Begin Kepler Problem @@ -166,8 +166,8 @@ Inequality constraint fails = 0 Initial step size = 0.00625 Last step size = 0.006249999992917305 Current step size = 0.00625 -f1 RHS fn evals = 64001 -f2 RHS fn evals = 64001 +f1 RHS fn evals = 64000 +f2 RHS fn evals = 64000 Begin Kepler Problem @@ -194,8 +194,8 @@ Inequality constraint fails = 0 Initial step size = 0.003125 Last step size = 1.124078607972478e-11 Current step size = 0.003125 -f1 RHS fn evals = 128009 -f2 RHS fn evals = 128009 +f1 RHS fn evals = 128008 +f2 RHS fn evals = 128008 Begin Kepler Problem @@ -222,8 +222,8 @@ Inequality constraint fails = 0 Initial step size = 0.0015625 Last step size = 2.835776058418557e-11 Current step size = 0.0015625 -f1 RHS fn evals = 256009 -f2 RHS fn evals = 256009 +f1 RHS fn evals = 256008 +f2 RHS fn evals = 256008 Begin Kepler Problem @@ -250,8 +250,8 @@ Inequality constraint fails = 0 Initial step size = 0.00078125 Last step size = 0.0007812499550681189 Current step size = 0.00078125 -f1 RHS fn evals = 512001 -f2 RHS fn evals = 512001 +f1 RHS fn evals = 512000 +f2 RHS fn evals = 512000 Order of accuracy wrt solution: expected = 6, max = 5.9959, avg = 3.9792, overall = 4.5039 Order of accuracy wrt Hamiltonian: expected = 6, max = 6.2667, avg = 4.6429, overall = 4.9135 diff --git a/examples/arkode/C_serial/ark_kpr_mri.out b/examples/arkode/C_serial/ark_kpr_mri.out index 5f8ee0f5d8..e551c2cee3 100644 --- a/examples/arkode/C_serial/ark_kpr_mri.out +++ b/examples/arkode/C_serial/ark_kpr_mri.out @@ -66,4 +66,4 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: Final Solver Statistics: Steps: nsts = 501, nstf = 50601 u error = 7.941e-07, v error = 8.255e-08, total error = 5.646e-07 - Total RHS evals: Fs = 1504, Ff = 152306 + Total RHS evals: Fs = 1504, Ff = 151853 diff --git a/examples/arkode/C_serial/ark_kpr_mri_0_0.002.out b/examples/arkode/C_serial/ark_kpr_mri_0_0.002.out index 4957509c74..ef1ab12278 100644 --- a/examples/arkode/C_serial/ark_kpr_mri_0_0.002.out +++ b/examples/arkode/C_serial/ark_kpr_mri_0_0.002.out @@ -65,5 +65,5 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: Final Solver Statistics: Steps: nsts = 2501, nstf = 252601 - u error = 4.670e-09, v error = 5.638e-10, total error = 3.327e-09 - Total RHS evals: Fs = 7504, Ff = 760306 + u error = 4.671e-09, v error = 5.638e-10, total error = 3.327e-09 + Total RHS evals: Fs = 7504, Ff = 757853 diff --git a/examples/arkode/C_serial/ark_kpr_mri_1_0.002.out b/examples/arkode/C_serial/ark_kpr_mri_1_0.002.out index 40ed2fe4b3..2cb8b8d4ff 100644 --- a/examples/arkode/C_serial/ark_kpr_mri_1_0.002.out +++ b/examples/arkode/C_serial/ark_kpr_mri_1_0.002.out @@ -66,4 +66,4 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: Final Solver Statistics: Steps: nsts = 2501, nstf = 252601 u error = 3.156e-13, v error = 1.909e-12, total error = 1.368e-12 - Total RHS evals: Fs = 5003, Ff = 760306 + Total RHS evals: Fs = 5003, Ff = 757853 diff --git a/examples/arkode/C_serial/ark_kpr_mri_3_0.01.out b/examples/arkode/C_serial/ark_kpr_mri_3_0.01.out index bb74cbef2d..9504b4c524 100644 --- a/examples/arkode/C_serial/ark_kpr_mri_3_0.01.out +++ b/examples/arkode/C_serial/ark_kpr_mri_3_0.01.out @@ -65,4 +65,4 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: Final Solver Statistics: Steps: nsts = 501, nstf = 50601 u error = 5.052e-05, v error = 7.684e-04, total error = 5.445e-04 - Total RHS evals: Fs = 1504, Ff = 152306 + Total RHS evals: Fs = 1504, Ff = 151853 diff --git a/examples/arkode/C_serial/ark_kpr_mri_4_0.002.out b/examples/arkode/C_serial/ark_kpr_mri_4_0.002.out index 5177842335..9f53b0e3b4 100644 --- a/examples/arkode/C_serial/ark_kpr_mri_4_0.002.out +++ b/examples/arkode/C_serial/ark_kpr_mri_4_0.002.out @@ -66,7 +66,7 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: Final Solver Statistics: Steps: nsts = 2501, nstf = 250100 u error = 3.482e-06, v error = 9.535e-04, total error = 6.742e-04 - Total RHS evals: Fs = 7143, Ff = 755303 + Total RHS evals: Fs = 7143, Ff = 750350 Slow Newton iters = 4641 Slow Newton conv fails = 0 Slow Jacobian evals = 126 diff --git a/examples/arkode/C_serial/ark_kpr_mri_5_0.002.out b/examples/arkode/C_serial/ark_kpr_mri_5_0.002.out index 654cb30f41..1a38aa16e6 100644 --- a/examples/arkode/C_serial/ark_kpr_mri_5_0.002.out +++ b/examples/arkode/C_serial/ark_kpr_mri_5_0.002.out @@ -23,47 +23,47 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: 1.000000 1.127010 1.691839 1.33e-10 6.94e-11 1.100000 1.107609 1.000489 1.23e-10 7.12e-11 1.200000 1.086821 1.677552 1.12e-10 7.21e-11 - 1.300000 1.064777 1.277775 9.90e-11 7.21e-11 + 1.300000 1.064777 1.277775 9.89e-11 7.21e-11 1.400000 1.041625 1.342455 8.49e-11 7.13e-11 1.500000 1.017531 1.642940 6.94e-11 6.96e-11 1.600000 0.992673 1.012112 5.24e-11 6.69e-11 1.700000 0.967253 1.714058 3.37e-11 6.34e-11 1.800000 0.941488 1.183867 1.32e-11 5.89e-11 - 1.900000 0.915617 1.437465 9.12e-12 5.33e-11 + 1.900000 0.915617 1.437465 9.11e-12 5.33e-11 2.000000 0.889903 1.577082 3.33e-11 4.69e-11 - 2.100000 0.864625 1.056467 5.94e-11 3.62e-11 - 2.200000 0.840089 1.730920 8.72e-11 3.20e-11 - 2.300000 0.816616 1.101047 1.16e-10 1.85e-11 - 2.400000 0.794546 1.525051 1.47e-10 1.05e-11 - 2.500000 0.774227 1.496993 1.78e-10 1.19e-12 - 2.600000 0.756013 1.126857 2.08e-10 1.60e-11 - 2.700000 0.740246 1.727536 2.36e-10 2.55e-11 - 2.800000 0.727247 1.038393 2.62e-10 4.36e-11 - 2.900000 0.717301 1.600759 2.83e-10 5.41e-11 - 3.000000 0.710636 1.406380 2.99e-10 6.92e-11 - 3.100000 0.707412 1.214353 3.07e-10 8.37e-11 - 3.200000 0.707709 1.704026 3.08e-10 9.30e-11 + 2.100000 0.864625 1.056467 5.94e-11 3.57e-11 + 2.200000 0.840089 1.730920 8.72e-11 3.22e-11 + 2.300000 0.816616 1.101047 1.16e-10 1.97e-11 + 2.400000 0.794546 1.525051 1.47e-10 7.75e-12 + 2.500000 0.774227 1.496993 1.78e-10 2.45e-12 + 2.600000 0.756013 1.126857 2.08e-10 1.99e-11 + 2.700000 0.740246 1.727536 2.36e-10 2.32e-11 + 2.800000 0.727247 1.038393 2.62e-10 4.19e-11 + 2.900000 0.717301 1.600759 2.83e-10 5.92e-11 + 3.000000 0.710636 1.406380 2.99e-10 6.19e-11 + 3.100000 0.707412 1.214353 3.07e-10 9.20e-11 + 3.200000 0.707709 1.704026 3.08e-10 8.71e-11 3.300000 0.711520 1.004391 3.02e-10 1.08e-10 - 3.400000 0.718750 1.661225 2.88e-10 1.14e-10 - 3.500000 0.729227 1.310102 2.68e-10 1.23e-10 - 3.600000 0.742712 1.310080 2.43e-10 1.28e-10 - 3.700000 0.758914 1.661237 2.15e-10 1.29e-10 - 3.800000 0.777506 1.004387 1.85e-10 1.34e-10 - 3.900000 0.798144 1.704019 1.54e-10 1.28e-10 - 4.000000 0.820474 1.214374 1.24e-10 1.28e-10 - 4.100000 0.844149 1.406358 9.39e-11 1.22e-10 - 4.200000 0.868832 1.600774 6.55e-11 1.14e-10 - 4.300000 0.894204 1.038382 3.88e-11 1.10e-10 - 4.400000 0.919964 1.727533 1.40e-11 9.70e-11 - 4.500000 0.945834 1.126875 8.93e-12 9.14e-11 - 4.600000 0.971557 1.496974 3.00e-11 7.93e-11 - 4.700000 0.996898 1.525070 4.92e-11 6.88e-11 - 4.800000 1.021641 1.101030 6.67e-11 6.10e-11 - 4.900000 1.045589 1.730922 8.26e-11 4.65e-11 - 5.000000 1.068565 1.056480 9.70e-11 4.02e-11 + 3.400000 0.718750 1.661225 2.88e-10 1.19e-10 + 3.500000 0.729227 1.310102 2.68e-10 1.13e-10 + 3.600000 0.742712 1.310080 2.43e-10 1.41e-10 + 3.700000 0.758914 1.661237 2.15e-10 1.18e-10 + 3.800000 0.777506 1.004387 1.85e-10 1.38e-10 + 3.900000 0.798144 1.704019 1.54e-10 1.31e-10 + 4.000000 0.820474 1.214374 1.24e-10 1.16e-10 + 4.100000 0.844149 1.406358 9.39e-11 1.38e-10 + 4.200000 0.868832 1.600774 6.55e-11 9.88e-11 + 4.300000 0.894204 1.038382 3.88e-11 1.20e-10 + 4.400000 0.919964 1.727533 1.40e-11 9.58e-11 + 4.500000 0.945834 1.126875 8.93e-12 8.01e-11 + 4.600000 0.971557 1.496974 3.00e-11 9.82e-11 + 4.700000 0.996898 1.525070 4.92e-11 4.94e-11 + 4.800000 1.021641 1.101030 6.67e-11 7.79e-11 + 4.900000 1.045589 1.730922 8.26e-11 3.90e-11 + 5.000000 1.068565 1.056480 9.70e-11 3.19e-11 ------------------------------------------------------ Final Solver Statistics: Steps: nsts = 2501, nstf = 250100 - u error = 1.665e-10, v error = 7.685e-11, total error = 1.296e-10 - Total RHS evals: Fs = 12506, Ff = 1002903 + u error = 1.665e-10, v error = 7.714e-11, total error = 1.297e-10 + Total RHS evals: Fs = 12506, Ff = 1000450 diff --git a/examples/arkode/C_serial/ark_kpr_mri_6_0.005.out b/examples/arkode/C_serial/ark_kpr_mri_6_0.005.out index b89492c708..7929d73e39 100644 --- a/examples/arkode/C_serial/ark_kpr_mri_6_0.005.out +++ b/examples/arkode/C_serial/ark_kpr_mri_6_0.005.out @@ -33,10 +33,10 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: 2.000000 0.889903 1.577082 1.50e-09 1.98e-09 2.100000 0.864625 1.056467 2.68e-09 1.66e-09 2.200000 0.840089 1.730920 3.94e-09 1.30e-09 - 2.300000 0.816616 1.101047 5.27e-09 8.99e-10 - 2.400000 0.794546 1.525051 6.65e-09 4.49e-10 - 2.500000 0.774227 1.496993 8.05e-09 4.16e-11 - 2.600000 0.756013 1.126857 9.42e-09 5.71e-10 + 2.300000 0.816616 1.101047 5.27e-09 9.00e-10 + 2.400000 0.794546 1.525051 6.65e-09 4.47e-10 + 2.500000 0.774227 1.496993 8.05e-09 3.94e-11 + 2.600000 0.756013 1.126857 9.42e-09 5.73e-10 2.700000 0.740246 1.727536 1.07e-08 1.13e-09 2.800000 0.727247 1.038393 1.19e-08 1.71e-09 2.900000 0.717301 1.600759 1.29e-08 2.31e-09 @@ -44,13 +44,13 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: 3.100000 0.707412 1.214353 1.40e-08 3.46e-09 3.200000 0.707709 1.704026 1.40e-08 3.98e-09 3.300000 0.711520 1.004391 1.37e-08 4.45e-09 - 3.400000 0.718750 1.661225 1.31e-08 4.84e-09 + 3.400000 0.718750 1.661225 1.31e-08 4.85e-09 3.500000 0.729227 1.310102 1.22e-08 5.15e-09 - 3.600000 0.742712 1.310080 1.11e-08 5.37e-09 - 3.700000 0.758914 1.661237 9.81e-09 5.50e-09 + 3.600000 0.742712 1.310080 1.11e-08 5.38e-09 + 3.700000 0.758914 1.661237 9.81e-09 5.49e-09 3.800000 0.777506 1.004387 8.45e-09 5.53e-09 3.900000 0.798144 1.704019 7.04e-09 5.47e-09 - 4.000000 0.820474 1.214374 5.64e-09 5.34e-09 + 4.000000 0.820474 1.214374 5.64e-09 5.33e-09 4.100000 0.844149 1.406358 4.29e-09 5.13e-09 4.200000 0.868832 1.600774 3.00e-09 4.86e-09 4.300000 0.894204 1.038382 1.78e-09 4.54e-09 @@ -58,7 +58,7 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: 4.500000 0.945834 1.126875 3.93e-10 3.79e-09 4.600000 0.971557 1.496974 1.35e-09 3.38e-09 4.700000 0.996898 1.525070 2.23e-09 2.94e-09 - 4.800000 1.021641 1.101030 3.02e-09 2.50e-09 + 4.800000 1.021641 1.101030 3.02e-09 2.51e-09 4.900000 1.045589 1.730922 3.75e-09 2.06e-09 5.000000 1.068565 1.056480 4.40e-09 1.61e-09 ------------------------------------------------------ @@ -66,4 +66,4 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: Final Solver Statistics: Steps: nsts = 1001, nstf = 100100 u error = 7.569e-09, v error = 3.238e-09, total error = 5.821e-09 - Total RHS evals: Fs = 5006, Ff = 301303 + Total RHS evals: Fs = 5006, Ff = 300350 diff --git a/examples/arkode/C_serial/ark_kpr_mri_7_0.001.out b/examples/arkode/C_serial/ark_kpr_mri_7_0.001.out index c635bf99a5..460bf53318 100644 --- a/examples/arkode/C_serial/ark_kpr_mri_7_0.001.out +++ b/examples/arkode/C_serial/ark_kpr_mri_7_0.001.out @@ -66,7 +66,7 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: Final Solver Statistics: Steps: nsts = 5000, nstf = 510000 u error = 3.803e-10, v error = 3.943e-10, total error = 3.874e-10 - Total RHS evals: Fs = 45313, Ff = 1550001 + Total RHS evals: Fs = 45313, Ff = 1530050 Slow Newton iters = 30312 Slow Newton conv fails = 0 Slow Jacobian evals = 250 diff --git a/examples/arkode/C_serial/ark_kpr_mri_7_0.001_-100_100_0.5_1.out b/examples/arkode/C_serial/ark_kpr_mri_7_0.001_-100_100_0.5_1.out index d70f3bcd8a..38dc23acf1 100644 --- a/examples/arkode/C_serial/ark_kpr_mri_7_0.001_-100_100_0.5_1.out +++ b/examples/arkode/C_serial/ark_kpr_mri_7_0.001_-100_100_0.5_1.out @@ -27,7 +27,7 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: 1.400000 1.041625 1.342455 1.95e-10 3.59e-10 1.500000 1.017531 1.642940 1.58e-10 3.46e-10 1.600000 0.992673 1.012112 1.21e-10 3.37e-10 - 1.700000 0.967253 1.714058 7.80e-11 3.14e-10 + 1.700000 0.967253 1.714058 7.81e-11 3.14e-10 1.800000 0.941488 1.183867 3.34e-11 2.95e-10 1.900000 0.915617 1.437465 1.78e-11 2.65e-10 2.000000 0.889903 1.577082 7.23e-11 2.30e-10 @@ -51,7 +51,7 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: 3.800000 0.777506 1.004387 4.21e-10 6.69e-10 3.900000 0.798144 1.704019 3.62e-10 6.66e-10 4.000000 0.820474 1.214374 2.84e-10 6.45e-10 - 4.100000 0.844149 1.406358 3.44e-10 6.14e-10 + 4.100000 0.844149 1.406358 3.43e-10 6.14e-10 4.200000 0.868832 1.600774 1.51e-10 5.74e-10 4.300000 0.894204 1.038382 9.08e-11 5.56e-10 4.400000 0.919964 1.727533 4.15e-11 5.08e-10 @@ -66,7 +66,7 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: Final Solver Statistics: Steps: nsts = 5000, nstf = 510000 u error = 3.764e-10, v error = 3.952e-10, total error = 3.859e-10 - Total RHS evals: Fs = 35313, Ff = 1550001 + Total RHS evals: Fs = 35313, Ff = 1530050 Slow Newton iters = 30312 Slow Newton conv fails = 0 Slow Jacobian evals = 250 diff --git a/examples/arkode/C_serial/ark_kpr_mri_8_0.001.out b/examples/arkode/C_serial/ark_kpr_mri_8_0.001.out index 094d1b1024..f96e203514 100644 --- a/examples/arkode/C_serial/ark_kpr_mri_8_0.001.out +++ b/examples/arkode/C_serial/ark_kpr_mri_8_0.001.out @@ -25,17 +25,17 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: 1.200000 1.086821 1.677552 1.17e-10 1.57e-10 1.300000 1.064777 1.277775 1.10e-10 1.55e-10 1.400000 1.041625 1.342455 9.08e-11 1.53e-10 - 1.500000 1.017531 1.642940 6.97e-11 1.52e-10 + 1.500000 1.017531 1.642940 6.96e-11 1.52e-10 1.600000 0.992673 1.012112 5.33e-11 1.42e-10 1.700000 0.967253 1.714058 3.20e-11 1.38e-10 1.800000 0.941488 1.183867 1.63e-11 1.24e-10 1.900000 0.915617 1.437465 1.06e-11 1.13e-10 2.000000 0.889903 1.577082 3.61e-11 9.93e-11 2.100000 0.864625 1.056467 6.56e-11 7.88e-11 - 2.200000 0.840089 1.730920 9.96e-11 6.38e-11 + 2.200000 0.840089 1.730920 9.97e-11 6.38e-11 2.300000 0.816616 1.101047 1.27e-10 3.80e-11 2.400000 0.794546 1.525051 1.59e-10 1.69e-11 - 2.500000 0.774227 1.496993 1.88e-10 9.37e-12 + 2.500000 0.774227 1.496993 1.88e-10 9.36e-12 2.600000 0.756013 1.126857 2.24e-10 3.98e-11 2.700000 0.740246 1.727536 2.59e-10 6.53e-11 2.800000 0.727247 1.038393 2.83e-10 1.00e-10 @@ -52,12 +52,12 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: 3.900000 0.798144 1.704019 1.58e-10 2.78e-10 4.000000 0.820474 1.214374 1.33e-10 2.73e-10 4.100000 0.844149 1.406358 9.74e-11 2.68e-10 - 4.200000 0.868832 1.600774 6.65e-11 2.60e-10 + 4.200000 0.868832 1.600774 6.64e-11 2.60e-10 4.300000 0.894204 1.038382 3.79e-11 2.21e-10 - 4.400000 0.919964 1.727533 9.38e-12 2.25e-10 + 4.400000 0.919964 1.727533 9.36e-12 2.25e-10 4.500000 0.945834 1.126875 1.03e-11 1.82e-10 4.600000 0.971557 1.496974 3.35e-11 1.74e-10 - 4.700000 0.996898 1.525070 5.02e-11 1.52e-10 + 4.700000 0.996898 1.525070 5.03e-11 1.52e-10 4.800000 1.021641 1.101030 7.16e-11 1.11e-10 4.900000 1.045589 1.730922 9.30e-11 1.12e-10 5.000000 1.068565 1.056480 1.05e-10 6.39e-11 @@ -66,7 +66,7 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: Final Solver Statistics: Steps: nsts = 5000, nstf = 510000 u error = 1.795e-10, v error = 1.678e-10, total error = 1.737e-10 - Total RHS evals: Fse = 20001, Fsi = 50342, Ff = 1550001 + Total RHS evals: Fse = 20001, Fsi = 50342, Ff = 1530050 Slow Newton iters = 30341 Slow Newton conv fails = 0 Slow Jacobian evals = 250 diff --git a/examples/arkode/C_serial/ark_kpr_mri_8_0.001_-100_100_0.5_1.out b/examples/arkode/C_serial/ark_kpr_mri_8_0.001_-100_100_0.5_1.out index 2d69932a6a..f9d68539de 100644 --- a/examples/arkode/C_serial/ark_kpr_mri_8_0.001_-100_100_0.5_1.out +++ b/examples/arkode/C_serial/ark_kpr_mri_8_0.001_-100_100_0.5_1.out @@ -54,8 +54,8 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: 4.100000 0.844149 1.406358 9.48e-11 2.67e-10 4.200000 0.868832 1.600774 6.42e-11 2.59e-10 4.300000 0.894204 1.038382 3.58e-11 2.20e-10 - 4.400000 0.919964 1.727533 9.15e-12 2.25e-10 - 4.500000 0.945834 1.126875 1.30e-11 1.82e-10 + 4.400000 0.919964 1.727533 9.16e-12 2.25e-10 + 4.500000 0.945834 1.126875 1.29e-11 1.82e-10 4.600000 0.971557 1.496974 3.55e-11 1.73e-10 4.700000 0.996898 1.525070 5.41e-11 1.52e-10 4.800000 1.021641 1.101030 7.39e-11 1.11e-10 @@ -66,7 +66,7 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: Final Solver Statistics: Steps: nsts = 5000, nstf = 510000 u error = 1.860e-10, v error = 1.672e-10, total error = 1.769e-10 - Total RHS evals: Fse = 20001, Fsi = 35342, Ff = 1550001 + Total RHS evals: Fse = 20001, Fsi = 35342, Ff = 1530050 Slow Newton iters = 30341 Slow Newton conv fails = 0 Slow Jacobian evals = 250 diff --git a/examples/arkode/C_serial/ark_kpr_mri_9_0.001.out b/examples/arkode/C_serial/ark_kpr_mri_9_0.001.out index 0d0c029141..8da07cba27 100644 --- a/examples/arkode/C_serial/ark_kpr_mri_9_0.001.out +++ b/examples/arkode/C_serial/ark_kpr_mri_9_0.001.out @@ -11,62 +11,62 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: t u v uerr verr ------------------------------------------------------ 0.000000 1.224745 1.732051 0.00e+00 0.00e+00 - 0.100000 1.223725 1.077464 1.63e-11 6.37e-13 + 0.100000 1.223725 1.077464 1.63e-11 6.38e-13 0.200000 1.220669 1.551800 1.60e-11 6.83e-13 0.300000 1.215594 1.467737 1.52e-11 9.61e-13 - 0.400000 1.208524 1.154583 1.51e-11 9.21e-13 - 0.500000 1.199496 1.721908 1.60e-11 1.72e-12 + 0.400000 1.208524 1.154583 1.51e-11 9.22e-13 + 0.500000 1.199496 1.721908 1.60e-11 1.73e-12 0.600000 1.188557 1.023517 1.48e-11 3.43e-12 0.700000 1.175764 1.622751 1.36e-11 2.17e-12 0.800000 1.161186 1.374632 1.23e-11 2.77e-12 - 0.900000 1.144904 1.245763 1.13e-11 3.12e-12 - 1.000000 1.127010 1.691839 1.30e-11 2.17e-12 - 1.100000 1.107609 1.000489 1.11e-11 1.99e-12 - 1.200000 1.086821 1.677552 9.53e-12 2.46e-12 - 1.300000 1.064777 1.277775 7.58e-12 8.15e-14 - 1.400000 1.041625 1.342455 5.18e-12 6.19e-13 - 1.500000 1.017531 1.642940 6.00e-12 2.62e-12 - 1.600000 0.992673 1.012112 3.78e-12 1.37e-12 - 1.700000 0.967253 1.714058 3.29e-12 3.05e-12 - 1.800000 0.941488 1.183867 2.33e-13 3.64e-13 - 1.900000 0.915617 1.437465 3.31e-12 1.16e-12 - 2.000000 0.889903 1.577082 6.58e-12 1.93e-12 - 2.100000 0.864625 1.056467 7.90e-12 1.61e-12 - 2.200000 0.840089 1.730920 6.75e-12 2.46e-12 - 2.300000 0.816616 1.101047 1.18e-11 1.79e-12 - 2.400000 0.794546 1.525051 1.53e-11 5.67e-13 - 2.500000 0.774227 1.496993 1.85e-11 6.68e-14 - 2.600000 0.756013 1.126857 2.18e-11 2.74e-12 - 2.700000 0.740246 1.727536 2.05e-11 7.31e-13 - 2.800000 0.727247 1.038393 2.46e-11 4.05e-12 - 2.900000 0.717301 1.600759 2.68e-11 9.31e-13 - 3.000000 0.710636 1.406380 2.78e-11 2.59e-12 - 3.100000 0.707412 1.214353 2.85e-11 4.24e-12 - 3.200000 0.707709 1.704026 2.85e-11 1.49e-12 - 3.300000 0.711520 1.004391 2.77e-11 6.31e-12 - 3.400000 0.718750 1.661225 2.60e-11 2.42e-12 - 3.500000 0.729227 1.310102 2.41e-11 4.83e-12 - 3.600000 0.742712 1.310080 2.08e-11 5.02e-12 - 3.700000 0.758914 1.661237 1.99e-11 2.84e-12 - 3.800000 0.777506 1.004387 1.62e-11 7.00e-12 - 3.900000 0.798144 1.704019 1.39e-11 2.46e-12 - 4.000000 0.820474 1.214374 1.04e-11 5.40e-12 - 4.100000 0.844149 1.406358 6.45e-12 8.29e-12 - 4.200000 0.868832 1.600774 3.62e-12 1.13e-11 - 4.300000 0.894204 1.038382 1.62e-12 2.54e-13 - 4.400000 0.919964 1.727533 2.31e-12 1.24e-11 - 4.500000 0.945834 1.126875 2.27e-12 7.51e-13 - 4.600000 0.971557 1.496974 5.17e-12 6.90e-12 - 4.700000 0.996898 1.525070 8.51e-12 6.90e-12 - 4.800000 1.021641 1.101030 8.53e-12 1.57e-12 - 4.900000 1.045589 1.730922 6.09e-12 9.55e-12 - 5.000000 1.068565 1.056480 9.98e-12 3.37e-12 + 0.900000 1.144904 1.245763 1.12e-11 3.13e-12 + 1.000000 1.127010 1.691839 1.31e-11 2.17e-12 + 1.100000 1.107609 1.000489 1.11e-11 2.12e-12 + 1.200000 1.086821 1.677552 9.50e-12 1.93e-12 + 1.300000 1.064777 1.277775 7.58e-12 1.91e-12 + 1.400000 1.041625 1.342455 5.18e-12 2.57e-12 + 1.500000 1.017531 1.642940 6.04e-12 5.82e-12 + 1.600000 0.992673 1.012112 3.77e-12 3.35e-12 + 1.700000 0.967253 1.714058 3.32e-12 2.74e-12 + 1.800000 0.941488 1.183867 2.38e-13 3.75e-12 + 1.900000 0.915617 1.437465 3.30e-12 5.77e-12 + 2.000000 0.889903 1.577082 6.57e-12 8.88e-12 + 2.100000 0.864625 1.056467 7.88e-12 7.37e-12 + 2.200000 0.840089 1.730920 6.75e-12 4.53e-12 + 2.300000 0.816616 1.101047 1.18e-11 3.00e-12 + 2.400000 0.794546 1.525051 1.53e-11 8.93e-12 + 2.500000 0.774227 1.496993 1.85e-11 1.08e-11 + 2.600000 0.756013 1.126857 2.18e-11 1.35e-11 + 2.700000 0.740246 1.727536 2.05e-11 6.87e-12 + 2.800000 0.727247 1.038393 2.46e-11 7.76e-13 + 2.900000 0.717301 1.600759 2.68e-11 1.11e-11 + 3.000000 0.710636 1.406380 2.78e-11 1.14e-11 + 3.100000 0.707412 1.214353 2.85e-11 2.04e-11 + 3.200000 0.707709 1.704026 2.85e-11 9.74e-12 + 3.300000 0.711520 1.004391 2.77e-11 7.12e-12 + 3.400000 0.718750 1.661225 2.60e-11 1.06e-11 + 3.500000 0.729227 1.310102 2.41e-11 1.14e-11 + 3.600000 0.742712 1.310080 2.08e-11 2.60e-11 + 3.700000 0.758914 1.661237 1.99e-11 1.39e-11 + 3.800000 0.777506 1.004387 1.62e-11 1.43e-11 + 3.900000 0.798144 1.704019 1.39e-11 5.96e-12 + 4.000000 0.820474 1.214374 1.04e-11 1.12e-11 + 4.100000 0.844149 1.406358 6.45e-12 2.95e-11 + 4.200000 0.868832 1.600774 3.65e-12 5.01e-12 + 4.300000 0.894204 1.038382 1.63e-12 9.96e-12 + 4.400000 0.919964 1.727533 2.33e-12 1.06e-11 + 4.500000 0.945834 1.126875 2.28e-12 5.45e-12 + 4.600000 0.971557 1.496974 5.15e-12 1.52e-11 + 4.700000 0.996898 1.525070 8.52e-12 7.66e-13 + 4.800000 1.021641 1.101030 8.55e-12 1.92e-12 + 4.900000 1.045589 1.730922 6.11e-12 8.80e-12 + 5.000000 1.068565 1.056480 9.97e-12 3.37e-12 ------------------------------------------------------ Final Solver Statistics: Steps: nsts = 5000, nstf = 510000 - u error = 1.532e-11, v error = 4.194e-12, total error = 1.123e-11 - Total RHS evals: Fse = 30001, Fsi = 82555, Ff = 2070001 + u error = 1.532e-11, v error = 9.496e-12, total error = 1.274e-11 + Total RHS evals: Fse = 30001, Fsi = 82555, Ff = 2040050 Slow Newton iters = 52554 Slow Newton conv fails = 0 Slow Jacobian evals = 250 diff --git a/examples/arkode/C_serial/ark_kpr_mri_9_0.001_-100_100_0.5_1.out b/examples/arkode/C_serial/ark_kpr_mri_9_0.001_-100_100_0.5_1.out index 3ca62f46fd..a227a0db6a 100644 --- a/examples/arkode/C_serial/ark_kpr_mri_9_0.001_-100_100_0.5_1.out +++ b/examples/arkode/C_serial/ark_kpr_mri_9_0.001_-100_100_0.5_1.out @@ -11,7 +11,7 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: t u v uerr verr ------------------------------------------------------ 0.000000 1.224745 1.732051 0.00e+00 0.00e+00 - 0.100000 1.223725 1.077464 1.63e-11 6.37e-13 + 0.100000 1.223725 1.077464 1.64e-11 6.38e-13 0.200000 1.220669 1.551800 1.61e-11 6.85e-13 0.300000 1.215594 1.467737 1.58e-11 9.70e-13 0.400000 1.208524 1.154583 1.55e-11 9.37e-13 @@ -19,54 +19,54 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: 0.600000 1.188557 1.023517 1.50e-11 3.45e-12 0.700000 1.175764 1.622751 1.40e-11 2.20e-12 0.800000 1.161186 1.374632 1.20e-11 2.83e-12 - 0.900000 1.144904 1.245763 1.22e-11 3.18e-12 + 0.900000 1.144904 1.245763 1.23e-11 3.18e-12 1.000000 1.127010 1.691839 1.28e-11 2.23e-12 - 1.100000 1.107609 1.000489 1.13e-11 1.92e-12 - 1.200000 1.086821 1.677552 9.93e-12 2.55e-12 - 1.300000 1.064777 1.277775 7.67e-12 1.72e-13 - 1.400000 1.041625 1.342455 6.64e-12 7.05e-13 - 1.500000 1.017531 1.642940 6.42e-12 2.73e-12 - 1.600000 0.992673 1.012112 4.49e-12 1.25e-12 - 1.700000 0.967253 1.714058 3.11e-12 3.19e-12 - 1.800000 0.941488 1.183867 5.46e-14 2.23e-13 - 1.900000 0.915617 1.437465 1.89e-12 1.29e-12 - 2.000000 0.889903 1.577082 4.66e-12 2.09e-12 - 2.100000 0.864625 1.056467 6.54e-12 1.44e-12 - 2.200000 0.840089 1.730920 7.40e-12 2.63e-12 - 2.300000 0.816616 1.101047 1.16e-11 1.62e-12 - 2.400000 0.794546 1.525051 1.48e-11 7.29e-13 - 2.500000 0.774227 1.496993 1.92e-11 2.39e-13 - 2.600000 0.756013 1.126857 2.04e-11 2.58e-12 - 2.700000 0.740246 1.727536 2.11e-11 8.85e-13 - 2.800000 0.727247 1.038393 2.44e-11 3.90e-12 - 2.900000 0.717301 1.600759 2.66e-11 7.90e-13 - 3.000000 0.710636 1.406380 2.78e-11 2.46e-12 - 3.100000 0.707412 1.214353 2.84e-11 4.12e-12 - 3.200000 0.707709 1.704026 2.84e-11 1.38e-12 - 3.300000 0.711520 1.004391 2.77e-11 6.21e-12 - 3.400000 0.718750 1.661225 2.61e-11 2.34e-12 - 3.500000 0.729227 1.310102 2.42e-11 4.77e-12 - 3.600000 0.742712 1.310080 2.16e-11 4.95e-12 - 3.700000 0.758914 1.661237 1.99e-11 2.79e-12 - 3.800000 0.777506 1.004387 1.67e-11 6.97e-12 - 3.900000 0.798144 1.704019 1.39e-11 2.45e-12 - 4.000000 0.820474 1.214374 1.05e-11 5.41e-12 - 4.100000 0.844149 1.406358 7.58e-12 8.30e-12 - 4.200000 0.868832 1.600774 5.05e-12 1.14e-11 - 4.300000 0.894204 1.038382 2.82e-12 3.26e-13 - 4.400000 0.919964 1.727533 1.81e-12 1.24e-11 - 4.500000 0.945834 1.126875 1.90e-12 8.41e-13 - 4.600000 0.971557 1.496974 3.74e-12 6.99e-12 - 4.700000 0.996898 1.525070 5.90e-12 7.03e-12 - 4.800000 1.021641 1.101030 7.15e-12 1.43e-12 - 4.900000 1.045589 1.730922 6.82e-12 9.68e-12 - 5.000000 1.068565 1.056480 9.36e-12 3.23e-12 + 1.100000 1.107609 1.000489 1.13e-11 2.05e-12 + 1.200000 1.086821 1.677552 9.92e-12 2.03e-12 + 1.300000 1.064777 1.277775 7.66e-12 2.00e-12 + 1.400000 1.041625 1.342455 6.65e-12 2.48e-12 + 1.500000 1.017531 1.642940 6.42e-12 5.92e-12 + 1.600000 0.992673 1.012112 4.49e-12 3.23e-12 + 1.700000 0.967253 1.714058 3.11e-12 2.87e-12 + 1.800000 0.941488 1.183867 5.85e-14 3.89e-12 + 1.900000 0.915617 1.437465 1.88e-12 5.63e-12 + 2.000000 0.889903 1.577082 4.65e-12 9.04e-12 + 2.100000 0.864625 1.056467 6.53e-12 7.20e-12 + 2.200000 0.840089 1.730920 7.39e-12 4.70e-12 + 2.300000 0.816616 1.101047 1.16e-11 3.16e-12 + 2.400000 0.794546 1.525051 1.48e-11 8.77e-12 + 2.500000 0.774227 1.496993 1.92e-11 1.10e-11 + 2.600000 0.756013 1.126857 2.04e-11 1.34e-11 + 2.700000 0.740246 1.727536 2.11e-11 7.02e-12 + 2.800000 0.727247 1.038393 2.44e-11 6.36e-13 + 2.900000 0.717301 1.600759 2.66e-11 1.09e-11 + 3.000000 0.710636 1.406380 2.78e-11 1.16e-11 + 3.100000 0.707412 1.214353 2.84e-11 2.03e-11 + 3.200000 0.707709 1.704026 2.84e-11 9.85e-12 + 3.300000 0.711520 1.004391 2.77e-11 7.02e-12 + 3.400000 0.718750 1.661225 2.61e-11 1.05e-11 + 3.500000 0.729227 1.310102 2.42e-11 1.14e-11 + 3.600000 0.742712 1.310080 2.16e-11 2.60e-11 + 3.700000 0.758914 1.661237 1.99e-11 1.39e-11 + 3.800000 0.777506 1.004387 1.67e-11 1.43e-11 + 3.900000 0.798144 1.704019 1.39e-11 5.96e-12 + 4.000000 0.820474 1.214374 1.05e-11 1.12e-11 + 4.100000 0.844149 1.406358 7.58e-12 2.96e-11 + 4.200000 0.868832 1.600774 5.04e-12 4.97e-12 + 4.300000 0.894204 1.038382 2.82e-12 1.00e-11 + 4.400000 0.919964 1.727533 1.81e-12 1.06e-11 + 4.500000 0.945834 1.126875 1.89e-12 5.36e-12 + 4.600000 0.971557 1.496974 3.73e-12 1.53e-11 + 4.700000 0.996898 1.525070 5.90e-12 8.98e-13 + 4.800000 1.021641 1.101030 7.16e-12 2.06e-12 + 4.900000 1.045589 1.730922 6.81e-12 8.94e-12 + 5.000000 1.068565 1.056480 9.34e-12 3.23e-12 ------------------------------------------------------ Final Solver Statistics: Steps: nsts = 5000, nstf = 510000 - u error = 1.533e-11, v error = 4.203e-12, total error = 1.124e-11 - Total RHS evals: Fse = 30001, Fsi = 57555, Ff = 2070001 + u error = 1.533e-11, v error = 9.500e-12, total error = 1.275e-11 + Total RHS evals: Fse = 30001, Fsi = 57555, Ff = 2040050 Slow Newton iters = 52554 Slow Newton conv fails = 0 Slow Jacobian evals = 250 diff --git a/examples/arkode/C_serial/ark_onewaycouple_mri.out b/examples/arkode/C_serial/ark_onewaycouple_mri.out index 99d72a08ca..3769f0e775 100644 --- a/examples/arkode/C_serial/ark_onewaycouple_mri.out +++ b/examples/arkode/C_serial/ark_onewaycouple_mri.out @@ -20,4 +20,4 @@ One way coupling ODE test problem: Final Solver Statistics: Steps: nsts = 1000, nstf = 12000 - Total RHS evals: Fs = 3001, Ff = 49002 + Total RHS evals: Fs = 3001, Ff = 36010 diff --git a/examples/arkode/C_serial/ark_reaction_diffusion_mri.out b/examples/arkode/C_serial/ark_reaction_diffusion_mri.out index 52fcbe0fad..f8cd47dfdc 100644 --- a/examples/arkode/C_serial/ark_reaction_diffusion_mri.out +++ b/examples/arkode/C_serial/ark_reaction_diffusion_mri.out @@ -68,7 +68,7 @@ Inequality constraint fails = 0 Initial step size = 2e-05 Last step size = 9.999999998289147e-06 Current step size = 2e-05 -Explicit RHS fn evals = 615207 +Explicit RHS fn evals = 459183 Implicit RHS fn evals = 0 NLS iters = 0 NLS fails = 0 diff --git a/examples/arkode/C_serial/ark_robertson.out b/examples/arkode/C_serial/ark_robertson.out index 1aea595ee5..f4774b096c 100644 --- a/examples/arkode/C_serial/ark_robertson.out +++ b/examples/arkode/C_serial/ark_robertson.out @@ -4,127 +4,127 @@ Robertson ODE test problem: t u v w -------------------------------------------------- 0.000e+00 1.00000e+00 0.00000e+00 0.00000e+00 - 1.000e+09 2.08324e-06 8.34276e-12 9.99998e-01 - 2.000e+09 1.04164e-06 4.17283e-12 9.99999e-01 - 3.000e+09 6.94437e-07 2.78375e-12 9.99999e-01 - 4.000e+09 5.20830e-07 2.05394e-12 9.99999e-01 - 5.000e+09 4.16667e-07 1.66756e-12 1.00000e+00 - 6.000e+09 3.47220e-07 1.38545e-12 1.00000e+00 - 7.000e+09 2.97617e-07 1.17655e-12 1.00000e+00 - 8.000e+09 2.60409e-07 1.02537e-12 1.00000e+00 - 9.000e+09 2.31480e-07 9.41190e-13 1.00000e+00 - 1.000e+10 2.08335e-07 8.36764e-13 1.00000e+00 - 1.100e+10 1.89395e-07 7.64332e-13 1.00000e+00 - 1.200e+10 1.73606e-07 6.70149e-13 1.00000e+00 - 1.300e+10 1.60258e-07 6.41057e-13 1.00000e+00 - 1.400e+10 1.48808e-07 6.17193e-13 1.00000e+00 - 1.500e+10 1.38890e-07 5.48220e-13 1.00000e+00 - 1.600e+10 1.30203e-07 4.86507e-13 1.00000e+00 - 1.700e+10 1.22547e-07 4.67931e-13 1.00000e+00 - 1.800e+10 1.15742e-07 4.70245e-13 1.00000e+00 - 1.900e+10 1.09647e-07 4.55585e-13 1.00000e+00 - 2.000e+10 1.04167e-07 4.24475e-13 1.00000e+00 - 2.100e+10 9.92072e-08 3.90746e-13 1.00000e+00 - 2.200e+10 9.46966e-08 3.68978e-13 1.00000e+00 - 2.300e+10 9.05806e-08 3.58503e-13 1.00000e+00 - 2.400e+10 8.68057e-08 3.53926e-13 1.00000e+00 - 2.500e+10 8.33309e-08 3.44650e-13 1.00000e+00 - 2.600e+10 8.01259e-08 3.30901e-13 1.00000e+00 - 2.700e+10 7.71607e-08 3.13931e-13 1.00000e+00 - 2.800e+10 7.44057e-08 2.95253e-13 1.00000e+00 - 2.900e+10 7.18388e-08 2.78961e-13 1.00000e+00 - 3.000e+10 6.94438e-08 2.67061e-13 1.00000e+00 - 3.100e+10 6.72046e-08 2.60762e-13 1.00000e+00 - 3.200e+10 6.51052e-08 2.61201e-13 1.00000e+00 - 3.300e+10 6.31308e-08 2.61658e-13 1.00000e+00 - 3.400e+10 6.12720e-08 2.57843e-13 1.00000e+00 - 3.500e+10 5.95204e-08 2.50778e-13 1.00000e+00 - 3.600e+10 5.78677e-08 2.41487e-13 1.00000e+00 - 3.700e+10 5.63054e-08 2.30992e-13 1.00000e+00 - 3.800e+10 5.48254e-08 2.20317e-13 1.00000e+00 - 3.900e+10 5.34196e-08 2.10724e-13 1.00000e+00 - 4.000e+10 5.20833e-08 2.03599e-13 1.00000e+00 - 4.100e+10 5.08123e-08 1.98476e-13 1.00000e+00 - 4.200e+10 4.96023e-08 1.94720e-13 1.00000e+00 - 4.300e+10 4.84493e-08 1.91698e-13 1.00000e+00 - 4.400e+10 4.73490e-08 1.88774e-13 1.00000e+00 - 4.500e+10 4.62972e-08 1.85299e-13 1.00000e+00 - 4.600e+10 4.52907e-08 1.78904e-13 1.00000e+00 - 4.700e+10 4.43271e-08 1.74761e-13 1.00000e+00 - 4.800e+10 4.34036e-08 1.75489e-13 1.00000e+00 - 4.900e+10 4.25178e-08 1.67760e-13 1.00000e+00 - 5.000e+10 4.16674e-08 1.68504e-13 1.00000e+00 - 5.100e+10 4.08503e-08 1.72673e-13 1.00000e+00 - 5.200e+10 4.00645e-08 1.71906e-13 1.00000e+00 - 5.300e+10 3.93085e-08 1.67608e-13 1.00000e+00 - 5.400e+10 3.85807e-08 1.61181e-13 1.00000e+00 - 5.500e+10 3.78794e-08 1.54027e-13 1.00000e+00 - 5.600e+10 3.72030e-08 1.47521e-13 1.00000e+00 - 5.700e+10 3.65500e-08 1.42263e-13 1.00000e+00 - 5.800e+10 3.59194e-08 1.38124e-13 1.00000e+00 - 5.900e+10 3.53102e-08 1.34960e-13 1.00000e+00 - 6.000e+10 3.47215e-08 1.32628e-13 1.00000e+00 - 6.100e+10 3.41523e-08 1.30983e-13 1.00000e+00 - 6.200e+10 3.36017e-08 1.29882e-13 1.00000e+00 - 6.300e+10 3.30688e-08 1.29180e-13 1.00000e+00 - 6.400e+10 3.25525e-08 1.28734e-13 1.00000e+00 - 6.500e+10 3.20519e-08 1.28399e-13 1.00000e+00 - 6.600e+10 3.15661e-08 1.28511e-13 1.00000e+00 - 6.700e+10 3.10945e-08 1.29667e-13 1.00000e+00 - 6.800e+10 3.06366e-08 1.31575e-13 1.00000e+00 - 6.900e+10 3.01919e-08 1.33923e-13 1.00000e+00 - 7.000e+10 2.97600e-08 1.36404e-13 1.00000e+00 - 7.100e+10 2.93405e-08 1.38706e-13 1.00000e+00 - 7.200e+10 2.89328e-08 1.40520e-13 1.00000e+00 - 7.300e+10 2.85365e-08 1.41536e-13 1.00000e+00 - 7.400e+10 2.81511e-08 1.41445e-13 1.00000e+00 - 7.500e+10 2.77762e-08 1.39937e-13 1.00000e+00 - 7.600e+10 2.74113e-08 1.36702e-13 1.00000e+00 - 7.700e+10 2.70559e-08 1.31431e-13 1.00000e+00 - 7.800e+10 2.67096e-08 1.23813e-13 1.00000e+00 - 7.900e+10 2.63719e-08 1.13538e-13 1.00000e+00 - 8.000e+10 2.60423e-08 1.00933e-13 1.00000e+00 - 8.100e+10 2.57208e-08 9.31863e-14 1.00000e+00 - 8.200e+10 2.54071e-08 9.21249e-14 1.00000e+00 - 8.300e+10 2.51010e-08 9.73996e-14 1.00000e+00 - 8.400e+10 2.48022e-08 1.03740e-13 1.00000e+00 - 8.500e+10 2.45104e-08 1.01400e-13 1.00000e+00 - 8.600e+10 2.42254e-08 9.65651e-14 1.00000e+00 - 8.700e+10 2.39469e-08 9.61320e-14 1.00000e+00 - 8.800e+10 2.36747e-08 9.68559e-14 1.00000e+00 - 8.900e+10 2.34087e-08 9.44562e-14 1.00000e+00 - 9.000e+10 2.31485e-08 9.00151e-14 1.00000e+00 - 9.100e+10 2.28941e-08 8.46151e-14 1.00000e+00 - 9.200e+10 2.26453e-08 7.93387e-14 1.00000e+00 - 9.300e+10 2.24018e-08 7.52684e-14 1.00000e+00 - 9.400e+10 2.21635e-08 7.34866e-14 1.00000e+00 - 9.500e+10 2.19303e-08 7.50757e-14 1.00000e+00 - 9.600e+10 2.17019e-08 8.11182e-14 1.00000e+00 - 9.700e+10 2.14781e-08 9.01508e-14 1.00000e+00 - 9.800e+10 2.12589e-08 9.22475e-14 1.00000e+00 - 9.900e+10 2.10442e-08 8.92813e-14 1.00000e+00 - 1.000e+11 2.08338e-08 8.47365e-14 1.00000e+00 + 1.000e+09 2.08319e-06 8.28673e-12 9.99998e-01 + 2.000e+09 1.04165e-06 4.16315e-12 9.99999e-01 + 3.000e+09 6.94436e-07 2.79812e-12 9.99999e-01 + 4.000e+09 5.20822e-07 2.09671e-12 9.99999e-01 + 5.000e+09 4.16653e-07 1.65358e-12 1.00000e+00 + 6.000e+09 3.47215e-07 1.38790e-12 1.00000e+00 + 7.000e+09 2.97617e-07 1.19569e-12 1.00000e+00 + 8.000e+09 2.60418e-07 1.03823e-12 1.00000e+00 + 9.000e+09 2.31478e-07 9.17074e-13 1.00000e+00 + 1.000e+10 2.08331e-07 8.40189e-13 1.00000e+00 + 1.100e+10 1.89393e-07 7.61696e-13 1.00000e+00 + 1.200e+10 1.73605e-07 6.83245e-13 1.00000e+00 + 1.300e+10 1.60257e-07 6.52283e-13 1.00000e+00 + 1.400e+10 1.48808e-07 6.03096e-13 1.00000e+00 + 1.500e+10 1.38890e-07 5.53757e-13 1.00000e+00 + 1.600e+10 1.30208e-07 5.02107e-13 1.00000e+00 + 1.700e+10 1.22550e-07 5.05848e-13 1.00000e+00 + 1.800e+10 1.15741e-07 4.81445e-13 1.00000e+00 + 1.900e+10 1.09650e-07 4.30685e-13 1.00000e+00 + 2.000e+10 1.04164e-07 4.00365e-13 1.00000e+00 + 2.100e+10 9.92051e-08 3.87356e-13 1.00000e+00 + 2.200e+10 9.46982e-08 3.79643e-13 1.00000e+00 + 2.300e+10 9.05793e-08 3.59181e-13 1.00000e+00 + 2.400e+10 8.68052e-08 3.35291e-13 1.00000e+00 + 2.500e+10 8.33344e-08 3.30550e-13 1.00000e+00 + 2.600e+10 8.01274e-08 3.33613e-13 1.00000e+00 + 2.700e+10 7.71569e-08 3.13668e-13 1.00000e+00 + 2.800e+10 7.44011e-08 2.86383e-13 1.00000e+00 + 2.900e+10 7.18380e-08 2.67839e-13 1.00000e+00 + 3.000e+10 6.94456e-08 2.74115e-13 1.00000e+00 + 3.100e+10 6.72046e-08 2.89954e-13 1.00000e+00 + 3.200e+10 6.51032e-08 2.82625e-13 1.00000e+00 + 3.300e+10 6.31303e-08 2.63498e-13 1.00000e+00 + 3.400e+10 6.12746e-08 2.44356e-13 1.00000e+00 + 3.500e+10 5.95249e-08 2.36979e-13 1.00000e+00 + 3.600e+10 5.78710e-08 2.38699e-13 1.00000e+00 + 3.700e+10 5.63063e-08 2.34238e-13 1.00000e+00 + 3.800e+10 5.48245e-08 2.25989e-13 1.00000e+00 + 3.900e+10 5.34192e-08 2.16535e-13 1.00000e+00 + 4.000e+10 5.20842e-08 2.08459e-13 1.00000e+00 + 4.100e+10 5.08134e-08 2.01687e-13 1.00000e+00 + 4.200e+10 4.96024e-08 1.93815e-13 1.00000e+00 + 4.300e+10 4.84479e-08 1.85739e-13 1.00000e+00 + 4.400e+10 4.73465e-08 1.78395e-13 1.00000e+00 + 4.500e+10 4.62947e-08 1.72720e-13 1.00000e+00 + 4.600e+10 4.52893e-08 1.69648e-13 1.00000e+00 + 4.700e+10 4.43267e-08 1.70114e-13 1.00000e+00 + 4.800e+10 4.34036e-08 1.74964e-13 1.00000e+00 + 4.900e+10 4.25175e-08 1.78828e-13 1.00000e+00 + 5.000e+10 4.16666e-08 1.78796e-13 1.00000e+00 + 5.100e+10 4.08492e-08 1.75793e-13 1.00000e+00 + 5.200e+10 4.00636e-08 1.70743e-13 1.00000e+00 + 5.300e+10 3.93079e-08 1.64571e-13 1.00000e+00 + 5.400e+10 3.85805e-08 1.58202e-13 1.00000e+00 + 5.500e+10 3.78794e-08 1.52559e-13 1.00000e+00 + 5.600e+10 3.72031e-08 1.48433e-13 1.00000e+00 + 5.700e+10 3.65504e-08 1.45182e-13 1.00000e+00 + 5.800e+10 3.59202e-08 1.42852e-13 1.00000e+00 + 5.900e+10 3.53114e-08 1.42011e-13 1.00000e+00 + 6.000e+10 3.47228e-08 1.43770e-13 1.00000e+00 + 6.100e+10 3.41536e-08 1.42505e-13 1.00000e+00 + 6.200e+10 3.36028e-08 1.31615e-13 1.00000e+00 + 6.300e+10 3.30693e-08 1.21361e-13 1.00000e+00 + 6.400e+10 3.25524e-08 1.16679e-13 1.00000e+00 + 6.500e+10 3.20514e-08 1.16007e-13 1.00000e+00 + 6.600e+10 3.15658e-08 1.17783e-13 1.00000e+00 + 6.700e+10 3.10947e-08 1.20445e-13 1.00000e+00 + 6.800e+10 3.06376e-08 1.22430e-13 1.00000e+00 + 6.900e+10 3.01937e-08 1.22179e-13 1.00000e+00 + 7.000e+10 2.97624e-08 1.18554e-13 1.00000e+00 + 7.100e+10 2.93432e-08 1.19564e-13 1.00000e+00 + 7.200e+10 2.89357e-08 1.20819e-13 1.00000e+00 + 7.300e+10 2.85393e-08 1.12238e-13 1.00000e+00 + 7.400e+10 2.81536e-08 1.08409e-13 1.00000e+00 + 7.500e+10 2.77782e-08 1.11242e-13 1.00000e+00 + 7.600e+10 2.74127e-08 1.08952e-13 1.00000e+00 + 7.700e+10 2.70567e-08 1.02106e-13 1.00000e+00 + 7.800e+10 2.67098e-08 1.03189e-13 1.00000e+00 + 7.900e+10 2.63717e-08 1.10597e-13 1.00000e+00 + 8.000e+10 2.60421e-08 1.05448e-13 1.00000e+00 + 8.100e+10 2.57206e-08 1.03702e-13 1.00000e+00 + 8.200e+10 2.54069e-08 1.04168e-13 1.00000e+00 + 8.300e+10 2.51008e-08 1.00603e-13 1.00000e+00 + 8.400e+10 2.48020e-08 9.77251e-14 1.00000e+00 + 8.500e+10 2.45102e-08 9.82338e-14 1.00000e+00 + 8.600e+10 2.42252e-08 9.64282e-14 1.00000e+00 + 8.700e+10 2.39467e-08 9.59624e-14 1.00000e+00 + 8.800e+10 2.36746e-08 9.45243e-14 1.00000e+00 + 8.900e+10 2.34086e-08 9.10474e-14 1.00000e+00 + 9.000e+10 2.31485e-08 9.02954e-14 1.00000e+00 + 9.100e+10 2.28941e-08 9.57143e-14 1.00000e+00 + 9.200e+10 2.26452e-08 1.00341e-13 1.00000e+00 + 9.300e+10 2.24017e-08 1.03006e-13 1.00000e+00 + 9.400e+10 2.21634e-08 1.03573e-13 1.00000e+00 + 9.500e+10 2.19301e-08 1.01905e-13 1.00000e+00 + 9.600e+10 2.17016e-08 9.78643e-14 1.00000e+00 + 9.700e+10 2.14779e-08 9.13138e-14 1.00000e+00 + 9.800e+10 2.12588e-08 8.23720e-14 1.00000e+00 + 9.900e+10 2.10440e-08 7.45584e-14 1.00000e+00 + 1.000e+11 2.08334e-08 6.88517e-14 1.00000e+00 -------------------------------------------------- Final Statistics: -Current time = 100509725868.0247 -Steps = 990 -Step attempts = 1170 +Current time = 115949571244.6344 +Steps = 740 +Step attempts = 784 Stability limited steps = 0 -Accuracy limited steps = 1167 -Error test fails = 177 -NLS step fails = 3 +Accuracy limited steps = 779 +Error test fails = 39 +NLS step fails = 5 Inequality constraint fails = 0 Initial step size = 1e-08 -Last step size = 4072648616.470474 -Current step size = 4072648616.470474 +Last step size = 18264803707.2694 +Current step size = 18264803707.2694 Explicit RHS fn evals = 0 -Implicit RHS fn evals = 33161 -NLS iters = 27313 +Implicit RHS fn evals = 25084 +NLS iters = 21171 NLS fails = 46 -NLS iters per step = 27.58888888888889 -LS setups = 517 -Jac fn evals = 56 +NLS iters per step = 28.60945945945946 +LS setups = 208 +Jac fn evals = 52 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -133,5 +133,5 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.002050305715227181 +Jac evals per NLS iter = 0.002456190071323981 Prec evals per NLS iter = 0 diff --git a/examples/arkode/C_serial/ark_robertson_constraints.out b/examples/arkode/C_serial/ark_robertson_constraints.out index e28ffe18c9..a5abcd3dfd 100644 --- a/examples/arkode/C_serial/ark_robertson_constraints.out +++ b/examples/arkode/C_serial/ark_robertson_constraints.out @@ -4,116 +4,116 @@ Robertson ODE test problem: t u v w -------------------------------------------------- 0.000e+00 1.00000e+00 0.00000e+00 0.00000e+00 - 1.000e+09 2.07857e-06 -1.09385e-10 9.99998e-01 - 2.000e+09 1.04202e-06 4.21741e-12 9.99999e-01 - 3.000e+09 6.94597e-07 2.66732e-12 9.99999e-01 - 4.000e+09 5.20918e-07 2.08504e-12 9.99999e-01 - 5.000e+09 4.16721e-07 1.50113e-12 1.00000e+00 - 6.000e+09 3.47261e-07 3.09313e-12 1.00000e+00 - 7.000e+09 2.97649e-07 1.12013e-12 1.00000e+00 - 8.000e+09 2.60438e-07 1.30410e-12 1.00000e+00 - 9.000e+09 2.31501e-07 6.01213e-15 1.00000e+00 - 1.000e+10 2.08348e-07 8.07940e-13 1.00000e+00 - 1.100e+10 1.89407e-07 5.27220e-13 1.00000e+00 - 1.200e+10 1.73622e-07 5.67013e-13 1.00000e+00 - 1.300e+10 1.60265e-07 6.62046e-13 1.00000e+00 - 1.400e+10 1.48820e-07 -1.96317e-12 1.00000e+00 - 1.500e+10 1.38895e-07 1.17103e-12 1.00000e+00 - 1.600e+10 1.30214e-07 3.98260e-13 1.00000e+00 - 1.700e+10 1.22554e-07 6.36369e-13 1.00000e+00 - 1.800e+10 1.15747e-07 -6.66047e-13 1.00000e+00 - 1.900e+10 1.09653e-07 4.39347e-13 1.00000e+00 - 2.000e+10 1.04171e-07 3.61443e-13 1.00000e+00 - 2.100e+10 9.92098e-08 5.00251e-13 1.00000e+00 - 2.200e+10 9.47001e-08 4.91884e-13 1.00000e+00 - 2.300e+10 9.05822e-08 8.71476e-13 1.00000e+00 - 2.400e+10 8.68083e-08 3.63347e-13 1.00000e+00 - 2.500e+10 8.33363e-08 -4.58969e-15 1.00000e+00 - 2.600e+10 8.01306e-08 3.78826e-13 1.00000e+00 - 2.700e+10 7.71624e-08 6.09154e-13 1.00000e+00 - 2.800e+10 7.44070e-08 2.04226e-13 1.00000e+00 - 2.900e+10 7.18410e-08 3.71843e-13 1.00000e+00 - 3.000e+10 6.94465e-08 4.86116e-14 1.00000e+00 - 3.100e+10 6.72060e-08 2.63403e-13 1.00000e+00 - 3.200e+10 6.51057e-08 3.32928e-13 1.00000e+00 - 3.300e+10 6.31329e-08 2.79447e-13 1.00000e+00 - 3.400e+10 6.12760e-08 2.69539e-13 1.00000e+00 - 3.500e+10 5.95252e-08 2.37903e-13 1.00000e+00 - 3.600e+10 5.78717e-08 2.27549e-13 1.00000e+00 - 3.700e+10 5.63075e-08 2.16412e-13 1.00000e+00 - 3.800e+10 5.48258e-08 2.20845e-13 1.00000e+00 - 3.900e+10 5.34200e-08 1.80732e-13 1.00000e+00 - 4.000e+10 5.20844e-08 2.07741e-13 1.00000e+00 - 4.100e+10 5.08141e-08 2.02952e-13 1.00000e+00 - 4.200e+10 4.96042e-08 1.74303e-13 1.00000e+00 - 4.300e+10 4.84505e-08 2.18218e-13 1.00000e+00 - 4.400e+10 4.73494e-08 1.66929e-13 1.00000e+00 - 4.500e+10 4.62972e-08 1.38049e-13 1.00000e+00 - 4.600e+10 4.52908e-08 1.08118e-13 1.00000e+00 - 4.700e+10 4.43271e-08 1.76051e-13 1.00000e+00 - 4.800e+10 4.34036e-08 1.70607e-13 1.00000e+00 - 4.900e+10 4.25178e-08 1.81842e-13 1.00000e+00 - 5.000e+10 4.16676e-08 -1.13757e-14 1.00000e+00 - 5.100e+10 4.08507e-08 -2.05065e-13 1.00000e+00 - 5.200e+10 4.00651e-08 -1.78624e-13 1.00000e+00 - 5.300e+10 3.93089e-08 1.41307e-13 1.00000e+00 - 5.400e+10 3.85809e-08 1.37592e-13 1.00000e+00 - 5.500e+10 3.78794e-08 1.22696e-13 1.00000e+00 - 5.600e+10 3.72032e-08 -1.10452e-13 1.00000e+00 - 5.700e+10 3.65501e-08 3.36533e-13 1.00000e+00 - 5.800e+10 3.59205e-08 -2.61161e-13 1.00000e+00 - 5.900e+10 3.53190e-08 -7.59722e-12 1.00000e+00 - 6.000e+10 3.47227e-08 1.85374e-13 1.00000e+00 - 6.100e+10 3.41536e-08 9.39629e-14 1.00000e+00 - 6.200e+10 3.36021e-08 7.25389e-13 1.00000e+00 - 6.300e+10 3.30696e-08 -1.63630e-13 1.00000e+00 - 6.400e+10 3.25554e-08 -2.65856e-12 1.00000e+00 - 6.500e+10 3.20517e-08 1.30711e-13 1.00000e+00 - 6.600e+10 3.15661e-08 1.26194e-13 1.00000e+00 - 6.700e+10 3.10950e-08 1.40543e-13 1.00000e+00 - 6.800e+10 3.06377e-08 1.09899e-13 1.00000e+00 - 6.900e+10 3.01937e-08 1.22297e-13 1.00000e+00 - 7.000e+10 2.97623e-08 1.43754e-13 1.00000e+00 - 7.100e+10 2.93432e-08 9.00254e-14 1.00000e+00 - 7.200e+10 2.89356e-08 1.09983e-13 1.00000e+00 - 7.300e+10 2.85392e-08 1.07976e-13 1.00000e+00 - 7.400e+10 2.81535e-08 1.10593e-13 1.00000e+00 - 7.500e+10 2.77782e-08 1.05388e-13 1.00000e+00 - 7.600e+10 2.74134e-08 -6.45069e-13 1.00000e+00 - 7.700e+10 2.70583e-08 -1.58650e-12 1.00000e+00 - 7.800e+10 2.67111e-08 -1.22796e-12 1.00000e+00 - 7.900e+10 2.63717e-08 8.74686e-14 1.00000e+00 - 8.000e+10 2.60420e-08 9.65943e-14 1.00000e+00 - 8.100e+10 2.57204e-08 1.41528e-13 1.00000e+00 - 8.200e+10 2.54068e-08 1.61138e-13 1.00000e+00 - 8.300e+10 2.51008e-08 -4.32908e-15 1.00000e+00 - 8.400e+10 2.48019e-08 6.26448e-14 1.00000e+00 - 8.500e+10 2.45101e-08 1.00567e-13 1.00000e+00 - 8.600e+10 2.42251e-08 9.76438e-14 1.00000e+00 - 8.700e+10 2.39466e-08 1.01689e-13 1.00000e+00 - 8.800e+10 2.36745e-08 1.26632e-13 1.00000e+00 - 8.900e+10 2.34085e-08 1.35620e-13 1.00000e+00 - 9.000e+10 2.31484e-08 8.73805e-14 1.00000e+00 - 9.100e+10 2.28938e-08 3.36553e-13 1.00000e+00 - 9.200e+10 2.26446e-08 7.21253e-13 1.00000e+00 - 9.300e+10 2.24013e-08 5.28310e-13 1.00000e+00 - 9.400e+10 2.21668e-08 -3.34767e-12 1.00000e+00 - 9.500e+10 2.19300e-08 1.72230e-13 1.00000e+00 - 9.600e+10 2.17016e-08 7.81589e-14 1.00000e+00 - 9.700e+10 2.14779e-08 1.07435e-13 1.00000e+00 - 9.800e+10 2.12602e-08 -1.41747e-12 1.00000e+00 - 9.900e+10 2.10435e-08 6.16285e-13 1.00000e+00 - 1.000e+11 2.08336e-08 8.08491e-14 1.00000e+00 + 1.000e+09 2.08372e-06 1.28623e-11 9.99998e-01 + 2.000e+09 1.04177e-06 4.17962e-12 9.99999e-01 + 3.000e+09 6.94491e-07 1.08662e-12 9.99999e-01 + 4.000e+09 5.20859e-07 2.11202e-12 9.99999e-01 + 5.000e+09 4.16681e-07 2.67597e-12 1.00000e+00 + 6.000e+09 3.47234e-07 1.32035e-12 1.00000e+00 + 7.000e+09 2.97625e-07 9.17289e-13 1.00000e+00 + 8.000e+09 2.60423e-07 1.34317e-12 1.00000e+00 + 9.000e+09 2.31483e-07 1.77831e-13 1.00000e+00 + 1.000e+10 2.08336e-07 8.66411e-14 1.00000e+00 + 1.100e+10 1.89400e-07 -1.20076e-12 1.00000e+00 + 1.200e+10 1.73615e-07 6.95917e-13 1.00000e+00 + 1.300e+10 1.60260e-07 6.35488e-13 1.00000e+00 + 1.400e+10 1.48812e-07 6.62922e-13 1.00000e+00 + 1.500e+10 1.38889e-07 9.89014e-13 1.00000e+00 + 1.600e+10 1.30210e-07 4.44922e-13 1.00000e+00 + 1.700e+10 1.22549e-07 1.72526e-12 1.00000e+00 + 1.800e+10 1.15739e-07 3.90984e-12 1.00000e+00 + 1.900e+10 1.09651e-07 4.44476e-13 1.00000e+00 + 2.000e+10 1.04167e-07 1.31808e-12 1.00000e+00 + 2.100e+10 9.92075e-08 7.65928e-13 1.00000e+00 + 2.200e+10 9.46989e-08 -1.16031e-13 1.00000e+00 + 2.300e+10 9.05834e-08 -2.00950e-12 1.00000e+00 + 2.400e+10 8.68068e-08 3.52748e-13 1.00000e+00 + 2.500e+10 8.33341e-08 4.86598e-13 1.00000e+00 + 2.600e+10 8.01289e-08 5.62896e-13 1.00000e+00 + 2.700e+10 7.71612e-08 6.08319e-13 1.00000e+00 + 2.800e+10 7.44056e-08 4.14818e-13 1.00000e+00 + 2.900e+10 7.18402e-08 6.98424e-14 1.00000e+00 + 3.000e+10 6.94449e-08 6.23385e-13 1.00000e+00 + 3.100e+10 6.72051e-08 2.68162e-13 1.00000e+00 + 3.200e+10 6.51049e-08 2.53517e-13 1.00000e+00 + 3.300e+10 6.31320e-08 2.53703e-13 1.00000e+00 + 3.400e+10 6.12751e-08 2.53682e-13 1.00000e+00 + 3.500e+10 5.95243e-08 2.90151e-13 1.00000e+00 + 3.600e+10 5.78709e-08 2.74982e-13 1.00000e+00 + 3.700e+10 5.63068e-08 2.31075e-13 1.00000e+00 + 3.800e+10 5.48248e-08 4.05480e-13 1.00000e+00 + 3.900e+10 5.34193e-08 2.94098e-13 1.00000e+00 + 4.000e+10 5.20839e-08 1.94391e-13 1.00000e+00 + 4.100e+10 5.08135e-08 2.15900e-13 1.00000e+00 + 4.200e+10 4.96037e-08 1.41126e-13 1.00000e+00 + 4.300e+10 4.84501e-08 1.79785e-13 1.00000e+00 + 4.400e+10 4.73464e-08 2.69369e-12 1.00000e+00 + 4.500e+10 4.62850e-08 1.18598e-11 1.00000e+00 + 4.600e+10 4.52825e-08 7.90431e-12 1.00000e+00 + 4.700e+10 4.43266e-08 1.76122e-13 1.00000e+00 + 4.800e+10 4.34029e-08 2.26422e-13 1.00000e+00 + 4.900e+10 4.25172e-08 1.84214e-13 1.00000e+00 + 5.000e+10 4.16669e-08 1.23287e-13 1.00000e+00 + 5.100e+10 4.08543e-08 -4.28961e-12 1.00000e+00 + 5.200e+10 4.00729e-08 -8.50417e-12 1.00000e+00 + 5.300e+10 3.93110e-08 -2.57802e-12 1.00000e+00 + 5.400e+10 3.85804e-08 1.47943e-13 1.00000e+00 + 5.500e+10 3.78772e-08 1.86930e-12 1.00000e+00 + 5.600e+10 3.72025e-08 1.31732e-13 1.00000e+00 + 5.700e+10 3.65494e-08 5.66584e-13 1.00000e+00 + 5.800e+10 3.59196e-08 1.78679e-13 1.00000e+00 + 5.900e+10 3.53112e-08 -1.92694e-13 1.00000e+00 + 6.000e+10 3.47222e-08 2.42813e-13 1.00000e+00 + 6.100e+10 3.41531e-08 1.50415e-13 1.00000e+00 + 6.200e+10 3.36022e-08 1.34708e-13 1.00000e+00 + 6.300e+10 3.30690e-08 -7.92804e-16 1.00000e+00 + 6.400e+10 3.25522e-08 1.27438e-13 1.00000e+00 + 6.500e+10 3.20515e-08 3.49793e-14 1.00000e+00 + 6.600e+10 3.15669e-08 -1.02211e-12 1.00000e+00 + 6.700e+10 3.10946e-08 1.41439e-13 1.00000e+00 + 6.800e+10 3.06374e-08 7.27249e-14 1.00000e+00 + 6.900e+10 3.01894e-08 4.00333e-12 1.00000e+00 + 7.000e+10 2.97602e-08 1.87205e-12 1.00000e+00 + 7.100e+10 2.93428e-08 1.30225e-13 1.00000e+00 + 7.200e+10 2.89354e-08 1.31656e-14 1.00000e+00 + 7.300e+10 2.85437e-08 -4.70269e-12 1.00000e+00 + 7.400e+10 2.81625e-08 -9.20849e-12 1.00000e+00 + 7.500e+10 2.77780e-08 -5.78693e-14 1.00000e+00 + 7.600e+10 2.74119e-08 5.68095e-13 1.00000e+00 + 7.700e+10 2.70563e-08 1.53510e-13 1.00000e+00 + 7.800e+10 2.67092e-08 3.61374e-13 1.00000e+00 + 7.900e+10 2.63714e-08 9.53870e-14 1.00000e+00 + 8.000e+10 2.60417e-08 1.04868e-13 1.00000e+00 + 8.100e+10 2.57202e-08 9.19696e-14 1.00000e+00 + 8.200e+10 2.54065e-08 1.04617e-13 1.00000e+00 + 8.300e+10 2.51004e-08 1.17459e-13 1.00000e+00 + 8.400e+10 2.48017e-08 4.24962e-14 1.00000e+00 + 8.500e+10 2.45107e-08 -7.68506e-13 1.00000e+00 + 8.600e+10 2.42268e-08 -1.88041e-12 1.00000e+00 + 8.700e+10 2.39489e-08 -2.44492e-12 1.00000e+00 + 8.800e+10 2.36760e-08 -1.61373e-12 1.00000e+00 + 8.900e+10 2.34086e-08 -2.03789e-13 1.00000e+00 + 9.000e+10 2.31474e-08 8.50587e-13 1.00000e+00 + 9.100e+10 2.28938e-08 1.36755e-13 1.00000e+00 + 9.200e+10 2.26451e-08 -2.32772e-14 1.00000e+00 + 9.300e+10 2.24015e-08 8.00906e-14 1.00000e+00 + 9.400e+10 2.21631e-08 8.59755e-14 1.00000e+00 + 9.500e+10 2.19305e-08 -5.14361e-13 1.00000e+00 + 9.600e+10 2.17023e-08 -7.48165e-13 1.00000e+00 + 9.700e+10 2.14796e-08 -1.80243e-12 1.00000e+00 + 9.800e+10 2.12586e-08 5.56097e-14 1.00000e+00 + 9.900e+10 2.10438e-08 1.05420e-13 1.00000e+00 + 1.000e+11 2.08333e-08 9.66856e-14 1.00000e+00 -------------------------------------------------- Final Solver Statistics: - Internal solver steps = 372 (attempted = 563) - Total RHS evals: Fe = 0, Fi = 14565 - Total linear solver setups = 581 + Internal solver steps = 353 (attempted = 519) + Total RHS evals: Fe = 0, Fi = 13780 + Total linear solver setups = 545 Total RHS evals for setting up the linear system = 0 - Total number of Jacobian evaluations = 391 - Total number of Newton iterations = 12497 - Total number of nonlinear solver convergence failures = 376 - Total number of error test failures = 1 - Total number of constraint test failures = 14 - Total number of failed steps from solver failure = 176 + Total number of Jacobian evaluations = 366 + Total number of Newton iterations = 11842 + Total number of nonlinear solver convergence failures = 363 + Total number of error test failures = 0 + Total number of constraint test failures = 2 + Total number of failed steps from solver failure = 164 diff --git a/examples/arkode/C_serial/ark_robertson_root.out b/examples/arkode/C_serial/ark_robertson_root.out index 236a53d64b..f67f8d34a9 100644 --- a/examples/arkode/C_serial/ark_robertson_root.out +++ b/examples/arkode/C_serial/ark_robertson_root.out @@ -7,27 +7,27 @@ Robertson ODE test problem (with rootfinding): 2.64019e-01 9.89965e-01 3.47058e-05 1.00000e-02 rootsfound[] = 0 1 4.00000e+00 9.05519e-01 2.24048e-05 9.44589e-02 - 4.00000e+01 7.15827e-01 9.18557e-06 2.84164e-01 - 4.00000e+02 4.50519e-01 3.22289e-06 5.49478e-01 - 4.00000e+03 1.83202e-01 8.94239e-07 8.16797e-01 - 4.00000e+04 3.89834e-02 1.62177e-07 9.61016e-01 - 4.00000e+05 4.93828e-03 1.98499e-08 9.95062e-01 - 4.00000e+06 5.16810e-04 2.06836e-09 9.99483e-01 - 2.07955e+07 1.00000e-04 4.00913e-10 9.99900e-01 + 4.00000e+01 7.15827e-01 9.18550e-06 2.84164e-01 + 4.00000e+02 4.50519e-01 3.22290e-06 5.49478e-01 + 4.00000e+03 1.83202e-01 8.94213e-07 8.16797e-01 + 4.00000e+04 3.89834e-02 1.62170e-07 9.61016e-01 + 4.00000e+05 4.93828e-03 1.98505e-08 9.95062e-01 + 4.00000e+06 5.16811e-04 2.06833e-09 9.99483e-01 + 2.07956e+07 1.00000e-04 4.00054e-10 9.99900e-01 rootsfound[] = -1 0 - 4.00000e+08 5.20777e-06 2.07144e-11 9.99995e-01 - 4.00000e+09 5.20870e-07 2.07803e-12 9.99999e-01 - 4.00000e+10 5.20800e-08 4.22489e-13 1.00000e+00 + 4.00000e+08 5.20672e-06 2.05159e-11 9.99995e-01 + 4.00000e+09 5.20802e-07 1.54856e-12 9.99999e-01 + 4.00000e+10 5.20846e-08 2.09189e-13 1.00000e+00 ----------------------------------------------------- Final Solver Statistics: - Internal solver steps = 1070 (attempted = 1298) - Total RHS evals: Fe = 0, Fi = 36412 - Total linear solver setups = 590 + Internal solver steps = 748 (attempted = 813) + Total RHS evals: Fe = 0, Fi = 25698 + Total linear solver setups = 263 Total RHS evals for setting up the linear system = 0 - Total number of Jacobian evaluations = 66 - Total number of Newton iterations = 29962 - Total root-function g evals = 1104 - Total number of nonlinear solver convergence failures = 55 - Total number of error test failures = 213 - Total number of failed steps from solver failure = 15 + Total number of Jacobian evaluations = 65 + Total number of Newton iterations = 21684 + Total root-function g evals = 776 + Total number of nonlinear solver convergence failures = 59 + Total number of error test failures = 47 + Total number of failed steps from solver failure = 18 diff --git a/examples/arkode/C_serial/ark_twowaycouple_mri.out b/examples/arkode/C_serial/ark_twowaycouple_mri.out index ef4f3fa787..8aee3f02b7 100644 --- a/examples/arkode/C_serial/ark_twowaycouple_mri.out +++ b/examples/arkode/C_serial/ark_twowaycouple_mri.out @@ -30,4 +30,4 @@ Two way coupling ODE test problem: Final Solver Statistics: Steps: nsts = 2001, nstf = 102051 - Total RHS evals: Fs = 6004, Ff = 410207 + Total RHS evals: Fs = 6004, Ff = 306173 diff --git a/examples/arkode/F2003_custom/ark_analytic_complex_f2003.out b/examples/arkode/F2003_custom/ark_analytic_complex_f2003.out index 32bd53e57b..a783d31eef 100644 --- a/examples/arkode/F2003_custom/ark_analytic_complex_f2003.out +++ b/examples/arkode/F2003_custom/ark_analytic_complex_f2003.out @@ -20,7 +20,7 @@ Final Solver Statistics: Internal solver steps = 664, (attempted = 664) - Total RHS evals = 3987 + Total RHS evals = 3323 Total number of error test failures = 0 Error: max = 7.87E-04, rms = 4.99E-04 diff --git a/examples/arkode/F2003_custom/ark_brusselator1D_f2003.out b/examples/arkode/F2003_custom/ark_brusselator1D_f2003.out index 11c3e92817..a0a5d2c6e9 100644 --- a/examples/arkode/F2003_custom/ark_brusselator1D_f2003.out +++ b/examples/arkode/F2003_custom/ark_brusselator1D_f2003.out @@ -6,7 +6,7 @@ reltol = 1.0E-06, abstol = 1.0E-10 t ||u||_rms ||v||_rms ||w||_rms ---------------------------------------------- - 0.100000 0.675713 3.378369 1.999987 + 0.100000 0.675713 3.378369 1.999986 0.200000 0.688538 3.357681 1.999986 0.300000 0.702687 3.334519 1.999986 0.400000 0.718330 3.308631 1.999986 @@ -110,7 +110,7 @@ Final Solver Statistics: Internal solver steps = 407, (attempted = 504) - Total RHS evals: Fe = 3027, Fi = 8587 + Total RHS evals: Fe = 2930, Fi = 8490 Total linear solver setups = 269 Total RHS evals for setting up the linear system = 0 Total number of Jacobian evaluations = 30 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' diff --git a/examples/arkode/F2003_serial/ark_analytic_f2003.out b/examples/arkode/F2003_serial/ark_analytic_f2003.out index fa22d69806..6bd9ca6971 100644 --- a/examples/arkode/F2003_serial/ark_analytic_f2003.out +++ b/examples/arkode/F2003_serial/ark_analytic_f2003.out @@ -16,15 +16,15 @@ 1.00000E+01 1.47113E+00 General Solver Stats: - Total internal steps taken = 412 - Total internal steps attempts = 416 - Total rhs function calls = 4944 - Num lin solver setup calls = 38 - Num error test failures = 4 + Total internal steps taken = 413 + Total internal steps attempts = 419 + Total rhs function calls = 4983 + Num lin solver setup calls = 43 + Num error test failures = 6 First internal step size = 6.10352E-12 - Last internal step size = 7.85712E-02 - Next internal step size = 7.85712E-02 - Current internal time = 1.00544E+01 - Num nonlinear solver iters = 2861 - Num nonlinear solver fails = 3 + Last internal step size = 5.69650E-02 + Next internal step size = 5.69650E-02 + Current internal time = 1.00344E+01 + Num nonlinear solver iters = 2885 + Num nonlinear solver fails = 4 diff --git a/examples/arkode/F2003_serial/ark_kpr_mri_f2003.out b/examples/arkode/F2003_serial/ark_kpr_mri_f2003.out index af17291b06..9bdbea5dcb 100644 --- a/examples/arkode/F2003_serial/ark_kpr_mri_f2003.out +++ b/examples/arkode/F2003_serial/ark_kpr_mri_f2003.out @@ -1,66 +1,66 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: time domain: (0.00, 5.00] - hs = 0.0100 - hf = 0.0001 - G = -100.0000 - w = 100.0000 - e = 0.5000 + hs = 0.1000E-01 + hf = 0.1000E-03 + G = -0.1000E+03 + w = 0.1000E+03 + e = 0.5000E+00 solver: exp-3/exp-3 (standard MIS) t u v uerr verr ------------------------------------------------------ - 0.000000 1.224745 1.732051 0.00E+00 0.00E+00 - 0.100000 1.223726 1.077464 0.85E-06 0.88E-08 - 0.200000 1.220670 1.551800 0.84E-06 0.20E-07 - 0.300000 1.215595 1.467737 0.83E-06 0.31E-07 - 0.400000 1.208525 1.154583 0.82E-06 0.40E-07 - 0.500000 1.199497 1.721908 0.80E-06 0.48E-07 - 0.600000 1.188558 1.023517 0.78E-06 0.56E-07 - 0.700000 1.175765 1.622751 0.75E-06 0.62E-07 - 0.800000 1.161187 1.374632 0.72E-06 0.67E-07 - 0.900000 1.144905 1.245763 0.68E-06 0.71E-07 - 1.000000 1.127010 1.691839 0.64E-06 0.74E-07 - 1.100000 1.107610 1.000490 0.59E-06 0.76E-07 - 1.200000 1.086821 1.677552 0.53E-06 0.77E-07 - 1.300000 1.064777 1.277775 0.47E-06 0.78E-07 - 1.400000 1.041626 1.342455 0.41E-06 0.77E-07 - 1.500000 1.017531 1.642940 0.33E-06 0.75E-07 - 1.600000 0.992674 1.012112 0.25E-06 0.73E-07 - 1.700000 0.967253 1.714058 0.16E-06 0.69E-07 - 1.800000 0.941488 1.183867 0.63E-07 0.65E-07 - 1.900000 0.915617 1.437465 0.43E-07 0.59E-07 - 2.000000 0.889902 1.577082 0.16E-06 0.52E-07 - 2.100000 0.864625 1.056467 0.28E-06 0.45E-07 - 2.200000 0.840089 1.730920 0.42E-06 0.36E-07 - 2.300000 0.816616 1.101047 0.56E-06 0.26E-07 - 2.400000 0.794545 1.525051 0.70E-06 0.14E-07 - 2.500000 0.774227 1.496993 0.85E-06 0.21E-08 - 2.600000 0.756012 1.126857 0.99E-06 0.11E-07 - 2.700000 0.740245 1.727536 0.11E-05 0.25E-07 - 2.800000 0.727246 1.038393 0.13E-05 0.40E-07 - 2.900000 0.717300 1.600759 0.14E-05 0.55E-07 - 3.000000 0.710635 1.406379 0.14E-05 0.70E-07 - 3.100000 0.707411 1.214353 0.15E-05 0.85E-07 - 3.200000 0.707708 1.704026 0.15E-05 0.99E-07 - 3.300000 0.711518 1.004391 0.14E-05 0.11E-06 - 3.400000 0.718748 1.661225 0.14E-05 0.12E-06 - 3.500000 0.729225 1.310102 0.13E-05 0.13E-06 - 3.600000 0.742711 1.310080 0.12E-05 0.14E-06 - 3.700000 0.758913 1.661237 0.10E-05 0.14E-06 - 3.800000 0.777505 1.004387 0.88E-06 0.14E-06 - 3.900000 0.798143 1.704018 0.73E-06 0.14E-06 - 4.000000 0.820474 1.214374 0.59E-06 0.14E-06 - 4.100000 0.844149 1.406358 0.45E-06 0.13E-06 - 4.200000 0.868832 1.600774 0.31E-06 0.13E-06 - 4.300000 0.894204 1.038382 0.18E-06 0.12E-06 - 4.400000 0.919964 1.727533 0.66E-07 0.11E-06 - 4.500000 0.945834 1.126875 0.43E-07 0.99E-07 - 4.600000 0.971558 1.496973 0.14E-06 0.89E-07 - 4.700000 0.996898 1.525070 0.23E-06 0.78E-07 - 4.800000 1.021641 1.101030 0.32E-06 0.66E-07 - 4.900000 1.045589 1.730922 0.39E-06 0.55E-07 - 5.000000 1.068565 1.056480 0.46E-06 0.44E-07 + 0.000000 1.224745 1.732051 0.00E+00 0.00E+00 + 0.100000 1.223726 1.077464 0.85E-06 0.88E-08 + 0.200000 1.220670 1.551800 0.84E-06 0.20E-07 + 0.300000 1.215595 1.467737 0.83E-06 0.31E-07 + 0.400000 1.208525 1.154583 0.82E-06 0.40E-07 + 0.500000 1.199497 1.721908 0.80E-06 0.48E-07 + 0.600000 1.188558 1.023517 0.78E-06 0.56E-07 + 0.700000 1.175765 1.622751 0.75E-06 0.62E-07 + 0.800000 1.161187 1.374632 0.72E-06 0.67E-07 + 0.900000 1.144905 1.245763 0.68E-06 0.71E-07 + 1.000000 1.127010 1.691839 0.64E-06 0.74E-07 + 1.100000 1.107610 1.000490 0.59E-06 0.76E-07 + 1.200000 1.086821 1.677552 0.53E-06 0.77E-07 + 1.300000 1.064777 1.277775 0.47E-06 0.78E-07 + 1.400000 1.041626 1.342455 0.41E-06 0.77E-07 + 1.500000 1.017531 1.642940 0.33E-06 0.75E-07 + 1.600000 0.992674 1.012112 0.25E-06 0.73E-07 + 1.700000 0.967253 1.714058 0.16E-06 0.69E-07 + 1.800000 0.941488 1.183867 0.63E-07 0.65E-07 + 1.900000 0.915617 1.437465 0.43E-07 0.59E-07 + 2.000000 0.889902 1.577082 0.16E-06 0.52E-07 + 2.100000 0.864625 1.056467 0.28E-06 0.45E-07 + 2.200000 0.840089 1.730920 0.42E-06 0.36E-07 + 2.300000 0.816616 1.101047 0.56E-06 0.26E-07 + 2.400000 0.794545 1.525051 0.70E-06 0.14E-07 + 2.500000 0.774227 1.496993 0.85E-06 0.21E-08 + 2.600000 0.756012 1.126857 0.99E-06 0.11E-07 + 2.700000 0.740245 1.727536 0.11E-05 0.25E-07 + 2.800000 0.727246 1.038393 0.13E-05 0.40E-07 + 2.900000 0.717300 1.600759 0.14E-05 0.55E-07 + 3.000000 0.710635 1.406379 0.14E-05 0.70E-07 + 3.100000 0.707411 1.214353 0.15E-05 0.85E-07 + 3.200000 0.707708 1.704026 0.15E-05 0.99E-07 + 3.300000 0.711518 1.004391 0.14E-05 0.11E-06 + 3.400000 0.718748 1.661225 0.14E-05 0.12E-06 + 3.500000 0.729225 1.310102 0.13E-05 0.13E-06 + 3.600000 0.742711 1.310080 0.12E-05 0.14E-06 + 3.700000 0.758913 1.661237 0.10E-05 0.14E-06 + 3.800000 0.777505 1.004387 0.88E-06 0.14E-06 + 3.900000 0.798143 1.704018 0.73E-06 0.14E-06 + 4.000000 0.820474 1.214374 0.59E-06 0.14E-06 + 4.100000 0.844149 1.406358 0.45E-06 0.13E-06 + 4.200000 0.868832 1.600774 0.31E-06 0.13E-06 + 4.300000 0.894204 1.038382 0.18E-06 0.12E-06 + 4.400000 0.919964 1.727533 0.66E-07 0.11E-06 + 4.500000 0.945834 1.126875 0.43E-07 0.99E-07 + 4.600000 0.971558 1.496973 0.14E-06 0.89E-07 + 4.700000 0.996898 1.525070 0.23E-06 0.78E-07 + 4.800000 1.021641 1.101030 0.32E-06 0.66E-07 + 4.900000 1.045589 1.730922 0.39E-06 0.55E-07 + 5.000000 1.068565 1.056480 0.46E-06 0.44E-07 ------------------------------------------------------ Final Solver Statistics: Steps: nsts = 501, nstf = 50601 - u error = 0.794E-06, v error = 0.825E-07, total error = 0.565E-06 - Total RHS evals: Fs = 1504, Ff = 152306 + u error = 0.794E-06, v error = 0.825E-07, total error = 0.565E-06 + Total RHS evals: Fs = 1504, Ff = 151853 diff --git a/examples/arkode/F2003_serial/ark_kpr_mri_f2003_0_0.002.out b/examples/arkode/F2003_serial/ark_kpr_mri_f2003_0_0.002.out index 5f383b5beb..c5001c9ed2 100644 --- a/examples/arkode/F2003_serial/ark_kpr_mri_f2003_0_0.002.out +++ b/examples/arkode/F2003_serial/ark_kpr_mri_f2003_0_0.002.out @@ -8,59 +8,59 @@ solver: exp-3/exp-3 (standard MIS) t u v uerr verr ------------------------------------------------------ - 0.000000 1.224745 1.732051 0.00E+00 0.00E+00 - 0.100000 1.223725 1.077464 0.50E-08 0.63E-10 - 0.200000 1.220669 1.551800 0.50E-08 0.14E-09 - 0.300000 1.215594 1.467737 0.49E-08 0.21E-09 - 0.400000 1.208524 1.154583 0.48E-08 0.28E-09 - 0.500000 1.199496 1.721908 0.47E-08 0.33E-09 - 0.600000 1.188557 1.023517 0.46E-08 0.38E-09 - 0.700000 1.175764 1.622751 0.44E-08 0.42E-09 - 0.800000 1.161186 1.374632 0.42E-08 0.46E-09 - 0.900000 1.144904 1.245763 0.40E-08 0.49E-09 - 1.000000 1.127010 1.691839 0.37E-08 0.51E-09 - 1.100000 1.107609 1.000489 0.34E-08 0.52E-09 - 1.200000 1.086821 1.677552 0.31E-08 0.53E-09 - 1.300000 1.064777 1.277775 0.28E-08 0.53E-09 - 1.400000 1.041625 1.342455 0.24E-08 0.52E-09 - 1.500000 1.017531 1.642940 0.19E-08 0.51E-09 - 1.600000 0.992673 1.012112 0.15E-08 0.49E-09 - 1.700000 0.967253 1.714058 0.93E-09 0.47E-09 - 1.800000 0.941488 1.183867 0.35E-09 0.44E-09 - 1.900000 0.915617 1.437465 0.27E-09 0.40E-09 - 2.000000 0.889903 1.577082 0.96E-09 0.36E-09 - 2.100000 0.864625 1.056467 0.17E-08 0.30E-09 - 2.200000 0.840089 1.730920 0.25E-08 0.24E-09 - 2.300000 0.816616 1.101047 0.33E-08 0.17E-09 - 2.400000 0.794546 1.525051 0.42E-08 0.93E-10 - 2.500000 0.774227 1.496993 0.50E-08 0.88E-11 - 2.600000 0.756013 1.126857 0.59E-08 0.80E-10 - 2.700000 0.740246 1.727536 0.67E-08 0.18E-09 - 2.800000 0.727247 1.038393 0.74E-08 0.28E-09 - 2.900000 0.717301 1.600759 0.80E-08 0.38E-09 - 3.000000 0.710636 1.406380 0.84E-08 0.49E-09 - 3.100000 0.707412 1.214353 0.86E-08 0.58E-09 - 3.200000 0.707709 1.704026 0.86E-08 0.68E-09 - 3.300000 0.711520 1.004391 0.85E-08 0.76E-09 - 3.400000 0.718750 1.661225 0.81E-08 0.83E-09 - 3.500000 0.729227 1.310102 0.75E-08 0.89E-09 - 3.600000 0.742712 1.310080 0.68E-08 0.93E-09 - 3.700000 0.758914 1.661237 0.60E-08 0.96E-09 - 3.800000 0.777506 1.004387 0.52E-08 0.96E-09 - 3.900000 0.798144 1.704019 0.43E-08 0.96E-09 - 4.000000 0.820474 1.214374 0.34E-08 0.93E-09 - 4.100000 0.844149 1.406358 0.26E-08 0.90E-09 - 4.200000 0.868832 1.600774 0.18E-08 0.86E-09 - 4.300000 0.894204 1.038382 0.11E-08 0.80E-09 - 4.400000 0.919964 1.727533 0.37E-09 0.74E-09 - 4.500000 0.945834 1.126875 0.27E-09 0.67E-09 - 4.600000 0.971557 1.496974 0.86E-09 0.60E-09 - 4.700000 0.996898 1.525070 0.14E-08 0.53E-09 - 4.800000 1.021641 1.101030 0.19E-08 0.45E-09 - 4.900000 1.045589 1.730922 0.23E-08 0.37E-09 - 5.000000 1.068565 1.056480 0.27E-08 0.29E-09 + 0.000000 1.224745 1.732051 0.00E+00 0.00E+00 + 0.100000 1.223725 1.077464 0.50E-08 0.63E-10 + 0.200000 1.220669 1.551800 0.50E-08 0.14E-09 + 0.300000 1.215594 1.467737 0.49E-08 0.21E-09 + 0.400000 1.208524 1.154583 0.48E-08 0.28E-09 + 0.500000 1.199496 1.721908 0.47E-08 0.33E-09 + 0.600000 1.188557 1.023517 0.46E-08 0.38E-09 + 0.700000 1.175764 1.622751 0.44E-08 0.42E-09 + 0.800000 1.161186 1.374632 0.42E-08 0.46E-09 + 0.900000 1.144904 1.245763 0.40E-08 0.49E-09 + 1.000000 1.127010 1.691839 0.37E-08 0.51E-09 + 1.100000 1.107609 1.000489 0.34E-08 0.52E-09 + 1.200000 1.086821 1.677552 0.31E-08 0.53E-09 + 1.300000 1.064777 1.277775 0.28E-08 0.53E-09 + 1.400000 1.041625 1.342455 0.24E-08 0.52E-09 + 1.500000 1.017531 1.642940 0.19E-08 0.51E-09 + 1.600000 0.992673 1.012112 0.15E-08 0.49E-09 + 1.700000 0.967253 1.714058 0.93E-09 0.47E-09 + 1.800000 0.941488 1.183867 0.35E-09 0.44E-09 + 1.900000 0.915617 1.437465 0.27E-09 0.40E-09 + 2.000000 0.889903 1.577082 0.96E-09 0.36E-09 + 2.100000 0.864625 1.056467 0.17E-08 0.30E-09 + 2.200000 0.840089 1.730920 0.25E-08 0.24E-09 + 2.300000 0.816616 1.101047 0.33E-08 0.17E-09 + 2.400000 0.794546 1.525051 0.42E-08 0.93E-10 + 2.500000 0.774227 1.496993 0.50E-08 0.88E-11 + 2.600000 0.756013 1.126857 0.59E-08 0.80E-10 + 2.700000 0.740246 1.727536 0.67E-08 0.18E-09 + 2.800000 0.727247 1.038393 0.74E-08 0.28E-09 + 2.900000 0.717301 1.600759 0.80E-08 0.38E-09 + 3.000000 0.710636 1.406380 0.84E-08 0.49E-09 + 3.100000 0.707412 1.214353 0.86E-08 0.58E-09 + 3.200000 0.707709 1.704026 0.86E-08 0.68E-09 + 3.300000 0.711520 1.004391 0.85E-08 0.76E-09 + 3.400000 0.718750 1.661225 0.81E-08 0.83E-09 + 3.500000 0.729227 1.310102 0.75E-08 0.89E-09 + 3.600000 0.742712 1.310080 0.68E-08 0.93E-09 + 3.700000 0.758914 1.661237 0.60E-08 0.96E-09 + 3.800000 0.777506 1.004387 0.52E-08 0.96E-09 + 3.900000 0.798144 1.704019 0.43E-08 0.96E-09 + 4.000000 0.820474 1.214374 0.34E-08 0.93E-09 + 4.100000 0.844149 1.406358 0.26E-08 0.90E-09 + 4.200000 0.868832 1.600774 0.18E-08 0.86E-09 + 4.300000 0.894204 1.038382 0.11E-08 0.80E-09 + 4.400000 0.919964 1.727533 0.37E-09 0.74E-09 + 4.500000 0.945834 1.126875 0.27E-09 0.67E-09 + 4.600000 0.971557 1.496974 0.86E-09 0.60E-09 + 4.700000 0.996898 1.525070 0.14E-08 0.53E-09 + 4.800000 1.021641 1.101030 0.19E-08 0.45E-09 + 4.900000 1.045589 1.730922 0.23E-08 0.37E-09 + 5.000000 1.068565 1.056480 0.27E-08 0.29E-09 ------------------------------------------------------ Final Solver Statistics: Steps: nsts = 2501, nstf = 252601 - u error = 0.467E-08, v error = 0.564E-09, total error = 0.333E-08 - Total RHS evals: Fs = 7504, Ff = 760306 + u error = 0.467E-08, v error = 0.564E-09, total error = 0.333E-08 + Total RHS evals: Fs = 7504, Ff = 757853 diff --git a/examples/arkode/F2003_serial/ark_kpr_mri_f2003_1_0.002.out b/examples/arkode/F2003_serial/ark_kpr_mri_f2003_1_0.002.out index d0dcc20c8d..c84e3cde4b 100644 --- a/examples/arkode/F2003_serial/ark_kpr_mri_f2003_1_0.002.out +++ b/examples/arkode/F2003_serial/ark_kpr_mri_f2003_1_0.002.out @@ -8,59 +8,59 @@ solver: none/exp-3 (no slow, explicit fast) t u v uerr verr ------------------------------------------------------ - 0.000000 1.224745 1.732051 0.00E+00 0.00E+00 - 0.100000 1.223725 1.077464 0.51E-12 0.19E-12 - 0.200000 1.220669 1.551800 0.36E-12 0.49E-13 - 0.300000 1.215594 1.467737 0.20E-12 0.25E-12 - 0.400000 1.208524 1.154583 0.95E-13 0.56E-12 - 0.500000 1.199496 1.721908 0.21E-12 0.43E-13 - 0.600000 1.188557 1.023517 0.47E-12 0.61E-12 - 0.700000 1.175764 1.622751 0.36E-12 0.32E-13 - 0.800000 1.161186 1.374632 0.31E-12 0.22E-12 - 0.900000 1.144904 1.245763 0.20E-12 0.37E-12 - 1.000000 1.127010 1.691839 0.13E-12 0.13E-12 - 1.100000 1.107609 1.000489 0.35E-12 0.31E-11 - 1.200000 1.086821 1.677552 0.37E-12 0.73E-13 - 1.300000 1.064777 1.277775 0.38E-12 0.16E-11 - 1.400000 1.041625 1.342455 0.29E-12 0.12E-11 - 1.500000 1.017531 1.642940 0.59E-13 0.24E-12 - 1.600000 0.992673 1.012112 0.20E-12 0.25E-11 - 1.700000 0.967253 1.714058 0.34E-12 0.72E-12 - 1.800000 0.941488 1.183867 0.45E-12 0.16E-11 - 1.900000 0.915617 1.437465 0.34E-12 0.38E-12 - 2.000000 0.889903 1.577082 0.35E-13 0.32E-12 - 2.100000 0.864625 1.056467 0.95E-13 0.36E-11 - 2.200000 0.840089 1.730920 0.28E-12 0.98E-12 - 2.300000 0.816616 1.101047 0.53E-12 0.31E-11 - 2.400000 0.794546 1.525051 0.35E-12 0.14E-12 - 2.500000 0.774227 1.496993 0.17E-12 0.15E-12 - 2.600000 0.756013 1.126857 0.56E-13 0.28E-11 - 2.700000 0.740246 1.727536 0.23E-12 0.16E-11 - 2.800000 0.727247 1.038393 0.49E-12 0.33E-11 - 2.900000 0.717301 1.600759 0.38E-12 0.90E-12 - 3.000000 0.710636 1.406380 0.27E-12 0.37E-12 - 3.100000 0.707412 1.214353 0.18E-12 0.19E-11 - 3.200000 0.707709 1.704026 0.17E-12 0.19E-11 - 3.300000 0.711520 1.004391 0.40E-12 0.36E-11 - 3.400000 0.718750 1.661225 0.39E-12 0.17E-11 - 3.500000 0.729227 1.310102 0.36E-12 0.82E-12 - 3.600000 0.742712 1.310080 0.28E-12 0.92E-12 - 3.700000 0.758914 1.661237 0.98E-13 0.20E-11 - 3.800000 0.777506 1.004387 0.26E-12 0.38E-11 - 3.900000 0.798144 1.704019 0.37E-12 0.23E-11 - 4.000000 0.820474 1.214374 0.44E-12 0.15E-11 - 4.100000 0.844149 1.406358 0.34E-12 0.18E-13 - 4.200000 0.868832 1.600774 0.67E-15 0.17E-11 - 4.300000 0.894204 1.038382 0.11E-12 0.36E-11 - 4.400000 0.919964 1.727533 0.33E-12 0.28E-11 - 4.500000 0.945834 1.126875 0.50E-12 0.24E-11 - 4.600000 0.971557 1.496974 0.38E-12 0.91E-12 - 4.700000 0.996898 1.525070 0.11E-12 0.13E-11 - 4.800000 1.021641 1.101030 0.31E-13 0.30E-11 - 4.900000 1.045589 1.730922 0.28E-12 0.30E-11 - 5.000000 1.068565 1.056480 0.50E-12 0.34E-11 + 0.000000 1.224745 1.732051 0.00E+00 0.00E+00 + 0.100000 1.223725 1.077464 0.51E-12 0.19E-12 + 0.200000 1.220669 1.551800 0.36E-12 0.49E-13 + 0.300000 1.215594 1.467737 0.20E-12 0.25E-12 + 0.400000 1.208524 1.154583 0.95E-13 0.56E-12 + 0.500000 1.199496 1.721908 0.21E-12 0.43E-13 + 0.600000 1.188557 1.023517 0.47E-12 0.61E-12 + 0.700000 1.175764 1.622751 0.36E-12 0.32E-13 + 0.800000 1.161186 1.374632 0.31E-12 0.22E-12 + 0.900000 1.144904 1.245763 0.20E-12 0.37E-12 + 1.000000 1.127010 1.691839 0.13E-12 0.13E-12 + 1.100000 1.107609 1.000489 0.35E-12 0.31E-11 + 1.200000 1.086821 1.677552 0.37E-12 0.73E-13 + 1.300000 1.064777 1.277775 0.38E-12 0.16E-11 + 1.400000 1.041625 1.342455 0.29E-12 0.12E-11 + 1.500000 1.017531 1.642940 0.59E-13 0.24E-12 + 1.600000 0.992673 1.012112 0.20E-12 0.25E-11 + 1.700000 0.967253 1.714058 0.34E-12 0.72E-12 + 1.800000 0.941488 1.183867 0.45E-12 0.16E-11 + 1.900000 0.915617 1.437465 0.34E-12 0.38E-12 + 2.000000 0.889903 1.577082 0.35E-13 0.32E-12 + 2.100000 0.864625 1.056467 0.95E-13 0.36E-11 + 2.200000 0.840089 1.730920 0.28E-12 0.98E-12 + 2.300000 0.816616 1.101047 0.53E-12 0.31E-11 + 2.400000 0.794546 1.525051 0.35E-12 0.14E-12 + 2.500000 0.774227 1.496993 0.17E-12 0.15E-12 + 2.600000 0.756013 1.126857 0.56E-13 0.28E-11 + 2.700000 0.740246 1.727536 0.23E-12 0.16E-11 + 2.800000 0.727247 1.038393 0.49E-12 0.33E-11 + 2.900000 0.717301 1.600759 0.38E-12 0.90E-12 + 3.000000 0.710636 1.406380 0.27E-12 0.37E-12 + 3.100000 0.707412 1.214353 0.18E-12 0.19E-11 + 3.200000 0.707709 1.704026 0.17E-12 0.19E-11 + 3.300000 0.711520 1.004391 0.40E-12 0.36E-11 + 3.400000 0.718750 1.661225 0.39E-12 0.17E-11 + 3.500000 0.729227 1.310102 0.36E-12 0.82E-12 + 3.600000 0.742712 1.310080 0.28E-12 0.92E-12 + 3.700000 0.758914 1.661237 0.98E-13 0.20E-11 + 3.800000 0.777506 1.004387 0.26E-12 0.38E-11 + 3.900000 0.798144 1.704019 0.37E-12 0.23E-11 + 4.000000 0.820474 1.214374 0.44E-12 0.15E-11 + 4.100000 0.844149 1.406358 0.34E-12 0.18E-13 + 4.200000 0.868832 1.600774 0.67E-15 0.17E-11 + 4.300000 0.894204 1.038382 0.11E-12 0.36E-11 + 4.400000 0.919964 1.727533 0.33E-12 0.28E-11 + 4.500000 0.945834 1.126875 0.50E-12 0.24E-11 + 4.600000 0.971557 1.496974 0.38E-12 0.91E-12 + 4.700000 0.996898 1.525070 0.11E-12 0.13E-11 + 4.800000 1.021641 1.101030 0.31E-13 0.30E-11 + 4.900000 1.045589 1.730922 0.28E-12 0.30E-11 + 5.000000 1.068565 1.056480 0.50E-12 0.34E-11 ------------------------------------------------------ Final Solver Statistics: Steps: nsts = 2501, nstf = 252601 - u error = 0.316E-12, v error = 0.191E-11, total error = 0.137E-11 - Total RHS evals: Fs = 5003, Ff = 760306 + u error = 0.316E-12, v error = 0.191E-11, total error = 0.137E-11 + Total RHS evals: Fs = 5003, Ff = 757853 diff --git a/examples/arkode/F2003_serial/ark_kpr_mri_f2003_3_0.01.out b/examples/arkode/F2003_serial/ark_kpr_mri_f2003_3_0.01.out index c77af2546d..fb98664760 100644 --- a/examples/arkode/F2003_serial/ark_kpr_mri_f2003_3_0.01.out +++ b/examples/arkode/F2003_serial/ark_kpr_mri_f2003_3_0.01.out @@ -8,59 +8,59 @@ solver: exp-3/none (explicit slow, no fast) t u v uerr verr ------------------------------------------------------ - 0.000000 1.224745 1.732051 0.00E+00 0.00E+00 - 0.100000 1.223763 1.078830 0.38E-04 0.14E-02 - 0.200000 1.220621 1.551459 0.48E-04 0.34E-03 - 0.300000 1.215670 1.468283 0.77E-04 0.55E-03 - 0.400000 1.208470 1.153553 0.54E-04 0.10E-02 - 0.500000 1.199503 1.721912 0.72E-05 0.45E-05 - 0.600000 1.188562 1.024685 0.52E-05 0.12E-02 - 0.700000 1.175722 1.622394 0.42E-04 0.36E-03 - 0.800000 1.161273 1.375492 0.87E-04 0.86E-03 - 0.900000 1.144848 1.244851 0.56E-04 0.91E-03 - 1.000000 1.127033 1.692049 0.23E-04 0.21E-03 - 1.100000 1.107588 1.000787 0.21E-04 0.30E-03 - 1.200000 1.086786 1.677292 0.34E-04 0.26E-03 - 1.300000 1.064866 1.278796 0.89E-04 0.10E-02 - 1.400000 1.041569 1.341623 0.57E-04 0.83E-03 - 1.500000 1.017571 1.643329 0.41E-04 0.39E-03 - 1.600000 0.992634 1.011394 0.39E-04 0.72E-03 - 1.700000 0.967229 1.714025 0.24E-04 0.33E-04 - 1.800000 0.941564 1.184983 0.76E-04 0.11E-02 - 1.900000 0.915563 1.436882 0.55E-04 0.58E-03 - 2.000000 0.889959 1.577469 0.57E-04 0.39E-03 - 2.100000 0.864576 1.055284 0.50E-04 0.12E-02 - 2.200000 0.840077 1.730958 0.12E-04 0.37E-04 - 2.300000 0.816664 1.102379 0.48E-04 0.13E-02 - 2.400000 0.794495 1.524701 0.51E-04 0.35E-03 - 2.500000 0.774298 1.497468 0.71E-04 0.47E-03 - 2.600000 0.755958 1.125772 0.55E-04 0.11E-02 - 2.700000 0.740246 1.727533 0.49E-06 0.36E-05 - 2.800000 0.727261 1.039718 0.14E-04 0.13E-02 - 2.900000 0.717255 1.600423 0.46E-04 0.34E-03 - 3.000000 0.710718 1.407151 0.82E-04 0.77E-03 - 3.100000 0.707355 1.213428 0.58E-04 0.92E-03 - 3.200000 0.707725 1.704161 0.15E-04 0.13E-03 - 3.300000 0.711504 1.005042 0.15E-04 0.65E-03 - 3.400000 0.718710 1.660915 0.39E-04 0.31E-03 - 3.500000 0.729315 1.311097 0.88E-04 0.10E-02 - 3.600000 0.742653 1.309213 0.59E-04 0.87E-03 - 3.700000 0.758947 1.661594 0.33E-04 0.36E-03 - 3.800000 0.777471 1.003977 0.35E-04 0.41E-03 - 3.900000 0.798115 1.703919 0.29E-04 0.10E-03 - 4.000000 0.820556 1.215451 0.82E-04 0.11E-02 - 4.100000 0.844093 1.405680 0.57E-04 0.68E-03 - 4.200000 0.868883 1.601174 0.51E-04 0.40E-03 - 4.300000 0.894157 1.037277 0.47E-04 0.11E-02 - 4.400000 0.919948 1.727576 0.16E-04 0.42E-04 - 4.500000 0.945893 1.128134 0.59E-04 0.13E-02 - 4.600000 0.971505 1.496571 0.52E-04 0.40E-03 - 4.700000 0.996965 1.525489 0.67E-04 0.42E-03 - 4.800000 1.021588 1.099882 0.52E-04 0.11E-02 - 4.900000 1.045586 1.730924 0.28E-05 0.26E-05 - 5.000000 1.068592 1.057870 0.27E-04 0.14E-02 + 0.000000 1.224745 1.732051 0.00E+00 0.00E+00 + 0.100000 1.223763 1.078830 0.38E-04 0.14E-02 + 0.200000 1.220621 1.551459 0.48E-04 0.34E-03 + 0.300000 1.215670 1.468283 0.77E-04 0.55E-03 + 0.400000 1.208470 1.153553 0.54E-04 0.10E-02 + 0.500000 1.199503 1.721912 0.72E-05 0.45E-05 + 0.600000 1.188562 1.024685 0.52E-05 0.12E-02 + 0.700000 1.175722 1.622394 0.42E-04 0.36E-03 + 0.800000 1.161273 1.375492 0.87E-04 0.86E-03 + 0.900000 1.144848 1.244851 0.56E-04 0.91E-03 + 1.000000 1.127033 1.692049 0.23E-04 0.21E-03 + 1.100000 1.107588 1.000787 0.21E-04 0.30E-03 + 1.200000 1.086786 1.677292 0.34E-04 0.26E-03 + 1.300000 1.064866 1.278796 0.89E-04 0.10E-02 + 1.400000 1.041569 1.341623 0.57E-04 0.83E-03 + 1.500000 1.017571 1.643329 0.41E-04 0.39E-03 + 1.600000 0.992634 1.011394 0.39E-04 0.72E-03 + 1.700000 0.967229 1.714025 0.24E-04 0.33E-04 + 1.800000 0.941564 1.184983 0.76E-04 0.11E-02 + 1.900000 0.915563 1.436882 0.55E-04 0.58E-03 + 2.000000 0.889959 1.577469 0.57E-04 0.39E-03 + 2.100000 0.864576 1.055284 0.50E-04 0.12E-02 + 2.200000 0.840077 1.730958 0.12E-04 0.37E-04 + 2.300000 0.816664 1.102379 0.48E-04 0.13E-02 + 2.400000 0.794495 1.524701 0.51E-04 0.35E-03 + 2.500000 0.774298 1.497468 0.71E-04 0.47E-03 + 2.600000 0.755958 1.125772 0.55E-04 0.11E-02 + 2.700000 0.740246 1.727533 0.49E-06 0.36E-05 + 2.800000 0.727261 1.039718 0.14E-04 0.13E-02 + 2.900000 0.717255 1.600423 0.46E-04 0.34E-03 + 3.000000 0.710718 1.407151 0.82E-04 0.77E-03 + 3.100000 0.707355 1.213428 0.58E-04 0.92E-03 + 3.200000 0.707725 1.704161 0.15E-04 0.13E-03 + 3.300000 0.711504 1.005042 0.15E-04 0.65E-03 + 3.400000 0.718710 1.660915 0.39E-04 0.31E-03 + 3.500000 0.729315 1.311097 0.88E-04 0.10E-02 + 3.600000 0.742653 1.309213 0.59E-04 0.87E-03 + 3.700000 0.758947 1.661594 0.33E-04 0.36E-03 + 3.800000 0.777471 1.003977 0.35E-04 0.41E-03 + 3.900000 0.798115 1.703919 0.29E-04 0.10E-03 + 4.000000 0.820556 1.215451 0.82E-04 0.11E-02 + 4.100000 0.844093 1.405680 0.57E-04 0.68E-03 + 4.200000 0.868883 1.601174 0.51E-04 0.40E-03 + 4.300000 0.894157 1.037277 0.47E-04 0.11E-02 + 4.400000 0.919948 1.727576 0.16E-04 0.42E-04 + 4.500000 0.945893 1.128134 0.59E-04 0.13E-02 + 4.600000 0.971505 1.496571 0.52E-04 0.40E-03 + 4.700000 0.996965 1.525489 0.67E-04 0.42E-03 + 4.800000 1.021588 1.099882 0.52E-04 0.11E-02 + 4.900000 1.045586 1.730924 0.28E-05 0.26E-05 + 5.000000 1.068592 1.057870 0.27E-04 0.14E-02 ------------------------------------------------------ Final Solver Statistics: Steps: nsts = 501, nstf = 50601 - u error = 0.505E-04, v error = 0.768E-03, total error = 0.545E-03 - Total RHS evals: Fs = 1504, Ff = 152306 + u error = 0.505E-04, v error = 0.768E-03, total error = 0.545E-03 + Total RHS evals: Fs = 1504, Ff = 151853 diff --git a/examples/arkode/F2003_serial/ark_kpr_mri_f2003_4_0.002.out b/examples/arkode/F2003_serial/ark_kpr_mri_f2003_4_0.002.out index 973afbc8c9..22fca6299a 100644 --- a/examples/arkode/F2003_serial/ark_kpr_mri_f2003_4_0.002.out +++ b/examples/arkode/F2003_serial/ark_kpr_mri_f2003_4_0.002.out @@ -9,62 +9,62 @@ reltol: 0.4000E-05 abstol: 0.1000E-10 t u v uerr verr ------------------------------------------------------ - 0.000000 1.224745 1.732051 0.00E+00 0.00E+00 - 0.100000 1.223734 1.079428 0.94E-05 0.20E-02 - 0.200000 1.220669 1.551975 0.32E-06 0.17E-03 - 0.300000 1.215599 1.468008 0.55E-05 0.27E-03 - 0.400000 1.208526 1.155919 0.22E-05 0.13E-02 - 0.500000 1.199497 1.721561 0.88E-06 0.35E-03 - 0.600000 1.188564 1.025537 0.74E-05 0.20E-02 - 0.700000 1.175763 1.622485 0.12E-05 0.27E-03 - 0.800000 1.161186 1.374900 0.25E-06 0.27E-03 - 0.900000 1.144904 1.246450 0.11E-06 0.69E-03 - 1.000000 1.127010 1.691322 0.54E-06 0.52E-03 - 1.100000 1.107615 1.002500 0.54E-05 0.20E-02 - 1.200000 1.086818 1.677003 0.21E-05 0.55E-03 - 1.300000 1.064782 1.278198 0.55E-05 0.42E-03 - 1.400000 1.041624 1.342655 0.14E-05 0.20E-03 - 1.500000 1.017531 1.642375 0.74E-06 0.56E-03 - 1.600000 0.992677 1.013911 0.34E-05 0.18E-02 - 1.700000 0.967249 1.713353 0.35E-05 0.71E-03 - 1.800000 0.941493 1.184579 0.54E-05 0.71E-03 - 1.900000 0.915615 1.437305 0.24E-05 0.16E-03 - 2.000000 0.889904 1.576564 0.13E-05 0.52E-03 - 2.100000 0.864627 1.057868 0.15E-05 0.14E-02 - 2.200000 0.840087 1.730117 0.24E-05 0.80E-03 - 2.300000 0.816622 1.102136 0.58E-05 0.11E-02 - 2.400000 0.794543 1.524625 0.31E-05 0.43E-03 - 2.500000 0.774230 1.496597 0.22E-05 0.40E-03 - 2.600000 0.756013 1.127800 0.77E-07 0.94E-03 - 2.700000 0.740244 1.726696 0.18E-05 0.84E-03 - 2.800000 0.727253 1.039861 0.53E-05 0.15E-02 - 2.900000 0.717298 1.600138 0.32E-05 0.62E-03 - 3.000000 0.710633 1.406200 0.30E-05 0.18E-03 - 3.100000 0.707411 1.214845 0.12E-05 0.49E-03 - 3.200000 0.707708 1.703196 0.12E-05 0.83E-03 - 3.300000 0.711524 1.006102 0.44E-05 0.17E-02 - 3.400000 0.718746 1.660466 0.34E-05 0.76E-03 - 3.500000 0.729231 1.310194 0.41E-05 0.93E-04 - 3.600000 0.742710 1.310190 0.22E-05 0.11E-03 - 3.700000 0.758913 1.660462 0.47E-06 0.77E-03 - 3.800000 0.777509 1.006087 0.31E-05 0.17E-02 - 3.900000 0.798140 1.703188 0.39E-05 0.83E-03 - 4.000000 0.820479 1.214819 0.46E-05 0.45E-03 - 4.100000 0.844147 1.406163 0.28E-05 0.20E-03 - 4.200000 0.868833 1.600102 0.42E-06 0.67E-03 - 4.300000 0.894205 1.039813 0.15E-05 0.14E-02 - 4.400000 0.919961 1.726651 0.28E-05 0.88E-03 - 4.500000 0.945839 1.127737 0.53E-05 0.86E-03 - 4.600000 0.971554 1.496541 0.33E-05 0.43E-03 - 4.700000 0.996899 1.524547 0.14E-05 0.52E-03 - 4.800000 1.021641 1.102066 0.86E-07 0.10E-02 - 4.900000 1.045587 1.730025 0.20E-05 0.90E-03 - 5.000000 1.068570 1.057773 0.53E-05 0.13E-02 + 0.000000 1.224745 1.732051 0.00E+00 0.00E+00 + 0.100000 1.223734 1.079428 0.94E-05 0.20E-02 + 0.200000 1.220669 1.551975 0.32E-06 0.17E-03 + 0.300000 1.215599 1.468008 0.55E-05 0.27E-03 + 0.400000 1.208526 1.155919 0.22E-05 0.13E-02 + 0.500000 1.199497 1.721561 0.88E-06 0.35E-03 + 0.600000 1.188564 1.025537 0.74E-05 0.20E-02 + 0.700000 1.175763 1.622485 0.12E-05 0.27E-03 + 0.800000 1.161186 1.374900 0.25E-06 0.27E-03 + 0.900000 1.144904 1.246450 0.11E-06 0.69E-03 + 1.000000 1.127010 1.691322 0.54E-06 0.52E-03 + 1.100000 1.107615 1.002500 0.54E-05 0.20E-02 + 1.200000 1.086818 1.677003 0.21E-05 0.55E-03 + 1.300000 1.064782 1.278198 0.55E-05 0.42E-03 + 1.400000 1.041624 1.342655 0.14E-05 0.20E-03 + 1.500000 1.017531 1.642375 0.74E-06 0.56E-03 + 1.600000 0.992677 1.013911 0.34E-05 0.18E-02 + 1.700000 0.967249 1.713353 0.35E-05 0.71E-03 + 1.800000 0.941493 1.184579 0.54E-05 0.71E-03 + 1.900000 0.915615 1.437305 0.24E-05 0.16E-03 + 2.000000 0.889904 1.576564 0.13E-05 0.52E-03 + 2.100000 0.864627 1.057868 0.15E-05 0.14E-02 + 2.200000 0.840087 1.730117 0.24E-05 0.80E-03 + 2.300000 0.816622 1.102136 0.58E-05 0.11E-02 + 2.400000 0.794543 1.524625 0.31E-05 0.43E-03 + 2.500000 0.774230 1.496597 0.22E-05 0.40E-03 + 2.600000 0.756013 1.127800 0.77E-07 0.94E-03 + 2.700000 0.740244 1.726696 0.18E-05 0.84E-03 + 2.800000 0.727253 1.039861 0.53E-05 0.15E-02 + 2.900000 0.717298 1.600138 0.32E-05 0.62E-03 + 3.000000 0.710633 1.406200 0.30E-05 0.18E-03 + 3.100000 0.707411 1.214845 0.12E-05 0.49E-03 + 3.200000 0.707708 1.703196 0.12E-05 0.83E-03 + 3.300000 0.711524 1.006102 0.44E-05 0.17E-02 + 3.400000 0.718746 1.660466 0.34E-05 0.76E-03 + 3.500000 0.729231 1.310194 0.41E-05 0.93E-04 + 3.600000 0.742710 1.310190 0.22E-05 0.11E-03 + 3.700000 0.758913 1.660462 0.47E-06 0.77E-03 + 3.800000 0.777509 1.006087 0.31E-05 0.17E-02 + 3.900000 0.798140 1.703188 0.39E-05 0.83E-03 + 4.000000 0.820479 1.214819 0.46E-05 0.45E-03 + 4.100000 0.844147 1.406163 0.28E-05 0.20E-03 + 4.200000 0.868833 1.600102 0.42E-06 0.67E-03 + 4.300000 0.894205 1.039813 0.15E-05 0.14E-02 + 4.400000 0.919961 1.726651 0.28E-05 0.88E-03 + 4.500000 0.945839 1.127737 0.53E-05 0.86E-03 + 4.600000 0.971554 1.496541 0.33E-05 0.43E-03 + 4.700000 0.996899 1.524547 0.14E-05 0.52E-03 + 4.800000 1.021641 1.102066 0.86E-07 0.10E-02 + 4.900000 1.045587 1.730025 0.20E-05 0.90E-03 + 5.000000 1.068570 1.057773 0.53E-05 0.13E-02 ------------------------------------------------------ Final Solver Statistics: Steps: nsts = 2501, nstf = 250100 - u error = 0.348E-05, v error = 0.953E-03, total error = 0.674E-03 - Total RHS evals: Fs = 7143, Ff = 755303 + u error = 0.348E-05, v error = 0.953E-03, total error = 0.674E-03 + Total RHS evals: Fs = 7143, Ff = 750350 Slow Newton iters = 4641 Slow Newton conv fails = 0 Slow Jacobian evals = 126 diff --git a/examples/arkode/F2003_serial/ark_kpr_mri_f2003_5_0.002.out b/examples/arkode/F2003_serial/ark_kpr_mri_f2003_5_0.002.out index 8cac37fa66..48dd3ab5e5 100644 --- a/examples/arkode/F2003_serial/ark_kpr_mri_f2003_5_0.002.out +++ b/examples/arkode/F2003_serial/ark_kpr_mri_f2003_5_0.002.out @@ -8,59 +8,59 @@ solver: exp-4/exp-4 (MRI-GARK-ERK45a / ERK-4-4) t u v uerr verr ------------------------------------------------------ - 0.000000 1.224745 1.732051 0.00E+00 0.00E+00 - 0.100000 1.223725 1.077464 0.18E-09 0.11E-10 - 0.200000 1.220669 1.551800 0.18E-09 0.21E-10 - 0.300000 1.215594 1.467737 0.17E-09 0.31E-10 - 0.400000 1.208524 1.154583 0.17E-09 0.39E-10 - 0.500000 1.199496 1.721908 0.17E-09 0.47E-10 - 0.600000 1.188557 1.023517 0.16E-09 0.53E-10 - 0.700000 1.175764 1.622751 0.16E-09 0.59E-10 - 0.800000 1.161186 1.374632 0.15E-09 0.63E-10 - 0.900000 1.144904 1.245763 0.14E-09 0.66E-10 - 1.000000 1.127010 1.691839 0.13E-09 0.69E-10 - 1.100000 1.107609 1.000489 0.12E-09 0.71E-10 - 1.200000 1.086821 1.677552 0.11E-09 0.72E-10 - 1.300000 1.064777 1.277775 0.99E-10 0.72E-10 - 1.400000 1.041625 1.342455 0.85E-10 0.71E-10 - 1.500000 1.017531 1.642940 0.69E-10 0.70E-10 - 1.600000 0.992673 1.012112 0.52E-10 0.67E-10 - 1.700000 0.967253 1.714058 0.34E-10 0.63E-10 - 1.800000 0.941488 1.183867 0.13E-10 0.59E-10 - 1.900000 0.915617 1.437465 0.91E-11 0.53E-10 - 2.000000 0.889903 1.577082 0.33E-10 0.47E-10 - 2.100000 0.864625 1.056467 0.59E-10 0.36E-10 - 2.200000 0.840089 1.730920 0.87E-10 0.32E-10 - 2.300000 0.816616 1.101047 0.12E-09 0.19E-10 - 2.400000 0.794546 1.525051 0.15E-09 0.11E-10 - 2.500000 0.774227 1.496993 0.18E-09 0.12E-11 - 2.600000 0.756013 1.126857 0.21E-09 0.16E-10 - 2.700000 0.740246 1.727536 0.24E-09 0.25E-10 - 2.800000 0.727247 1.038393 0.26E-09 0.44E-10 - 2.900000 0.717301 1.600759 0.28E-09 0.54E-10 - 3.000000 0.710636 1.406380 0.30E-09 0.69E-10 - 3.100000 0.707412 1.214353 0.31E-09 0.84E-10 - 3.200000 0.707709 1.704026 0.31E-09 0.93E-10 - 3.300000 0.711520 1.004391 0.30E-09 0.11E-09 - 3.400000 0.718750 1.661225 0.29E-09 0.11E-09 - 3.500000 0.729227 1.310102 0.27E-09 0.12E-09 - 3.600000 0.742712 1.310080 0.24E-09 0.13E-09 - 3.700000 0.758914 1.661237 0.22E-09 0.13E-09 - 3.800000 0.777506 1.004387 0.19E-09 0.13E-09 - 3.900000 0.798144 1.704019 0.15E-09 0.13E-09 - 4.000000 0.820474 1.214374 0.12E-09 0.13E-09 - 4.100000 0.844149 1.406358 0.94E-10 0.12E-09 - 4.200000 0.868832 1.600774 0.65E-10 0.11E-09 - 4.300000 0.894204 1.038382 0.39E-10 0.11E-09 - 4.400000 0.919964 1.727533 0.14E-10 0.97E-10 - 4.500000 0.945834 1.126875 0.89E-11 0.91E-10 - 4.600000 0.971557 1.496974 0.30E-10 0.79E-10 - 4.700000 0.996898 1.525070 0.49E-10 0.69E-10 - 4.800000 1.021641 1.101030 0.67E-10 0.61E-10 - 4.900000 1.045589 1.730922 0.83E-10 0.47E-10 - 5.000000 1.068565 1.056480 0.97E-10 0.40E-10 + 0.000000 1.224745 1.732051 0.00E+00 0.00E+00 + 0.100000 1.223725 1.077464 0.18E-09 0.11E-10 + 0.200000 1.220669 1.551800 0.18E-09 0.21E-10 + 0.300000 1.215594 1.467737 0.17E-09 0.31E-10 + 0.400000 1.208524 1.154583 0.17E-09 0.39E-10 + 0.500000 1.199496 1.721908 0.17E-09 0.47E-10 + 0.600000 1.188557 1.023517 0.16E-09 0.53E-10 + 0.700000 1.175764 1.622751 0.16E-09 0.59E-10 + 0.800000 1.161186 1.374632 0.15E-09 0.63E-10 + 0.900000 1.144904 1.245763 0.14E-09 0.66E-10 + 1.000000 1.127010 1.691839 0.13E-09 0.69E-10 + 1.100000 1.107609 1.000489 0.12E-09 0.71E-10 + 1.200000 1.086821 1.677552 0.11E-09 0.72E-10 + 1.300000 1.064777 1.277775 0.99E-10 0.72E-10 + 1.400000 1.041625 1.342455 0.85E-10 0.71E-10 + 1.500000 1.017531 1.642940 0.69E-10 0.70E-10 + 1.600000 0.992673 1.012112 0.52E-10 0.67E-10 + 1.700000 0.967253 1.714058 0.34E-10 0.63E-10 + 1.800000 0.941488 1.183867 0.13E-10 0.59E-10 + 1.900000 0.915617 1.437465 0.91E-11 0.53E-10 + 2.000000 0.889903 1.577082 0.33E-10 0.47E-10 + 2.100000 0.864625 1.056467 0.59E-10 0.36E-10 + 2.200000 0.840089 1.730920 0.87E-10 0.32E-10 + 2.300000 0.816616 1.101047 0.12E-09 0.20E-10 + 2.400000 0.794546 1.525051 0.15E-09 0.78E-11 + 2.500000 0.774227 1.496993 0.18E-09 0.25E-11 + 2.600000 0.756013 1.126857 0.21E-09 0.20E-10 + 2.700000 0.740246 1.727536 0.24E-09 0.23E-10 + 2.800000 0.727247 1.038393 0.26E-09 0.42E-10 + 2.900000 0.717301 1.600759 0.28E-09 0.59E-10 + 3.000000 0.710636 1.406380 0.30E-09 0.62E-10 + 3.100000 0.707412 1.214353 0.31E-09 0.92E-10 + 3.200000 0.707709 1.704026 0.31E-09 0.87E-10 + 3.300000 0.711520 1.004391 0.30E-09 0.11E-09 + 3.400000 0.718750 1.661225 0.29E-09 0.12E-09 + 3.500000 0.729227 1.310102 0.27E-09 0.11E-09 + 3.600000 0.742712 1.310080 0.24E-09 0.14E-09 + 3.700000 0.758914 1.661237 0.22E-09 0.12E-09 + 3.800000 0.777506 1.004387 0.19E-09 0.14E-09 + 3.900000 0.798144 1.704019 0.15E-09 0.13E-09 + 4.000000 0.820474 1.214374 0.12E-09 0.12E-09 + 4.100000 0.844149 1.406358 0.94E-10 0.14E-09 + 4.200000 0.868832 1.600774 0.65E-10 0.99E-10 + 4.300000 0.894204 1.038382 0.39E-10 0.12E-09 + 4.400000 0.919964 1.727533 0.14E-10 0.96E-10 + 4.500000 0.945834 1.126875 0.89E-11 0.80E-10 + 4.600000 0.971557 1.496974 0.30E-10 0.98E-10 + 4.700000 0.996898 1.525070 0.49E-10 0.49E-10 + 4.800000 1.021641 1.101030 0.67E-10 0.78E-10 + 4.900000 1.045589 1.730922 0.83E-10 0.39E-10 + 5.000000 1.068565 1.056480 0.97E-10 0.32E-10 ------------------------------------------------------ Final Solver Statistics: Steps: nsts = 2501, nstf = 250100 - u error = 0.166E-09, v error = 0.768E-10, total error = 0.130E-09 - Total RHS evals: Fs = 12506, Ff = 1002903 + u error = 0.166E-09, v error = 0.771E-10, total error = 0.130E-09 + Total RHS evals: Fs = 12506, Ff = 1000450 diff --git a/examples/arkode/F2003_serial/ark_kpr_mri_f2003_6_0.005.out b/examples/arkode/F2003_serial/ark_kpr_mri_f2003_6_0.005.out index 865cfee2de..fa764c5633 100644 --- a/examples/arkode/F2003_serial/ark_kpr_mri_f2003_6_0.005.out +++ b/examples/arkode/F2003_serial/ark_kpr_mri_f2003_6_0.005.out @@ -8,59 +8,59 @@ solver: exp-4/exp-3 (MRI-GARK-ERK45a / ERK-3-3) t u v uerr verr ------------------------------------------------------ - 0.000000 1.224745 1.732051 0.00E+00 0.00E+00 - 0.100000 1.223725 1.077464 0.81E-08 0.46E-09 - 0.200000 1.220669 1.551800 0.80E-08 0.90E-09 - 0.300000 1.215594 1.467737 0.79E-08 0.13E-08 - 0.400000 1.208524 1.154583 0.78E-08 0.17E-08 - 0.500000 1.199496 1.721908 0.76E-08 0.20E-08 - 0.600000 1.188557 1.023517 0.74E-08 0.22E-08 - 0.700000 1.175764 1.622751 0.71E-08 0.25E-08 - 0.800000 1.161186 1.374632 0.68E-08 0.27E-08 - 0.900000 1.144904 1.245763 0.65E-08 0.28E-08 - 1.000000 1.127010 1.691839 0.61E-08 0.29E-08 - 1.100000 1.107609 1.000489 0.56E-08 0.30E-08 - 1.200000 1.086821 1.677552 0.51E-08 0.30E-08 - 1.300000 1.064777 1.277775 0.45E-08 0.30E-08 - 1.400000 1.041625 1.342455 0.39E-08 0.30E-08 - 1.500000 1.017531 1.642940 0.32E-08 0.29E-08 - 1.600000 0.992673 1.012112 0.24E-08 0.28E-08 - 1.700000 0.967253 1.714058 0.15E-08 0.27E-08 - 1.800000 0.941488 1.183867 0.61E-09 0.25E-08 - 1.900000 0.915617 1.437465 0.40E-09 0.23E-08 - 2.000000 0.889903 1.577082 0.15E-08 0.20E-08 - 2.100000 0.864625 1.056467 0.27E-08 0.17E-08 - 2.200000 0.840089 1.730920 0.39E-08 0.13E-08 - 2.300000 0.816616 1.101047 0.53E-08 0.90E-09 - 2.400000 0.794546 1.525051 0.67E-08 0.45E-09 - 2.500000 0.774227 1.496993 0.80E-08 0.42E-10 - 2.600000 0.756013 1.126857 0.94E-08 0.57E-09 - 2.700000 0.740246 1.727536 0.11E-07 0.11E-08 - 2.800000 0.727247 1.038393 0.12E-07 0.17E-08 - 2.900000 0.717301 1.600759 0.13E-07 0.23E-08 - 3.000000 0.710636 1.406380 0.14E-07 0.29E-08 - 3.100000 0.707412 1.214353 0.14E-07 0.35E-08 - 3.200000 0.707709 1.704026 0.14E-07 0.40E-08 - 3.300000 0.711520 1.004391 0.14E-07 0.44E-08 - 3.400000 0.718750 1.661225 0.13E-07 0.48E-08 - 3.500000 0.729227 1.310102 0.12E-07 0.52E-08 - 3.600000 0.742712 1.310080 0.11E-07 0.54E-08 - 3.700000 0.758914 1.661237 0.98E-08 0.55E-08 - 3.800000 0.777506 1.004387 0.84E-08 0.55E-08 - 3.900000 0.798144 1.704019 0.70E-08 0.55E-08 - 4.000000 0.820474 1.214374 0.56E-08 0.53E-08 - 4.100000 0.844149 1.406358 0.43E-08 0.51E-08 - 4.200000 0.868832 1.600774 0.30E-08 0.49E-08 - 4.300000 0.894204 1.038382 0.18E-08 0.45E-08 - 4.400000 0.919964 1.727533 0.65E-09 0.42E-08 - 4.500000 0.945834 1.126875 0.39E-09 0.38E-08 - 4.600000 0.971557 1.496974 0.14E-08 0.34E-08 - 4.700000 0.996898 1.525070 0.22E-08 0.29E-08 - 4.800000 1.021641 1.101030 0.30E-08 0.25E-08 - 4.900000 1.045589 1.730922 0.37E-08 0.21E-08 - 5.000000 1.068565 1.056480 0.44E-08 0.16E-08 + 0.000000 1.224745 1.732051 0.00E+00 0.00E+00 + 0.100000 1.223725 1.077464 0.81E-08 0.46E-09 + 0.200000 1.220669 1.551800 0.80E-08 0.90E-09 + 0.300000 1.215594 1.467737 0.79E-08 0.13E-08 + 0.400000 1.208524 1.154583 0.78E-08 0.17E-08 + 0.500000 1.199496 1.721908 0.76E-08 0.20E-08 + 0.600000 1.188557 1.023517 0.74E-08 0.22E-08 + 0.700000 1.175764 1.622751 0.71E-08 0.25E-08 + 0.800000 1.161186 1.374632 0.68E-08 0.27E-08 + 0.900000 1.144904 1.245763 0.65E-08 0.28E-08 + 1.000000 1.127010 1.691839 0.61E-08 0.29E-08 + 1.100000 1.107609 1.000489 0.56E-08 0.30E-08 + 1.200000 1.086821 1.677552 0.51E-08 0.30E-08 + 1.300000 1.064777 1.277775 0.45E-08 0.30E-08 + 1.400000 1.041625 1.342455 0.39E-08 0.30E-08 + 1.500000 1.017531 1.642940 0.32E-08 0.29E-08 + 1.600000 0.992673 1.012112 0.24E-08 0.28E-08 + 1.700000 0.967253 1.714058 0.15E-08 0.27E-08 + 1.800000 0.941488 1.183867 0.61E-09 0.25E-08 + 1.900000 0.915617 1.437465 0.40E-09 0.23E-08 + 2.000000 0.889903 1.577082 0.15E-08 0.20E-08 + 2.100000 0.864625 1.056467 0.27E-08 0.17E-08 + 2.200000 0.840089 1.730920 0.39E-08 0.13E-08 + 2.300000 0.816616 1.101047 0.53E-08 0.90E-09 + 2.400000 0.794546 1.525051 0.67E-08 0.45E-09 + 2.500000 0.774227 1.496993 0.80E-08 0.39E-10 + 2.600000 0.756013 1.126857 0.94E-08 0.57E-09 + 2.700000 0.740246 1.727536 0.11E-07 0.11E-08 + 2.800000 0.727247 1.038393 0.12E-07 0.17E-08 + 2.900000 0.717301 1.600759 0.13E-07 0.23E-08 + 3.000000 0.710636 1.406380 0.14E-07 0.29E-08 + 3.100000 0.707412 1.214353 0.14E-07 0.35E-08 + 3.200000 0.707709 1.704026 0.14E-07 0.40E-08 + 3.300000 0.711520 1.004391 0.14E-07 0.44E-08 + 3.400000 0.718750 1.661225 0.13E-07 0.48E-08 + 3.500000 0.729227 1.310102 0.12E-07 0.52E-08 + 3.600000 0.742712 1.310080 0.11E-07 0.54E-08 + 3.700000 0.758914 1.661237 0.98E-08 0.55E-08 + 3.800000 0.777506 1.004387 0.84E-08 0.55E-08 + 3.900000 0.798144 1.704019 0.70E-08 0.55E-08 + 4.000000 0.820474 1.214374 0.56E-08 0.53E-08 + 4.100000 0.844149 1.406358 0.43E-08 0.51E-08 + 4.200000 0.868832 1.600774 0.30E-08 0.49E-08 + 4.300000 0.894204 1.038382 0.18E-08 0.45E-08 + 4.400000 0.919964 1.727533 0.65E-09 0.42E-08 + 4.500000 0.945834 1.126875 0.39E-09 0.38E-08 + 4.600000 0.971557 1.496974 0.14E-08 0.34E-08 + 4.700000 0.996898 1.525070 0.22E-08 0.29E-08 + 4.800000 1.021641 1.101030 0.30E-08 0.25E-08 + 4.900000 1.045589 1.730922 0.37E-08 0.21E-08 + 5.000000 1.068565 1.056480 0.44E-08 0.16E-08 ------------------------------------------------------ Final Solver Statistics: Steps: nsts = 1001, nstf = 100100 - u error = 0.757E-08, v error = 0.324E-08, total error = 0.582E-08 - Total RHS evals: Fs = 5006, Ff = 301303 + u error = 0.757E-08, v error = 0.324E-08, total error = 0.582E-08 + Total RHS evals: Fs = 5006, Ff = 300350 diff --git a/examples/arkode/F2003_serial/ark_kpr_mri_f2003_7_0.001.out b/examples/arkode/F2003_serial/ark_kpr_mri_f2003_7_0.001.out index 003c14af6c..925d9c3474 100644 --- a/examples/arkode/F2003_serial/ark_kpr_mri_f2003_7_0.001.out +++ b/examples/arkode/F2003_serial/ark_kpr_mri_f2003_7_0.001.out @@ -9,62 +9,62 @@ reltol: 0.1000E-08 abstol: 0.1000E-10 t u v uerr verr ------------------------------------------------------ - 0.000000 1.224745 1.732051 0.00E+00 0.00E+00 - 0.100000 1.223725 1.077464 0.40E-09 0.57E-10 - 0.200000 1.220669 1.551800 0.41E-09 0.11E-09 - 0.300000 1.215594 1.467737 0.39E-09 0.16E-09 - 0.400000 1.208524 1.154583 0.39E-09 0.20E-09 - 0.500000 1.199496 1.721908 0.38E-09 0.24E-09 - 0.600000 1.188557 1.023517 0.38E-09 0.27E-09 - 0.700000 1.175764 1.622751 0.35E-09 0.30E-09 - 0.800000 1.161186 1.374632 0.34E-09 0.32E-09 - 0.900000 1.144904 1.245763 0.32E-09 0.34E-09 - 1.000000 1.127010 1.691839 0.30E-09 0.36E-09 - 1.100000 1.107609 1.000489 0.28E-09 0.37E-09 - 1.200000 1.086821 1.677552 0.25E-09 0.37E-09 - 1.300000 1.064777 1.277775 0.23E-09 0.37E-09 - 1.400000 1.041625 1.342455 0.20E-09 0.36E-09 - 1.500000 1.017531 1.642940 0.16E-09 0.35E-09 - 1.600000 0.992673 1.012112 0.12E-09 0.34E-09 - 1.700000 0.967253 1.714058 0.78E-10 0.32E-09 - 1.800000 0.941488 1.183867 0.35E-10 0.30E-09 - 1.900000 0.915617 1.437465 0.17E-10 0.27E-09 - 2.000000 0.889903 1.577082 0.70E-10 0.23E-09 - 2.100000 0.864625 1.056467 0.13E-09 0.20E-09 - 2.200000 0.840089 1.730920 0.20E-09 0.15E-09 - 2.300000 0.816616 1.101047 0.26E-09 0.10E-09 - 2.400000 0.794546 1.525051 0.33E-09 0.45E-10 - 2.500000 0.774227 1.496993 0.40E-09 0.20E-10 - 2.600000 0.756013 1.126857 0.47E-09 0.82E-10 - 2.700000 0.740246 1.727536 0.54E-09 0.15E-09 - 2.800000 0.727247 1.038393 0.59E-09 0.22E-09 - 2.900000 0.717301 1.600759 0.75E-09 0.30E-09 - 3.000000 0.710636 1.406380 0.67E-09 0.37E-09 - 3.100000 0.707412 1.214353 0.69E-09 0.43E-09 - 3.200000 0.707709 1.704026 0.70E-09 0.50E-09 - 3.300000 0.711520 1.004391 0.68E-09 0.55E-09 - 3.400000 0.718750 1.661225 0.65E-09 0.60E-09 - 3.500000 0.729227 1.310102 0.60E-09 0.63E-09 - 3.600000 0.742712 1.310080 0.55E-09 0.65E-09 - 3.700000 0.758914 1.661237 0.50E-09 0.68E-09 - 3.800000 0.777506 1.004387 0.42E-09 0.67E-09 - 3.900000 0.798144 1.704019 0.35E-09 0.67E-09 - 4.000000 0.820474 1.214374 0.29E-09 0.65E-09 - 4.100000 0.844149 1.406358 0.26E-09 0.62E-09 - 4.200000 0.868832 1.600774 0.15E-09 0.58E-09 - 4.300000 0.894204 1.038382 0.92E-10 0.56E-09 - 4.400000 0.919964 1.727533 0.36E-10 0.49E-09 - 4.500000 0.945834 1.126875 0.14E-10 0.47E-09 - 4.600000 0.971557 1.496974 0.63E-10 0.40E-09 - 4.700000 0.996898 1.525070 0.10E-09 0.35E-09 - 4.800000 1.021641 1.101030 0.15E-09 0.31E-09 - 4.900000 1.045589 1.730922 0.19E-09 0.23E-09 - 5.000000 1.068565 1.056480 0.39E-10 0.21E-09 + 0.000000 1.224745 1.732051 0.00E+00 0.00E+00 + 0.100000 1.223725 1.077464 0.40E-09 0.57E-10 + 0.200000 1.220669 1.551800 0.41E-09 0.11E-09 + 0.300000 1.215594 1.467737 0.39E-09 0.16E-09 + 0.400000 1.208524 1.154583 0.39E-09 0.20E-09 + 0.500000 1.199496 1.721908 0.38E-09 0.24E-09 + 0.600000 1.188557 1.023517 0.38E-09 0.27E-09 + 0.700000 1.175764 1.622751 0.35E-09 0.30E-09 + 0.800000 1.161186 1.374632 0.34E-09 0.32E-09 + 0.900000 1.144904 1.245763 0.32E-09 0.34E-09 + 1.000000 1.127010 1.691839 0.30E-09 0.36E-09 + 1.100000 1.107609 1.000489 0.28E-09 0.37E-09 + 1.200000 1.086821 1.677552 0.25E-09 0.37E-09 + 1.300000 1.064777 1.277775 0.23E-09 0.37E-09 + 1.400000 1.041625 1.342455 0.20E-09 0.36E-09 + 1.500000 1.017531 1.642940 0.16E-09 0.35E-09 + 1.600000 0.992673 1.012112 0.12E-09 0.34E-09 + 1.700000 0.967253 1.714058 0.78E-10 0.32E-09 + 1.800000 0.941488 1.183867 0.35E-10 0.30E-09 + 1.900000 0.915617 1.437465 0.17E-10 0.27E-09 + 2.000000 0.889903 1.577082 0.70E-10 0.23E-09 + 2.100000 0.864625 1.056467 0.13E-09 0.20E-09 + 2.200000 0.840089 1.730920 0.20E-09 0.15E-09 + 2.300000 0.816616 1.101047 0.26E-09 0.10E-09 + 2.400000 0.794546 1.525051 0.33E-09 0.45E-10 + 2.500000 0.774227 1.496993 0.40E-09 0.20E-10 + 2.600000 0.756013 1.126857 0.47E-09 0.82E-10 + 2.700000 0.740246 1.727536 0.54E-09 0.15E-09 + 2.800000 0.727247 1.038393 0.59E-09 0.22E-09 + 2.900000 0.717301 1.600759 0.75E-09 0.30E-09 + 3.000000 0.710636 1.406380 0.67E-09 0.37E-09 + 3.100000 0.707412 1.214353 0.69E-09 0.43E-09 + 3.200000 0.707709 1.704026 0.70E-09 0.50E-09 + 3.300000 0.711520 1.004391 0.68E-09 0.55E-09 + 3.400000 0.718750 1.661225 0.65E-09 0.60E-09 + 3.500000 0.729227 1.310102 0.60E-09 0.63E-09 + 3.600000 0.742712 1.310080 0.55E-09 0.65E-09 + 3.700000 0.758914 1.661237 0.50E-09 0.68E-09 + 3.800000 0.777506 1.004387 0.42E-09 0.67E-09 + 3.900000 0.798144 1.704019 0.35E-09 0.67E-09 + 4.000000 0.820474 1.214374 0.29E-09 0.65E-09 + 4.100000 0.844149 1.406358 0.26E-09 0.62E-09 + 4.200000 0.868832 1.600774 0.15E-09 0.58E-09 + 4.300000 0.894204 1.038382 0.92E-10 0.56E-09 + 4.400000 0.919964 1.727533 0.36E-10 0.49E-09 + 4.500000 0.945834 1.126875 0.14E-10 0.47E-09 + 4.600000 0.971557 1.496974 0.63E-10 0.40E-09 + 4.700000 0.996898 1.525070 0.10E-09 0.35E-09 + 4.800000 1.021641 1.101030 0.15E-09 0.31E-09 + 4.900000 1.045589 1.730922 0.19E-09 0.23E-09 + 5.000000 1.068565 1.056480 0.39E-10 0.21E-09 ------------------------------------------------------ Final Solver Statistics: Steps: nsts = 5000, nstf = 510000 - u error = 0.380E-09, v error = 0.394E-09, total error = 0.387E-09 - Total RHS evals: Fs = 45313, Ff = 1550001 + u error = 0.380E-09, v error = 0.394E-09, total error = 0.387E-09 + Total RHS evals: Fs = 45313, Ff = 1530050 Slow Newton iters = 30312 Slow Newton conv fails = 0 Slow Jacobian evals = 250 diff --git a/examples/arkode/F2003_serial/ark_kpr_mri_f2003_8_0.001.out b/examples/arkode/F2003_serial/ark_kpr_mri_f2003_8_0.001.out index f008ab179f..bd101638aa 100644 --- a/examples/arkode/F2003_serial/ark_kpr_mri_f2003_8_0.001.out +++ b/examples/arkode/F2003_serial/ark_kpr_mri_f2003_8_0.001.out @@ -9,62 +9,62 @@ reltol: 0.1000E-08 abstol: 0.1000E-10 t u v uerr verr ------------------------------------------------------ - 0.000000 1.224745 1.732051 0.00E+00 0.00E+00 - 0.100000 1.223725 1.077464 0.28E-09 0.26E-10 - 0.200000 1.220669 1.551800 0.18E-09 0.48E-10 - 0.300000 1.215594 1.467737 0.19E-09 0.69E-10 - 0.400000 1.208524 1.154583 0.18E-09 0.88E-10 - 0.500000 1.199496 1.721908 0.18E-09 0.10E-09 - 0.600000 1.188557 1.023517 0.17E-09 0.12E-09 - 0.700000 1.175764 1.622751 0.17E-09 0.13E-09 - 0.800000 1.161186 1.374632 0.16E-09 0.14E-09 - 0.900000 1.144904 1.245763 0.15E-09 0.15E-09 - 1.000000 1.127010 1.691839 0.14E-09 0.15E-09 - 1.100000 1.107609 1.000489 0.13E-09 0.15E-09 - 1.200000 1.086821 1.677552 0.12E-09 0.16E-09 - 1.300000 1.064777 1.277775 0.11E-09 0.15E-09 - 1.400000 1.041625 1.342455 0.91E-10 0.15E-09 - 1.500000 1.017531 1.642940 0.70E-10 0.15E-09 - 1.600000 0.992673 1.012112 0.53E-10 0.14E-09 - 1.700000 0.967253 1.714058 0.32E-10 0.14E-09 - 1.800000 0.941488 1.183867 0.16E-10 0.12E-09 - 1.900000 0.915617 1.437465 0.11E-10 0.11E-09 - 2.000000 0.889903 1.577082 0.36E-10 0.99E-10 - 2.100000 0.864625 1.056467 0.66E-10 0.79E-10 - 2.200000 0.840089 1.730920 0.10E-09 0.64E-10 - 2.300000 0.816616 1.101047 0.13E-09 0.38E-10 - 2.400000 0.794546 1.525051 0.16E-09 0.17E-10 - 2.500000 0.774227 1.496993 0.19E-09 0.94E-11 - 2.600000 0.756013 1.126857 0.22E-09 0.40E-10 - 2.700000 0.740246 1.727536 0.26E-09 0.65E-10 - 2.800000 0.727247 1.038393 0.28E-09 0.10E-09 - 2.900000 0.717301 1.600759 0.30E-09 0.13E-09 - 3.000000 0.710636 1.406380 0.32E-09 0.16E-09 - 3.100000 0.707412 1.214353 0.33E-09 0.19E-09 - 3.200000 0.707709 1.704026 0.33E-09 0.21E-09 - 3.300000 0.711520 1.004391 0.32E-09 0.24E-09 - 3.400000 0.718750 1.661225 0.30E-09 0.25E-09 - 3.500000 0.729227 1.310102 0.29E-09 0.27E-09 - 3.600000 0.742712 1.310080 0.26E-09 0.28E-09 - 3.700000 0.758914 1.661237 0.22E-09 0.28E-09 - 3.800000 0.777506 1.004387 0.19E-09 0.29E-09 - 3.900000 0.798144 1.704019 0.16E-09 0.28E-09 - 4.000000 0.820474 1.214374 0.13E-09 0.27E-09 - 4.100000 0.844149 1.406358 0.97E-10 0.27E-09 - 4.200000 0.868832 1.600774 0.66E-10 0.26E-09 - 4.300000 0.894204 1.038382 0.38E-10 0.22E-09 - 4.400000 0.919964 1.727533 0.94E-11 0.23E-09 - 4.500000 0.945834 1.126875 0.10E-10 0.18E-09 - 4.600000 0.971557 1.496974 0.33E-10 0.17E-09 - 4.700000 0.996898 1.525070 0.50E-10 0.15E-09 - 4.800000 1.021641 1.101030 0.72E-10 0.11E-09 - 4.900000 1.045589 1.730922 0.93E-10 0.11E-09 - 5.000000 1.068565 1.056480 0.11E-09 0.64E-10 + 0.000000 1.224745 1.732051 0.00E+00 0.00E+00 + 0.100000 1.223725 1.077464 0.28E-09 0.26E-10 + 0.200000 1.220669 1.551800 0.18E-09 0.48E-10 + 0.300000 1.215594 1.467737 0.19E-09 0.69E-10 + 0.400000 1.208524 1.154583 0.18E-09 0.88E-10 + 0.500000 1.199496 1.721908 0.18E-09 0.10E-09 + 0.600000 1.188557 1.023517 0.17E-09 0.12E-09 + 0.700000 1.175764 1.622751 0.17E-09 0.13E-09 + 0.800000 1.161186 1.374632 0.16E-09 0.14E-09 + 0.900000 1.144904 1.245763 0.15E-09 0.15E-09 + 1.000000 1.127010 1.691839 0.14E-09 0.15E-09 + 1.100000 1.107609 1.000489 0.13E-09 0.15E-09 + 1.200000 1.086821 1.677552 0.12E-09 0.16E-09 + 1.300000 1.064777 1.277775 0.11E-09 0.15E-09 + 1.400000 1.041625 1.342455 0.91E-10 0.15E-09 + 1.500000 1.017531 1.642940 0.70E-10 0.15E-09 + 1.600000 0.992673 1.012112 0.53E-10 0.14E-09 + 1.700000 0.967253 1.714058 0.32E-10 0.14E-09 + 1.800000 0.941488 1.183867 0.16E-10 0.12E-09 + 1.900000 0.915617 1.437465 0.11E-10 0.11E-09 + 2.000000 0.889903 1.577082 0.36E-10 0.99E-10 + 2.100000 0.864625 1.056467 0.66E-10 0.79E-10 + 2.200000 0.840089 1.730920 0.10E-09 0.64E-10 + 2.300000 0.816616 1.101047 0.13E-09 0.38E-10 + 2.400000 0.794546 1.525051 0.16E-09 0.17E-10 + 2.500000 0.774227 1.496993 0.19E-09 0.94E-11 + 2.600000 0.756013 1.126857 0.22E-09 0.40E-10 + 2.700000 0.740246 1.727536 0.26E-09 0.65E-10 + 2.800000 0.727247 1.038393 0.28E-09 0.10E-09 + 2.900000 0.717301 1.600759 0.30E-09 0.13E-09 + 3.000000 0.710636 1.406380 0.32E-09 0.16E-09 + 3.100000 0.707412 1.214353 0.33E-09 0.19E-09 + 3.200000 0.707709 1.704026 0.33E-09 0.21E-09 + 3.300000 0.711520 1.004391 0.32E-09 0.24E-09 + 3.400000 0.718750 1.661225 0.30E-09 0.25E-09 + 3.500000 0.729227 1.310102 0.29E-09 0.27E-09 + 3.600000 0.742712 1.310080 0.26E-09 0.28E-09 + 3.700000 0.758914 1.661237 0.22E-09 0.28E-09 + 3.800000 0.777506 1.004387 0.19E-09 0.29E-09 + 3.900000 0.798144 1.704019 0.16E-09 0.28E-09 + 4.000000 0.820474 1.214374 0.13E-09 0.27E-09 + 4.100000 0.844149 1.406358 0.97E-10 0.27E-09 + 4.200000 0.868832 1.600774 0.66E-10 0.26E-09 + 4.300000 0.894204 1.038382 0.38E-10 0.22E-09 + 4.400000 0.919964 1.727533 0.94E-11 0.23E-09 + 4.500000 0.945834 1.126875 0.10E-10 0.18E-09 + 4.600000 0.971557 1.496974 0.34E-10 0.17E-09 + 4.700000 0.996898 1.525070 0.50E-10 0.15E-09 + 4.800000 1.021641 1.101030 0.72E-10 0.11E-09 + 4.900000 1.045589 1.730922 0.93E-10 0.11E-09 + 5.000000 1.068565 1.056480 0.11E-09 0.64E-10 ------------------------------------------------------ Final Solver Statistics: Steps: nsts = 5000, nstf = 510000 - u error = 0.179E-09, v error = 0.168E-09, total error = 0.174E-09 - Total RHS evals: Fse = 20001, Fsi = 50342, Ff = 1550001 + u error = 0.179E-09, v error = 0.168E-09, total error = 0.174E-09 + Total RHS evals: Fse = 20001, Fsi = 50342, Ff = 1530050 Slow Newton iters = 30341 Slow Newton conv fails = 0 Slow Jacobian evals = 250 diff --git a/examples/arkode/F2003_serial/ark_kpr_mri_f2003_9_0.001.out b/examples/arkode/F2003_serial/ark_kpr_mri_f2003_9_0.001.out index 0c898eea9d..6e504b619b 100644 --- a/examples/arkode/F2003_serial/ark_kpr_mri_f2003_9_0.001.out +++ b/examples/arkode/F2003_serial/ark_kpr_mri_f2003_9_0.001.out @@ -9,62 +9,62 @@ reltol: 0.1000E-11 abstol: 0.1000E-13 t u v uerr verr ------------------------------------------------------ - 0.000000 1.224745 1.732051 0.00E+00 0.00E+00 - 0.100000 1.223725 1.077464 0.16E-10 0.64E-12 - 0.200000 1.220669 1.551800 0.16E-10 0.68E-12 - 0.300000 1.215594 1.467737 0.15E-10 0.96E-12 - 0.400000 1.208524 1.154583 0.15E-10 0.92E-12 - 0.500000 1.199496 1.721908 0.16E-10 0.17E-11 - 0.600000 1.188557 1.023517 0.15E-10 0.34E-11 - 0.700000 1.175764 1.622751 0.14E-10 0.22E-11 - 0.800000 1.161186 1.374632 0.12E-10 0.28E-11 - 0.900000 1.144904 1.245763 0.11E-10 0.31E-11 - 1.000000 1.127010 1.691839 0.13E-10 0.22E-11 - 1.100000 1.107609 1.000489 0.11E-10 0.20E-11 - 1.200000 1.086821 1.677552 0.95E-11 0.25E-11 - 1.300000 1.064777 1.277775 0.76E-11 0.81E-13 - 1.400000 1.041625 1.342455 0.52E-11 0.62E-12 - 1.500000 1.017531 1.642940 0.60E-11 0.26E-11 - 1.600000 0.992673 1.012112 0.38E-11 0.14E-11 - 1.700000 0.967253 1.714058 0.33E-11 0.30E-11 - 1.800000 0.941488 1.183867 0.23E-12 0.36E-12 - 1.900000 0.915617 1.437465 0.33E-11 0.12E-11 - 2.000000 0.889903 1.577082 0.66E-11 0.19E-11 - 2.100000 0.864625 1.056467 0.79E-11 0.16E-11 - 2.200000 0.840089 1.730920 0.67E-11 0.25E-11 - 2.300000 0.816616 1.101047 0.12E-10 0.18E-11 - 2.400000 0.794546 1.525051 0.15E-10 0.57E-12 - 2.500000 0.774227 1.496993 0.18E-10 0.67E-13 - 2.600000 0.756013 1.126857 0.22E-10 0.27E-11 - 2.700000 0.740246 1.727536 0.20E-10 0.73E-12 - 2.800000 0.727247 1.038393 0.25E-10 0.40E-11 - 2.900000 0.717301 1.600759 0.27E-10 0.93E-12 - 3.000000 0.710636 1.406380 0.28E-10 0.26E-11 - 3.100000 0.707412 1.214353 0.29E-10 0.42E-11 - 3.200000 0.707709 1.704026 0.28E-10 0.15E-11 - 3.300000 0.711520 1.004391 0.28E-10 0.63E-11 - 3.400000 0.718750 1.661225 0.26E-10 0.24E-11 - 3.500000 0.729227 1.310102 0.24E-10 0.48E-11 - 3.600000 0.742712 1.310080 0.21E-10 0.50E-11 - 3.700000 0.758914 1.661237 0.20E-10 0.28E-11 - 3.800000 0.777506 1.004387 0.16E-10 0.70E-11 - 3.900000 0.798144 1.704019 0.14E-10 0.25E-11 - 4.000000 0.820474 1.214374 0.10E-10 0.54E-11 - 4.100000 0.844149 1.406358 0.65E-11 0.83E-11 - 4.200000 0.868832 1.600774 0.36E-11 0.11E-10 - 4.300000 0.894204 1.038382 0.16E-11 0.25E-12 - 4.400000 0.919964 1.727533 0.23E-11 0.12E-10 - 4.500000 0.945834 1.126875 0.23E-11 0.75E-12 - 4.600000 0.971557 1.496974 0.52E-11 0.69E-11 - 4.700000 0.996898 1.525070 0.85E-11 0.69E-11 - 4.800000 1.021641 1.101030 0.85E-11 0.16E-11 - 4.900000 1.045589 1.730922 0.61E-11 0.95E-11 - 5.000000 1.068565 1.056480 0.10E-10 0.34E-11 + 0.000000 1.224745 1.732051 0.00E+00 0.00E+00 + 0.100000 1.223725 1.077464 0.16E-10 0.64E-12 + 0.200000 1.220669 1.551800 0.16E-10 0.68E-12 + 0.300000 1.215594 1.467737 0.15E-10 0.96E-12 + 0.400000 1.208524 1.154583 0.15E-10 0.92E-12 + 0.500000 1.199496 1.721908 0.16E-10 0.17E-11 + 0.600000 1.188557 1.023517 0.15E-10 0.34E-11 + 0.700000 1.175764 1.622751 0.14E-10 0.22E-11 + 0.800000 1.161186 1.374632 0.12E-10 0.28E-11 + 0.900000 1.144904 1.245763 0.11E-10 0.31E-11 + 1.000000 1.127010 1.691839 0.13E-10 0.22E-11 + 1.100000 1.107609 1.000489 0.11E-10 0.21E-11 + 1.200000 1.086821 1.677552 0.95E-11 0.19E-11 + 1.300000 1.064777 1.277775 0.76E-11 0.19E-11 + 1.400000 1.041625 1.342455 0.52E-11 0.26E-11 + 1.500000 1.017531 1.642940 0.60E-11 0.58E-11 + 1.600000 0.992673 1.012112 0.38E-11 0.34E-11 + 1.700000 0.967253 1.714058 0.33E-11 0.27E-11 + 1.800000 0.941488 1.183867 0.24E-12 0.38E-11 + 1.900000 0.915617 1.437465 0.33E-11 0.58E-11 + 2.000000 0.889903 1.577082 0.66E-11 0.89E-11 + 2.100000 0.864625 1.056467 0.79E-11 0.74E-11 + 2.200000 0.840089 1.730920 0.67E-11 0.45E-11 + 2.300000 0.816616 1.101047 0.12E-10 0.30E-11 + 2.400000 0.794546 1.525051 0.15E-10 0.89E-11 + 2.500000 0.774227 1.496993 0.18E-10 0.11E-10 + 2.600000 0.756013 1.126857 0.22E-10 0.14E-10 + 2.700000 0.740246 1.727536 0.20E-10 0.69E-11 + 2.800000 0.727247 1.038393 0.25E-10 0.78E-12 + 2.900000 0.717301 1.600759 0.27E-10 0.11E-10 + 3.000000 0.710636 1.406380 0.28E-10 0.11E-10 + 3.100000 0.707412 1.214353 0.29E-10 0.20E-10 + 3.200000 0.707709 1.704026 0.28E-10 0.97E-11 + 3.300000 0.711520 1.004391 0.28E-10 0.71E-11 + 3.400000 0.718750 1.661225 0.26E-10 0.11E-10 + 3.500000 0.729227 1.310102 0.24E-10 0.11E-10 + 3.600000 0.742712 1.310080 0.21E-10 0.26E-10 + 3.700000 0.758914 1.661237 0.20E-10 0.14E-10 + 3.800000 0.777506 1.004387 0.16E-10 0.14E-10 + 3.900000 0.798144 1.704019 0.14E-10 0.60E-11 + 4.000000 0.820474 1.214374 0.10E-10 0.11E-10 + 4.100000 0.844149 1.406358 0.65E-11 0.30E-10 + 4.200000 0.868832 1.600774 0.36E-11 0.50E-11 + 4.300000 0.894204 1.038382 0.16E-11 0.10E-10 + 4.400000 0.919964 1.727533 0.23E-11 0.11E-10 + 4.500000 0.945834 1.126875 0.23E-11 0.55E-11 + 4.600000 0.971557 1.496974 0.52E-11 0.15E-10 + 4.700000 0.996898 1.525070 0.85E-11 0.77E-12 + 4.800000 1.021641 1.101030 0.85E-11 0.19E-11 + 4.900000 1.045589 1.730922 0.61E-11 0.88E-11 + 5.000000 1.068565 1.056480 0.10E-10 0.34E-11 ------------------------------------------------------ Final Solver Statistics: Steps: nsts = 5000, nstf = 510000 - u error = 0.153E-10, v error = 0.419E-11, total error = 0.112E-10 - Total RHS evals: Fse = 30001, Fsi = 82555, Ff = 2070001 + u error = 0.153E-10, v error = 0.950E-11, total error = 0.127E-10 + Total RHS evals: Fse = 30001, Fsi = 82555, Ff = 2040050 Slow Newton iters = 52554 Slow Newton conv fails = 0 Slow Jacobian evals = 250 diff --git a/examples/nvector/test_nvector.c b/examples/nvector/test_nvector.c index ea25cd569a..76cf153945 100644 --- a/examples/nvector/test_nvector.c +++ b/examples/nvector/test_nvector.c @@ -378,7 +378,7 @@ int Test_N_VGetArrayPointer(N_Vector W, sunindextype local_length, int myid) start_time = get_time(); Wdata = N_VGetArrayPointer(W); stop_time = get_time(); - Wdata++; Wdata=NULL; /* Do something with pointer to surpress warning */ + Wdata[0] = ONE; /* Do something with pointer to surpress warning */ /* check vector data */ if (!has_data(W)) { diff --git a/include/arkode/arkode_butcher.h b/include/arkode/arkode_butcher.h index 1c842ebd40..6f3f5ae8ba 100644 --- a/include/arkode/arkode_butcher.h +++ b/include/arkode/arkode_butcher.h @@ -60,6 +60,7 @@ SUNDIALS_EXPORT void ARKodeButcherTable_Space(ARKodeButcherTable B, SUNDIALS_EXPORT void ARKodeButcherTable_Free(ARKodeButcherTable B); SUNDIALS_EXPORT void ARKodeButcherTable_Write(ARKodeButcherTable B, FILE *outfile); +SUNDIALS_EXPORT sunbooleantype ARKodeButcherTable_IsStifflyAccurate(ARKodeButcherTable B); SUNDIALS_EXPORT int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int *q, int *p, FILE *outfile); SUNDIALS_EXPORT int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, diff --git a/scripts/updateOutFiles.py b/scripts/updateOutFiles.py index dfcca35c3f..fd09a4edaf 100755 --- a/scripts/updateOutFiles.py +++ b/scripts/updateOutFiles.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ----------------------------------------------------------------------------- # Programmer(s): David J. Gardner @ LLNL # ----------------------------------------------------------------------------- @@ -15,7 +15,7 @@ # Script to update example output files for failed tests # # Example usage: -# $ ./updateOutFiles.py sundials/build sundials/examples +# $ ./updateOutFiles.py ../build ../. # ----------------------------------------------------------------------------- # ----------------------------------------------------------------------------- @@ -28,13 +28,15 @@ def main(): parser = argparse.ArgumentParser(description='Update output files') - parser.add_argument('build', type=str, - help='Full path to build directory to read from') - parser.add_argument('examples', type=str, - help='Full path to examples directory to write to') + parser.add_argument('source', type=str, + help='Full path of build directory to read files from') + parser.add_argument('destination', type=str, + help='Full path of sundials location to write files to') parser.add_argument('--all','-a', action='store_true', help='Update all output files') - parser.add_argument('--verbose','-v', action='store_true', + parser.add_argument('--copy','-c', action='store_true', + help='Copy file to destination if not found') + parser.add_argument('--verbose','-v', action='count', default=0, help='Enable verbose output') @@ -42,18 +44,18 @@ def main(): args = parser.parse_args() # check inputs - if (not os.path.isdir(args.examples)): - print("Error: could not find {}".format(args.examples)) + if (not os.path.isdir(args.source)): + print(f"Error: could not find {args.source}") return -1 - if (not os.path.isdir(args.build)): - print("Error: could not find {}".format(args.build)) + if (not os.path.isdir(args.destination)): + print(f"Error: could not find {args.destination}") return -1 # check that the output directory exists - output = os.path.join(args.build, "Testing", "output") + output = os.path.join(args.source, "Testing", "output") if (not os.path.isdir(output)): - print("Error: could not find {}".format(output)) + print(f"Error: could not find {output}") return -1 # create a list of all test run or just the failed tests @@ -65,7 +67,7 @@ def main(): if f.endswith(".out"): tests.append(f) else: - failed = os.path.join(args.build, "Testing", "Temporary", "LastTestsFailed.log") + failed = os.path.join(args.source, "Testing", "Temporary", "LastTestsFailed.log") # extract test names from list and append .out with open(failed, 'r') as f: @@ -74,17 +76,35 @@ def main(): # if failed tests were found update the output files if tests: + paths = [os.path.join(args.destination, "examples"), + os.path.join(args.destination, "test", "unit_tests"), + args.destination] for t in tests: + if (args.verbose > 0): + print(f"Searching for {t}") found = False - for root, dirs, files in os.walk(args.examples): - if t in files: - if (args.verbose): - print("Updating: {}".format(t)) - shutil.copy(os.path.join(output, t), os.path.join(root, t)) - found = True + for p in paths: + if (args.verbose == 2): + print(f" Looking in {p}") + for root, dirs, files in os.walk(p): + if (args.verbose == 3): + print(f" Looking in {root}") + if t in files: + if (args.verbose == 1): + print(f" Found file in {root}") + if (args.verbose > 1): + print(" Found file") + shutil.copy(os.path.join(output, t), os.path.join(root, t)) + found = True + break + if found: break if not found: - print("Warning: did not find {}".format(t)) + if args.copy: + print(f"Warning: did not find {t}, copying to {args.destination}") + shutil.copy(os.path.join(output, t), os.path.join(args.destination, t)) + else: + print(f"Warning: did not find {t}") # ----------------------------------------------------------------------------- # run the main routine diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 601abca7ae..d86cf7021c 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -135,13 +135,14 @@ ARKodeMem arkCreate(SUNContext sunctx) /* Initialize the interpolation structure to NULL */ ark_mem->interp = NULL; + ark_mem->interp_type = -1; /* Initially, rwt should point to ewt */ ark_mem->rwt_is_ewt = SUNTRUE; - /* Indicate that evaluation of the full RHS is not required after each step, - this flag is updated to SUNTRUE by the interpolation module initialization - function and/or the stepper initialization function in arkInitialSetup */ + /* Indicate that calling the full RHS function is not required, this flag is + updated to SUNTRUE by the interpolation module initialization function + and/or the stepper initialization function in arkInitialSetup */ ark_mem->call_fullrhs = SUNFALSE; /* Indicate that the problem needs to be initialized */ @@ -286,6 +287,7 @@ int arkResize(ARKodeMem ark_mem, N_Vector y0, realtype hscale, /* Copy y0 into ark_yn to set the current solution */ N_VScale(ONE, y0, ark_mem->yn); + ark_mem->fn_is_current = SUNFALSE; /* Disable constraints */ ark_mem->constraintsSet = SUNFALSE; @@ -852,11 +854,11 @@ int arkEvolve(ARKodeMem ark_mem, realtype tout, N_Vector yout, >0 => step encountered recoverable failure; reduce step if possible <0 => step encountered unrecoverable failure */ kflag = ark_mem->step((void*) ark_mem, &dsm, &nflag); - if (kflag < 0) break; + if (kflag < 0) break; /* handle solver convergence failures */ kflag = arkCheckConvergence(ark_mem, &nflag, &ncf); - if (kflag < 0) break; + if (kflag < 0) break; /* Perform relaxation: - computes relaxation parameter @@ -979,7 +981,14 @@ int arkEvolve(ARKodeMem ark_mem, realtype tout, N_Vector yout, SUNRabs(tout - ark_mem->tstop) <= troundoff) { if (ark_mem->tstopinterp) { - (void) arkGetDky(ark_mem, ark_mem->tstop, 0, yout); + retval = arkGetDky(ark_mem, ark_mem->tstop, 0, yout); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, retval, "ARKODE", "arkEvolve", + MSG_ARK_INTERPOLATION_FAIL, ark_mem->tstop); + istate = retval; + break; + } } else { N_VScale(ONE, ark_mem->yn, yout); } @@ -1000,11 +1009,19 @@ int arkEvolve(ARKodeMem ark_mem, realtype tout, N_Vector yout, /* In NORMAL mode, check if tout reached */ if ( (itask == ARK_NORMAL) && - (ark_mem->tcur-tout)*ark_mem->h >= ZERO ) { - istate = ARK_SUCCESS; + (ark_mem->tcur-tout)*ark_mem->h >= ZERO ) + { + retval = arkGetDky(ark_mem, tout, 0, yout); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, retval, "ARKODE", "arkEvolve", + MSG_ARK_INTERPOLATION_FAIL, tout); + istate = retval; + break; + } ark_mem->tretlast = *tret = tout; - (void) arkGetDky(ark_mem, tout, 0, yout); ark_mem->next_h = ark_mem->hprime; + istate = ARK_SUCCESS; break; } @@ -1118,6 +1135,7 @@ void arkFree(void **arkode_mem) if (ark_mem->interp != NULL) { arkInterpFree(ark_mem, ark_mem->interp); ark_mem->interp = NULL; + ark_mem->interp_type = -1; } /* free the root-finding module */ @@ -1305,11 +1323,15 @@ int arkInit(ARKodeMem ark_mem, realtype t0, N_Vector y0, } /* Create default Hermite interpolation module */ - ark_mem->interp = arkInterpCreate_Hermite(ark_mem, ARK_INTERP_MAX_DEGREE); - if (ark_mem->interp == NULL) { - arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", "arkInit", - "Unable to allocate interpolation module"); - return(ARK_MEM_FAIL); + if (!(ark_mem->interp)) + { + ark_mem->interp = arkInterpCreate_Hermite(ark_mem, ARK_INTERP_MAX_DEGREE); + if (ark_mem->interp == NULL) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", "arkInit", + "Unable to allocate interpolation module"); + return(ARK_MEM_FAIL); + } + ark_mem->interp_type = ARK_INTERP_HERMITE; } /* All allocations are complete */ @@ -1325,6 +1347,7 @@ int arkInit(ARKodeMem ark_mem, realtype t0, N_Vector y0, /* Initialize yn */ N_VScale(ONE, y0, ark_mem->yn); + ark_mem->fn_is_current = SUNFALSE; /* Clear any previous 'tstop' */ ark_mem->tstopset = SUNFALSE; @@ -1358,9 +1381,9 @@ int arkInit(ARKodeMem ark_mem, realtype t0, N_Vector y0, ark_mem->hadapt_mem->hhist[0] = ZERO; ark_mem->hadapt_mem->hhist[1] = ZERO; - /* Indicate that evaluation of the full RHS is not required after each step, - this flag is updated to SUNTRUE by the interpolation module initialization - function and/or the stepper initialization function in arkInitialSetup */ + /* Indicate that calling the full RHS function is not required, this flag is + updated to SUNTRUE by the interpolation module initialization function + and/or the stepper initialization function in arkInitialSetup */ ark_mem->call_fullrhs = SUNFALSE; /* Indicate that initialization has not been done before */ @@ -1490,8 +1513,7 @@ booleantype arkCheckTimestepper(ARKodeMem ark_mem) { if ( (ark_mem->step_init == NULL) || (ark_mem->step == NULL) || - (ark_mem->step_mem == NULL) || - (ark_mem->step_fullrhs == NULL) ) + (ark_mem->step_mem == NULL) ) return(SUNFALSE); return(SUNTRUE); } @@ -1697,10 +1719,6 @@ booleantype arkAllocVectors(ARKodeMem ark_mem, N_Vector tmpl) if (!arkAllocVec(ark_mem, tmpl, &ark_mem->yn)) return(SUNFALSE); - /* Allocate fn if needed */ - if (!arkAllocVec(ark_mem, tmpl, &ark_mem->fn)) - return(SUNFALSE); - /* Allocate tempv1 if needed */ if (!arkAllocVec(ark_mem, tmpl, &ark_mem->tempv1)) return(SUNFALSE); @@ -1921,22 +1939,33 @@ int arkInitialSetup(ARKodeMem ark_mem, realtype tout) } } - /* If necessary, temporarily set h as it is used to compute the tolerance in a - potential mass matrix solve when computing the full rhs */ - if (ark_mem->h == ZERO) ark_mem->h = ONE; - - /* Call fullrhs (used in estimating initial step, explicit steppers, Hermite - interpolation module, and possibly (but not always) arkRootCheck1) */ - retval = ark_mem->step_fullrhs(ark_mem, ark_mem->tcur, ark_mem->yn, - ark_mem->fn, ARK_FULLRHS_START); - if (retval != 0) return(ARK_RHSFUNC_FAIL); - /* Fill initial interpolation data (if needed) */ if (ark_mem->interp != NULL) { retval = arkInterpInit(ark_mem, ark_mem->interp, ark_mem->tcur); if (retval != 0) return(retval); } + /* If fullrhs will be called (to estimate initial step, explicit steppers, Hermite + interpolation module, and possibly (but not always) arkRootCheck1), then + ensure that it is provided, and space is allocated for fn. */ + if (ark_mem->call_fullrhs || (ark_mem->h0u == ZERO && ark_mem->hin == ZERO) + || ark_mem->root_mem) + { + if (!ark_mem->step_fullrhs) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE", + "arkInitialSetup", MSG_ARK_MISSING_FULLRHS); + return ARK_ILL_INPUT; + } + + if (!arkAllocVec(ark_mem, ark_mem->yn, &ark_mem->fn)) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", + "arkInitialSetup", MSG_ARK_MEM_FAIL); + return(ARK_MEM_FAIL); + } + } + /* initialization complete */ ark_mem->initialized = SUNTRUE; @@ -2052,11 +2081,11 @@ int arkStopTests(ARKodeMem ark_mem, realtype tout, N_Vector yout, /* Shortcut to roots found in previous step */ irfndp = ark_mem->root_mem->irfnd; - /* If the full rhs was not computed in the last call to arkCompleteStep + /* If the full RHS was not computed in the last call to arkCompleteStep and roots were found in the previous step, then compute the full rhs for possible use in arkRootCheck2 (not always necessary) */ - if (!(ark_mem->call_fullrhs) && irfndp != 0) { - retval = ark_mem->step_fullrhs(ark_mem, ark_mem->tcur, ark_mem->yn, + if (!(ark_mem->fn_is_current) && irfndp != 0) { + retval = ark_mem->step_fullrhs(ark_mem, ark_mem->tn, ark_mem->yn, ark_mem->fn, ARK_FULLRHS_END); if (retval != 0) { arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE", "arkStopTests", @@ -2064,6 +2093,7 @@ int arkStopTests(ARKodeMem ark_mem, realtype tout, N_Vector yout, *ier = ARK_RHSFUNC_FAIL; return(1); } + ark_mem->fn_is_current = SUNTRUE; } retval = arkRootCheck2((void*) ark_mem); @@ -2233,6 +2263,19 @@ int arkHin(ARKodeMem ark_mem, realtype tout) if (tdist < TWO*tround) return(ARK_TOO_CLOSE); + /* call full RHS if needed */ + if (!(ark_mem->fn_is_current)) + { + /* NOTE: The step size (h) is used in setting the tolerance in a potential + mass matrix solve when computing the full RHS. Before calling arkHin, h + is set to |tout - tcur| or 1 and so we do not need to guard against + h == 0 here before calling the full RHS. */ + retval = ark_mem->step_fullrhs(ark_mem, ark_mem->tn, ark_mem->yn, + ark_mem->fn, ARK_FULLRHS_START); + if (retval) { return ARK_RHSFUNC_FAIL; } + ark_mem->fn_is_current = SUNTRUE; + } + /* Set lower and upper bounds on h0, and take geometric mean as first trial value. Exit with this value if the bounds cross each other. */ @@ -2399,7 +2442,7 @@ int arkYddNorm(ARKodeMem ark_mem, realtype hg, realtype *yddnrm) ---------------------------------------------------------------*/ int arkCompleteStep(ARKodeMem ark_mem, realtype dsm) { - int retval, mode; + int retval; realtype troundoff; /* Set current time to the end of the step (in case the last @@ -2438,22 +2481,18 @@ int arkCompleteStep(ARKodeMem ark_mem, realtype dsm) if (retval != 0) return(ARK_POSTPROCESS_STEP_FAIL); } - /* update interpolation structure */ + /* update interpolation structure + + NOTE: This must be called before updating yn with ycur as the interpolation + module may need to save tn, yn from the start of this step */ if (ark_mem->interp != NULL) { retval = arkInterpUpdate(ark_mem, ark_mem->interp, ark_mem->tcur); if (retval != ARK_SUCCESS) return(retval); } - /* call fullrhs if needed */ - if (ark_mem->call_fullrhs) { - mode = (ark_mem->ProcessStep != NULL) ? ARK_FULLRHS_START : ARK_FULLRHS_END; - retval = ark_mem->step_fullrhs(ark_mem, ark_mem->tcur, ark_mem->ycur, - ark_mem->fn, mode); - if (retval != 0) return(ARK_RHSFUNC_FAIL); - } - /* update yn to current solution */ N_VScale(ONE, ark_mem->ycur, ark_mem->yn); + ark_mem->fn_is_current = SUNFALSE; /* Update step size and error history arrays */ ark_mem->hadapt_mem->ehist[1] = ark_mem->hadapt_mem->ehist[0]; diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index ba5e4c3885..a3d22e2dee 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -19,6 +19,7 @@ #include #include +#include "arkode/arkode_butcher.h" #include "arkode_impl.h" #include "arkode_arkstep_impl.h" #include "arkode_interp_impl.h" @@ -713,6 +714,21 @@ void ARKStepFree(void **arkode_mem) } step_mem->nfusedopvecs = 0; + /* free work arrays for MRI forcing */ + if (step_mem->stage_times) + { + free(step_mem->stage_times); + step_mem->stage_times = NULL; + ark_mem->lrw -= step_mem->stages; + } + + if (step_mem->stage_coefs) + { + free(step_mem->stage_coefs); + step_mem->stage_coefs = NULL; + ark_mem->lrw -= step_mem->stages; + } + /* free the time stepper module itself */ free(ark_mem->step_mem); ark_mem->step_mem = NULL; @@ -1208,6 +1224,27 @@ int arkStep_Init(void* arkode_mem, int init_type) ark_mem->liw += step_mem->nfusedopvecs; /* pointers */ } + /* Allocate workspace for MRI forcing -- need to allocate here as the + number of stages may not bet set before this point and we assume + SetInnerForcing has been called before the first step i.e., methods + start with a fast integration */ + if (step_mem->expforcing || step_mem->impforcing) + { + if (!(step_mem->stage_times)) + { + step_mem->stage_times = (realtype*) calloc(step_mem->stages, + sizeof(realtype)); + ark_mem->lrw += step_mem->stages; + } + + if (!(step_mem->stage_coefs)) + { + step_mem->stage_coefs = (realtype*) calloc(step_mem->stages, + sizeof(realtype)); + ark_mem->lrw += step_mem->stages; + } + } + /* Limit max interpolant degree (negative input only overwrites the current interpolant degree if it is greater than abs(input). */ if (ark_mem->interp != NULL) @@ -1237,10 +1274,6 @@ int arkStep_Init(void* arkode_mem, int init_type) if (step_mem->mass_type != MASS_IDENTITY) if ((step_mem->predictor == 4) || (step_mem->predictor == 5)) step_mem->predictor = 0; - - /* If the bootstrap predictor is enabled, signal to shared arkode module that - fullrhs is required after each step */ - if (step_mem->predictor == 4) ark_mem->call_fullrhs = SUNTRUE; } /* set appropriate TakeStep routine based on problem configuration */ @@ -1303,11 +1336,14 @@ int arkStep_Init(void* arkode_mem, int init_type) } } + /* Signal to shared arkode module that full RHS evaluations are required */ + ark_mem->call_fullrhs = SUNTRUE; + return(ARK_SUCCESS); } -/*--------------------------------------------------------------- +/*------------------------------------------------------------------------------ arkStep_FullRHS: Rewriting the problem @@ -1318,24 +1354,30 @@ int arkStep_Init(void* arkode_mem, int init_type) f = M^{-1}*[ fe(t,y) + fi(t,y) ] This will be called in one of three 'modes': - ARK_FULLRHS_START -> called at the beginning of a simulation - or after post processing at step - ARK_FULLRHS_END -> called at the end of a successful step - ARK_FULLRHS_OTHER -> called elsewhere (e.g. for dense output) - - If it is called in ARK_FULLRHS_START mode, we store the vectors - fe(t,y) and fi(t,y) in Fe[0] and Fi[0] for possible reuse in the - first stage of the subsequent time step. - - If it is called in ARK_FULLRHS_END mode and the ARK method - coefficients support it, we may just copy vectors Fe[stages] and - Fi[stages] to fill f instead of calling fe() and fi(). - - ARK_FULLRHS_OTHER mode is only called for dense output in-between - steps, or when estimating the initial time step size, so we strive to - store the intermediate parts so that they do not interfere - with the other two modes. - ---------------------------------------------------------------*/ + + ARK_FULLRHS_START -> called at the beginning of a simulation i.e., at + (tn, yn) = (t0, y0) or (tR, yR) + + ARK_FULLRHS_END -> called at the end of a successful step i.e, at + (tcur, ycur) or the start of the subsequent step i.e., + at (tn, yn) = (tcur, ycur) from the end of the last + step + + ARK_FULLRHS_OTHER -> called elsewhere (e.g. for dense output) + + If this function is called in ARK_FULLRHS_START or ARK_FULLRHS_END mode and + evaluating the RHS functions is necessary, we store the vectors fe(t,y) and + fi(t,y) in Fe[0] and Fi[0] for possible reuse in the first stage of the + subsequent time step. + + In ARK_FULLRHS_END mode we check if the method is stiffly accurate and, if + appropriate, copy the vectors Fe[stages - 1] and Fi[stages - 1] to Fe[0] and + Fi[0] for possible reuse in the first stage of the subsequent time step. + + ARK_FULLRHS_OTHER mode is only called for dense output in-between steps, or + when estimating the initial time step size, so we strive to store the + intermediate parts so that they do not interfere with the other two modes. + ----------------------------------------------------------------------------*/ int arkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, int mode) { @@ -1345,6 +1387,7 @@ int arkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, booleantype recomputeRHS; realtype* cvals; N_Vector* Xvecs; + realtype stage_coefs = ONE; /* access ARKodeARKStepMem structure */ retval = arkStep_AccessStepMem(arkode_mem, "arkStep_FullRHS", @@ -1365,138 +1408,246 @@ int arkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, /* perform RHS functions contingent on 'mode' argument */ switch(mode) { - /* ARK_FULLRHS_START: called at the beginning of a simulation - Store the vectors fe(t,y) and fi(t,y) in Fe[0] and Fi[0] for - possible reuse in the first stage of the subsequent time step */ case ARK_FULLRHS_START: - /* call fe if the problem has an explicit component */ - if (step_mem->explicit) { - retval = step_mem->fe(t, y, step_mem->Fe[0], ark_mem->user_data); - step_mem->nfe++; - if (retval != 0) { - arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE::ARKStep", - "arkStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); - return(ARK_RHSFUNC_FAIL); - } - /* apply external polynomial forcing */ - if (step_mem->expforcing) { - cvals[0] = ONE; - Xvecs[0] = step_mem->Fe[0]; - nvec = 1; - arkStep_ApplyForcing(step_mem, t, ONE, &nvec); - N_VLinearCombination(nvec, cvals, Xvecs, step_mem->Fe[0]); - } - } + /* compute the full RHS */ + if (!(ark_mem->fn_is_current)) + { + /* compute the explicit component */ + if (step_mem->explicit) + { + retval = step_mem->fe(t, y, step_mem->Fe[0], ark_mem->user_data); + step_mem->nfe++; + if (retval != 0) + { + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE::ARKStep", + "arkStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); + return(ARK_RHSFUNC_FAIL); + } - /* call fi if the problem has an implicit component */ - if (step_mem->implicit) { - retval = step_mem->fi(t, y, step_mem->Fi[0], ark_mem->user_data); - step_mem->nfi++; - if (retval != 0) { - arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE::ARKStep", - "arkStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); - return(ARK_RHSFUNC_FAIL); + /* compute and store M(t)^{-1} fe */ + if (step_mem->mass_type == MASS_TIMEDEP) + { + retval = step_mem->msolve((void *) ark_mem, step_mem->Fe[0], + step_mem->nlscoef / ark_mem->h); + if (retval) + { + arkProcessError(ark_mem, ARK_MASSSOLVE_FAIL, "ARKODE::ARKStep", + "arkStep_FullRHS", "Mass matrix solver failure"); + return ARK_MASSSOLVE_FAIL; + } + } } - /* apply external polynomial forcing */ - if (step_mem->impforcing) { - cvals[0] = ONE; - Xvecs[0] = step_mem->Fi[0]; - nvec = 1; - arkStep_ApplyForcing(step_mem, t, ONE, &nvec); - N_VLinearCombination(nvec, cvals, Xvecs, step_mem->Fi[0]); + + /* compute the implicit component */ + if (step_mem->implicit) + { + retval = step_mem->fi(t, y, step_mem->Fi[0], ark_mem->user_data); + step_mem->nfi++; + if (retval != 0) + { + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE::ARKStep", + "arkStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); + return(ARK_RHSFUNC_FAIL); + } + + /* compute and store M(t)^{-1} fi */ + if (step_mem->mass_type == MASS_TIMEDEP) + { + retval = step_mem->msolve((void *) ark_mem, step_mem->Fi[0], + step_mem->nlscoef / ark_mem->h); + if (retval) + { + arkProcessError(ark_mem, ARK_MASSSOLVE_FAIL, "ARKODE::ARKStep", + "arkStep_FullRHS", "Mass matrix solver failure"); + return ARK_MASSSOLVE_FAIL; + } + } } } /* combine RHS vector(s) into output */ - if (step_mem->explicit && step_mem->implicit) { /* ImEx */ + if (step_mem->explicit && step_mem->implicit) + { + /* ImEx */ N_VLinearSum(ONE, step_mem->Fi[0], ONE, step_mem->Fe[0], f); - } else if (step_mem->implicit) { /* implicit */ + } + else if (step_mem->implicit) + { + /* implicit */ N_VScale(ONE, step_mem->Fi[0], f); - } else { /* explicit */ + } + else + { + /* explicit */ N_VScale(ONE, step_mem->Fe[0], f); } - break; + /* compute M^{-1} f for output but do not store */ + if (step_mem->mass_type == MASS_FIXED) + { + retval = step_mem->msolve((void *) ark_mem, f, + step_mem->nlscoef / ark_mem->h); + if (retval) + { + arkProcessError(ark_mem, ARK_MASSSOLVE_FAIL, "ARKODE::ARKStep", + "arkStep_FullRHS", "Mass matrix solver failure"); + return ARK_MASSSOLVE_FAIL; + } + } + + /* apply external polynomial (MRI) forcing (M = I required) */ + if (step_mem->expforcing || step_mem->impforcing) + { + cvals[0] = ONE; + Xvecs[0] = f; + nvec = 1; + arkStep_ApplyForcing(step_mem, &t, &stage_coefs, 1, &nvec); + N_VLinearCombination(nvec, cvals, Xvecs, f); + } + break; - /* ARK_FULLRHS_END: called at the end of a successful step - If the ARK method coefficients support it, we just copy the last stage RHS - vectors to fill f instead of calling fe() and fi(). - Copy the results to Fe[0] and Fi[0] if the ARK coefficients support it. */ case ARK_FULLRHS_END: - /* determine if explicit/implicit RHS functions need to be recomputed */ - recomputeRHS = SUNFALSE; - if ( step_mem->explicit && (SUNRabs(step_mem->Be->c[step_mem->stages-1]-ONE)>TINY) ) - recomputeRHS = SUNTRUE; - if ( step_mem->implicit && (SUNRabs(step_mem->Bi->c[step_mem->stages-1]-ONE)>TINY) ) - recomputeRHS = SUNTRUE; - - /* base RHS calls on recomputeRHS argument */ - if (recomputeRHS) { + /* compute the full RHS */ + if (!(ark_mem->fn_is_current)) + { + /* determine if RHS functions need to be recomputed */ + recomputeRHS = SUNFALSE; - /* call fe if the problem has an explicit component */ - if (step_mem->explicit) { - retval = step_mem->fe(t, y, step_mem->Fe[0], ark_mem->user_data); - step_mem->nfe++; - if (retval != 0) { - arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE::ARKStep", - "arkStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); - return(ARK_RHSFUNC_FAIL); + if (step_mem->explicit) + { + if (!ARKodeButcherTable_IsStifflyAccurate(step_mem->Be)) + { + recomputeRHS = SUNTRUE; } - /* apply external polynomial forcing */ - if (step_mem->expforcing) { - cvals[0] = ONE; - Xvecs[0] = step_mem->Fe[0]; - nvec = 1; - arkStep_ApplyForcing(step_mem, t, ONE, &nvec); - N_VLinearCombination(nvec, cvals, Xvecs, step_mem->Fe[0]); + } + + if (step_mem->implicit) + { + if (!ARKodeButcherTable_IsStifflyAccurate(step_mem->Bi)) + { + recomputeRHS = SUNTRUE; } } - /* call fi if the problem has an implicit component */ - if (step_mem->implicit) { - retval = step_mem->fi(t, y, step_mem->Fi[0], ark_mem->user_data); - step_mem->nfi++; - if (retval != 0) { - arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE::ARKStep", - "arkStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); - return(ARK_RHSFUNC_FAIL); + /* Stiffly Accurate methods are not SA when relaxation is enabled */ + if (ark_mem->relax_enabled) { recomputeRHS = SUNTRUE; } + + /* recompute RHS functions */ + if (recomputeRHS) + { + /* compute the explicit component */ + if (step_mem->explicit) + { + retval = step_mem->fe(t, y, step_mem->Fe[0], ark_mem->user_data); + step_mem->nfe++; + if (retval != 0) + { + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE::ARKStep", + "arkStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); + return(ARK_RHSFUNC_FAIL); + } + + /* compute and store M(t)^{-1} fi */ + if (step_mem->mass_type == MASS_TIMEDEP) + { + retval = step_mem->msolve((void *) ark_mem, step_mem->Fe[0], + step_mem->nlscoef / ark_mem->h); + if (retval) + { + arkProcessError(ark_mem, ARK_MASSSOLVE_FAIL, "ARKODE::ARKStep", + "arkStep_FullRHS", "Mass matrix solver failure"); + return ARK_MASSSOLVE_FAIL; + } + } } - /* apply external polynomial forcing */ - if (step_mem->impforcing) { - cvals[0] = ONE; - Xvecs[0] = step_mem->Fi[0]; - nvec = 1; - arkStep_ApplyForcing(step_mem, t, ONE, &nvec); - N_VLinearCombination(nvec, cvals, Xvecs, step_mem->Fi[0]); + + /* compute the implicit component */ + if (step_mem->implicit) + { + retval = step_mem->fi(t, y, step_mem->Fi[0], ark_mem->user_data); + step_mem->nfi++; + if (retval != 0) + { + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE::ARKStep", + "arkStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); + return(ARK_RHSFUNC_FAIL); + } + + /* compute and store M(t)^{-1} fi */ + if (step_mem->mass_type == MASS_TIMEDEP) + { + retval = step_mem->msolve((void *) ark_mem, step_mem->Fi[0], + step_mem->nlscoef / ark_mem->h); + if (retval) + { + arkProcessError(ark_mem, ARK_MASSSOLVE_FAIL, "ARKODE::ARKStep", + "arkStep_FullRHS", "Mass matrix solver failure"); + return ARK_MASSSOLVE_FAIL; + } + } + } + } + else + { + if (step_mem->explicit) + { + N_VScale(ONE, step_mem->Fe[step_mem->stages-1], step_mem->Fe[0]); + } + if (step_mem->implicit) + { + N_VScale(ONE, step_mem->Fi[step_mem->stages-1], step_mem->Fi[0]); } } - } else { - if (step_mem->explicit) - N_VScale(ONE, step_mem->Fe[step_mem->stages-1], step_mem->Fe[0]); - if (step_mem->implicit) - N_VScale(ONE, step_mem->Fi[step_mem->stages-1], step_mem->Fi[0]); } /* combine RHS vector(s) into output */ - if (step_mem->explicit && step_mem->implicit) { /* ImEx */ + if (step_mem->explicit && step_mem->implicit) + { + /* ImEx */ N_VLinearSum(ONE, step_mem->Fi[0], ONE, step_mem->Fe[0], f); - } else if (step_mem->implicit) { /* implicit */ + } + else if (step_mem->implicit) + { + /* implicit */ N_VScale(ONE, step_mem->Fi[0], f); - } else { /* explicit */ + } + else + { + /* explicit */ N_VScale(ONE, step_mem->Fe[0], f); } + /* compute M^{-1} f for output but do not store */ + if (step_mem->mass_type == MASS_FIXED) + { + retval = step_mem->msolve((void *) ark_mem, f, + step_mem->nlscoef / ark_mem->h); + if (retval) + { + arkProcessError(ark_mem, ARK_MASSSOLVE_FAIL, "ARKODE::ARKStep", + "arkStep_FullRHS", "Mass matrix solver failure"); + return ARK_MASSSOLVE_FAIL; + } + } + + /* apply external polynomial (MRI) forcing (M = I required) */ + if (step_mem->expforcing || step_mem->impforcing) + { + cvals[0] = ONE; + Xvecs[0] = f; + nvec = 1; + arkStep_ApplyForcing(step_mem, &t, &stage_coefs, 1, &nvec); + N_VLinearCombination(nvec, cvals, Xvecs, f); + } + break; - /* ARK_FULLRHS_OTHER: called for dense output in-between steps or for - estimation of the initial time step size, store the intermediate - calculations in such a way as to not interfere with the other two modes */ case ARK_FULLRHS_OTHER: - /* call fe if the problem has an explicit component (store in ark_tempv2) */ + /* compute the explicit component and store in ark_tempv2 */ if (step_mem->explicit) { retval = step_mem->fe(t, y, ark_mem->tempv2, ark_mem->user_data); step_mem->nfe++; @@ -1505,17 +1656,9 @@ int arkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, "arkStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); return(ARK_RHSFUNC_FAIL); } - /* apply external polynomial forcing */ - if (step_mem->expforcing) { - cvals[0] = ONE; - Xvecs[0] = ark_mem->tempv2; - nvec = 1; - arkStep_ApplyForcing(step_mem, t, ONE, &nvec); - N_VLinearCombination(nvec, cvals, Xvecs, ark_mem->tempv2); - } } - /* call fi if the problem has an implicit component (store in sdata) */ + /* compute the implicit component and store in sdata */ if (step_mem->implicit) { retval = step_mem->fi(t, y, step_mem->sdata, ark_mem->user_data); step_mem->nfi++; @@ -1524,14 +1667,6 @@ int arkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, "arkStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); return(ARK_RHSFUNC_FAIL); } - /* apply external polynomial forcing */ - if (step_mem->impforcing) { - cvals[0] = ONE; - Xvecs[0] = step_mem->sdata; - nvec = 1; - arkStep_ApplyForcing(step_mem, t, ONE, &nvec); - N_VLinearCombination(nvec, cvals, Xvecs, step_mem->sdata); - } } /* combine RHS vector(s) into output */ @@ -1543,6 +1678,29 @@ int arkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, N_VScale(ONE, ark_mem->tempv2, f); } + /* compute M^{-1} f for output but do not store */ + if (step_mem->mass_type != MASS_IDENTITY) + { + retval = step_mem->msolve((void *) ark_mem, f, + step_mem->nlscoef / ark_mem->h); + if (retval) + { + arkProcessError(ark_mem, ARK_MASSSOLVE_FAIL, "ARKODE::ARKStep", + "arkStep_FullRHS", "Mass matrix solver failure"); + return ARK_MASSSOLVE_FAIL; + } + } + + /* apply external polynomial (MRI) forcing (M = I required) */ + if (step_mem->expforcing || step_mem->impforcing) + { + cvals[0] = ONE; + Xvecs[0] = f; + nvec = 1; + arkStep_ApplyForcing(step_mem, &t, &stage_coefs, 1, &nvec); + N_VLinearCombination(nvec, cvals, Xvecs, f); + } + break; default: @@ -1552,17 +1710,6 @@ int arkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, return(ARK_RHSFUNC_FAIL); } - /* if M != I, then update f = M^{-1}*f */ - if (step_mem->mass_type != MASS_IDENTITY) { - retval = step_mem->msolve((void *) ark_mem, f, - step_mem->nlscoef/ark_mem->h); - if (retval != ARK_SUCCESS) { - arkProcessError(ark_mem, ARK_MASSSOLVE_FAIL, "ARKODE::ARKStep", - "arkStep_FullRHS", "Mass matrix solver failure"); - return(ARK_MASSSOLVE_FAIL); - } - } - return(ARK_SUCCESS); } @@ -1595,24 +1742,20 @@ int arkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, ---------------------------------------------------------------*/ int arkStep_TakeStep_Z(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) { - int retval, is, nvec; + int retval, is, is_start, mode; booleantype implicit_stage; booleantype deduce_stage; + booleantype save_stages; + booleantype stiffly_accurate; ARKodeMem ark_mem; ARKodeARKStepMem step_mem; N_Vector zcor0; - realtype* cvals; - N_Vector* Xvecs; /* access ARKodeARKStepMem structure */ retval = arkStep_AccessStepMem(arkode_mem, "arkStep_TakeStep_Z", &ark_mem, &step_mem); if (retval != ARK_SUCCESS) return(retval); - /* local shortcuts for use with fused vector operations */ - cvals = step_mem->cvals; - Xvecs = step_mem->Xvecs; - /* if problem will involve no algebraic solvers, initialize nflagPtr to success */ if ((!step_mem->implicit) && (step_mem->mass_type == MASS_IDENTITY)) *nflagPtr = ARK_SUCCESS; @@ -1627,8 +1770,100 @@ int arkStep_TakeStep_Z(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) if (retval > 0) return(ARK_NLS_SETUP_RECVR); } + /* check if we need to store stage values */ + save_stages = SUNFALSE; + if (ark_mem->relax_enabled && (step_mem->implicit || + step_mem->mass_type == MASS_FIXED)) + { + save_stages = SUNTRUE; + } + + /* check for implicit method with explicit first stage */ + implicit_stage = SUNFALSE; + is_start = 1; + if (step_mem->implicit) + { + if (SUNRabs(step_mem->Bi->A[0][0]) > TINY) + { + implicit_stage = SUNTRUE; + is_start = 0; + } + } + + /* explicit first stage -- store stage if necessary for relaxation */ + if (is_start == 1 && save_stages) + { + N_VScale(ONE, ark_mem->yn, step_mem->z[0]); + } + + /* check if the method is Stiffly Accurate (SA) */ + stiffly_accurate = SUNTRUE; + if (step_mem->explicit) + { + if (!ARKodeButcherTable_IsStifflyAccurate(step_mem->Be)) + { + stiffly_accurate = SUNFALSE; + } + } + + if (step_mem->implicit) + { + if (!ARKodeButcherTable_IsStifflyAccurate(step_mem->Bi)) + { + stiffly_accurate = SUNFALSE; + } + } + + /* Call the full RHS if needed e.g., an explicit first stage. If this is the + first step then we may need to evaluate or copy the RHS values from an + earlier evaluation (e.g., to compute h0). For subsequent steps treat this + RHS evaluation as an evaluation at the end of the just completed step to + potentially reuse (FSAL methods) or save (stiffly accurate methods with an + implicit first stage using Hermite interpolation) RHS evaluations from the + end of the last step. */ + + if ((!implicit_stage || (stiffly_accurate && ark_mem->interp_type == ARK_INTERP_HERMITE)) + && !(ark_mem->fn_is_current)) + { + mode = (ark_mem->initsetup) ? ARK_FULLRHS_START : ARK_FULLRHS_END; + retval = ark_mem->step_fullrhs(ark_mem, ark_mem->tn, ark_mem->yn, + ark_mem->fn, mode); + if (retval) { return ARK_RHSFUNC_FAIL; } + ark_mem->fn_is_current = SUNTRUE; + } + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO + if (is_start == 1) + { + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, + "ARKODE::arkStep_TakeStep_Z", "start-stage", + "step = %li, stage = %i, implicit = %i, h = %"RSYM", tcur = %"RSYM, + ark_mem->nst, 0, implicit_stage, ark_mem->h, ark_mem->tcur); +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::arkStep_TakeStep_Z", "explicit stage", + "z[%i] =", 0); + N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); + if (step_mem->implicit) + { + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::arkStep_TakeStep_Z", "implicit RHS", + "Fi[%i] =", 0); + N_VPrintFile(step_mem->Fi[0], ARK_LOGGER->debug_fp); + } + if (step_mem->explicit) + { + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::arkStep_TakeStep_Z", "explicit RHS", + "Fe[%i] =", 0); + N_VPrintFile(step_mem->Fe[0], ARK_LOGGER->debug_fp); + } +#endif + } +#endif + /* loop over internal stages to the step */ - for (is=0; isstages; is++) { + for (is = is_start; is < step_mem->stages; is++) { /* store current stage index */ step_mem->istage = is; @@ -1758,8 +1993,7 @@ int arkStep_TakeStep_Z(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) /* successful stage solve */ /* store stage (if necessary for relaxation) */ - if (ark_mem->relax_enabled && (step_mem->implicit || - step_mem->mass_type == MASS_FIXED)) + if (save_stages) { N_VScale(ONE, ark_mem->ycur, step_mem->z[is]); } @@ -1790,40 +2024,23 @@ int arkStep_TakeStep_Z(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) if (retval < 0) return(ARK_RHSFUNC_FAIL); if (retval > 0) return(ARK_UNREC_RHSFUNC_ERR); - /* apply external polynomial forcing */ - if (step_mem->impforcing) { - cvals[0] = ONE; - Xvecs[0] = step_mem->Fi[is]; - nvec = 1; - arkStep_ApplyForcing(step_mem, ark_mem->tcur, ONE, &nvec); - N_VLinearCombination(nvec, cvals, Xvecs, step_mem->Fi[is]); - } } /* store explicit RHS */ if (step_mem->explicit) { - retval = step_mem->fe(ark_mem->tn + step_mem->Be->c[is]*ark_mem->h, - ark_mem->ycur, step_mem->Fe[is], ark_mem->user_data); - step_mem->nfe++; + retval = step_mem->fe(ark_mem->tn + step_mem->Be->c[is]*ark_mem->h, + ark_mem->ycur, step_mem->Fe[is], ark_mem->user_data); + step_mem->nfe++; #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::arkStep_TakeStep_Z", "explicit RHS", - "Fe[%i] =", is); - N_VPrintFile(step_mem->Fe[is], ARK_LOGGER->debug_fp); + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::arkStep_TakeStep_Z", "explicit RHS", + "Fe[%i] =", is); + N_VPrintFile(step_mem->Fe[is], ARK_LOGGER->debug_fp); #endif - if (retval < 0) return(ARK_RHSFUNC_FAIL); - if (retval > 0) return(ARK_UNREC_RHSFUNC_ERR); - /* apply external polynomial forcing */ - if (step_mem->expforcing) { - cvals[0] = ONE; - Xvecs[0] = step_mem->Fe[is]; - nvec = 1; - arkStep_ApplyForcing(step_mem, ark_mem->tn+step_mem->Be->c[is]*ark_mem->h, - ONE, &nvec); - N_VLinearCombination(nvec, cvals, Xvecs, step_mem->Fe[is]); - } + if (retval < 0) return(ARK_RHSFUNC_FAIL); + if (retval > 0) return(ARK_UNREC_RHSFUNC_ERR); } /* if using a time-dependent mass matrix, update Fe[is] and/or Fi[is] with M(t)^{-1} */ @@ -1831,10 +2048,22 @@ int arkStep_TakeStep_Z(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) /* If the implicit stage was deduced, it already includes M(t)^{-1} */ if (step_mem->implicit && !deduce_stage) { *nflagPtr = step_mem->msolve((void *) ark_mem, step_mem->Fi[is], step_mem->nlscoef); +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::arkStep_TakeStep_Z", "M^{-1} implicit RHS", + "Fi[%i] =", is); + N_VPrintFile(step_mem->Fi[is], ARK_LOGGER->debug_fp); +#endif if (*nflagPtr != ARK_SUCCESS) return(TRY_AGAIN); } if (step_mem->explicit) { *nflagPtr = step_mem->msolve((void *) ark_mem, step_mem->Fe[is], step_mem->nlscoef); +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::arkStep_TakeStep_Z", "M^{-1} explicit RHS", + "Fe[%i] =", is); + N_VPrintFile(step_mem->Fe[is], ARK_LOGGER->debug_fp); +#endif if (*nflagPtr != ARK_SUCCESS) return(TRY_AGAIN); } } @@ -1845,15 +2074,12 @@ int arkStep_TakeStep_Z(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) This can fail recoverably due to nonconvergence of the mass matrix solve, so handle that appropriately. */ if (step_mem->mass_type == MASS_FIXED) { - retval = arkStep_ComputeSolutions_MassFixed(ark_mem, dsmPtr); + *nflagPtr = arkStep_ComputeSolutions_MassFixed(ark_mem, dsmPtr); } else { - retval = arkStep_ComputeSolutions(ark_mem, dsmPtr); - } - if (retval < 0) return(retval); - if (retval > 0) { - *nflagPtr = retval; - return(TRY_AGAIN); + *nflagPtr = arkStep_ComputeSolutions(ark_mem, dsmPtr); } + if (*nflagPtr < 0) return(*nflagPtr); + if (*nflagPtr > 0) return(TRY_AGAIN); #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, @@ -1869,9 +2095,9 @@ int arkStep_TakeStep_Z(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, - "ARKODE::arkStep_TakeStep_Z", "error-test", - "step = %li, h = %"RSYM", dsm = %"RSYM, - ark_mem->nst, ark_mem->h, *dsmPtr); + "ARKODE::arkStep_TakeStep_Z", "end-step", + "step = %li, h = %"RSYM", dsm = %"RSYM", nflag = %d", + ark_mem->nst, ark_mem->h, *dsmPtr, *nflagPtr); #endif return(ARK_SUCCESS); @@ -2486,7 +2712,9 @@ int arkStep_StageSetup(ARKodeMem ark_mem, booleantype implicit) { /* local data */ ARKodeARKStepMem step_mem; - int retval, i, j, nvec; + int retval, i, j, jmax, nvec; + sunrealtype* cj; + sunrealtype** Aij; realtype* cvals; N_Vector* Xvecs; @@ -2501,12 +2729,6 @@ int arkStep_StageSetup(ARKodeMem ark_mem, booleantype implicit) /* Set shortcut to current stage index */ i = step_mem->istage; - /* If this is the first stage, and explicit, just set sdata=0 and return */ - if (!implicit && (i==0)) { - N_VConst(ZERO, step_mem->sdata); - return (ARK_SUCCESS); - } - /* local shortcuts for fused vector operations */ cvals = step_mem->cvals; Xvecs = step_mem->Xvecs; @@ -2527,7 +2749,12 @@ int arkStep_StageSetup(ARKodeMem ark_mem, booleantype implicit) /* apply external polynomial forcing (updates nvec, cvals, Xvecs) */ if (step_mem->impforcing) { nvec = 0; - arkStep_ApplyForcing(step_mem, ark_mem->tcur, step_mem->gamma, &nvec); + + step_mem->stage_times[0] = ark_mem->tcur; + step_mem->stage_coefs[0] = step_mem->gamma; + + arkStep_ApplyForcing(step_mem, step_mem->stage_times, + step_mem->stage_coefs, 1, &nvec); retval = N_VLinearCombination(nvec, cvals, Xvecs, step_mem->sdata); if (retval != 0) return(ARK_VECTOROP_ERR); } else { @@ -2570,10 +2797,30 @@ int arkStep_StageSetup(ARKodeMem ark_mem, booleantype implicit) } } - /* apply external polynomial forcing (updates nvec, cvals, Xvecs) */ - if (step_mem->impforcing) { - arkStep_ApplyForcing(step_mem, ark_mem->tcur, - ark_mem->h * step_mem->Bi->A[i][i], &nvec); + /* apply external polynomial (MRI) forcing (M = I required) */ + if (step_mem->expforcing || step_mem->impforcing) + { + if (step_mem->expforcing) + { + jmax = i; + Aij = step_mem->Be->A; + cj = step_mem->Be->c; + } + else + { + jmax = i + 1; + Aij = step_mem->Bi->A; + cj = step_mem->Bi->c; + } + + for (j = 0; j < jmax; j++) + { + step_mem->stage_times[j] = ark_mem->tn + cj[j] * ark_mem->h; + step_mem->stage_coefs[j] = ark_mem->h * Aij[i][j]; + } + + arkStep_ApplyForcing(step_mem, step_mem->stage_times, step_mem->stage_coefs, + jmax, &nvec); } /* call fused vector operation to do the work */ @@ -2604,6 +2851,10 @@ int arkStep_ComputeSolutions(ARKodeMem ark_mem, realtype *dsmPtr) /* local data */ int retval, j, nvec; N_Vector y, yerr; + sunrealtype* cj; + sunrealtype* bj; + sunrealtype* dj; + booleantype stiffly_accurate; realtype* cvals; N_Vector* Xvecs; ARKodeARKStepMem step_mem; @@ -2627,27 +2878,75 @@ int arkStep_ComputeSolutions(ARKodeMem ark_mem, realtype *dsmPtr) /* initialize output */ *dsmPtr = ZERO; - /* Compute time step solution */ - /* set arrays for fused vector operation */ - cvals[0] = ONE; - Xvecs[0] = ark_mem->yn; - nvec = 1; - for (j=0; jstages; j++) { - if (step_mem->explicit) { /* Explicit pieces */ - cvals[nvec] = ark_mem->h * step_mem->Be->b[j]; - Xvecs[nvec] = step_mem->Fe[j]; - nvec += 1; + /* check if the method is stiffly accurate */ + stiffly_accurate = SUNTRUE; + + if (step_mem->explicit) + { + if (!ARKodeButcherTable_IsStifflyAccurate(step_mem->Be)) + { + stiffly_accurate = SUNFALSE; } - if (step_mem->implicit) { /* Implicit pieces */ - cvals[nvec] = ark_mem->h * step_mem->Bi->b[j]; - Xvecs[nvec] = step_mem->Fi[j]; - nvec += 1; + } + + if (step_mem->implicit) + { + if (!ARKodeButcherTable_IsStifflyAccurate(step_mem->Bi)) + { + stiffly_accurate = SUNFALSE; } } - /* call fused vector operation to do the work */ - retval = N_VLinearCombination(nvec, cvals, Xvecs, y); - if (retval != 0) return(ARK_VECTOROP_ERR); + /* If the method is stiffly accurate, ycur is already the new solution */ + + if (!stiffly_accurate) + { + /* Compute time step solution (if necessary) */ + /* set arrays for fused vector operation */ + cvals[0] = ONE; + Xvecs[0] = ark_mem->yn; + nvec = 1; + for (j=0; jstages; j++) { + if (step_mem->explicit) { /* Explicit pieces */ + cvals[nvec] = ark_mem->h * step_mem->Be->b[j]; + Xvecs[nvec] = step_mem->Fe[j]; + nvec += 1; + } + if (step_mem->implicit) { /* Implicit pieces */ + cvals[nvec] = ark_mem->h * step_mem->Bi->b[j]; + Xvecs[nvec] = step_mem->Fi[j]; + nvec += 1; + } + } + + /* apply external polynomial (MRI) forcing (M = I required) */ + if (step_mem->expforcing || step_mem->impforcing) + { + if (step_mem->expforcing) + { + cj = step_mem->Be->c; + bj = step_mem->Be->b; + } + else + { + cj = step_mem->Bi->c; + bj = step_mem->Bi->b; + } + + for (j = 0; j < step_mem->stages; j++) + { + step_mem->stage_times[j] = ark_mem->tn + cj[j] * ark_mem->h; + step_mem->stage_coefs[j] = ark_mem->h * bj[j]; + } + + arkStep_ApplyForcing(step_mem, step_mem->stage_times, step_mem->stage_coefs, + step_mem->stages, &nvec); + } + + /* call fused vector operation to do the work */ + retval = N_VLinearCombination(nvec, cvals, Xvecs, y); + if (retval != 0) return(ARK_VECTOROP_ERR); + } /* Compute yerr (if step adaptivity enabled) */ if (!ark_mem->fixedstep) { @@ -2667,6 +2966,32 @@ int arkStep_ComputeSolutions(ARKodeMem ark_mem, realtype *dsmPtr) } } + /* apply external polynomial (MRI) forcing (M = I required) */ + if (step_mem->expforcing || step_mem->impforcing) + { + if (step_mem->expforcing) + { + cj = step_mem->Be->c; + bj = step_mem->Be->b; + dj = step_mem->Be->d; + } + else + { + cj = step_mem->Bi->c; + bj = step_mem->Bi->b; + dj = step_mem->Bi->d; + } + + for (j = 0; j < step_mem->stages; j++) + { + step_mem->stage_times[j] = ark_mem->tn + cj[j] * ark_mem->h; + step_mem->stage_coefs[j] = ark_mem->h * (bj[j] - dj[j]); + } + + arkStep_ApplyForcing(step_mem, step_mem->stage_times, + step_mem->stage_coefs, step_mem->stages, &nvec); + } + /* call fused vector operation to do the work */ retval = N_VLinearCombination(nvec, cvals, Xvecs, yerr); if (retval != 0) return(ARK_VECTOROP_ERR); @@ -2697,6 +3022,7 @@ int arkStep_ComputeSolutions_MassFixed(ARKodeMem ark_mem, realtype *dsmPtr) /* local data */ int retval, j, nvec; N_Vector y, yerr; + booleantype stiffly_accurate; realtype* cvals; N_Vector* Xvecs; ARKodeARKStepMem step_mem; @@ -2720,37 +3046,60 @@ int arkStep_ComputeSolutions_MassFixed(ARKodeMem ark_mem, realtype *dsmPtr) /* initialize output */ *dsmPtr = ZERO; - /* compute y RHS (store in y) */ - /* set arrays for fused vector operation */ - nvec = 0; - for (j=0; jstages; j++) { - if (step_mem->explicit) { /* Explicit pieces */ - cvals[nvec] = ark_mem->h * step_mem->Be->b[j]; - Xvecs[nvec] = step_mem->Fe[j]; - nvec += 1; + /* check if the method is stiffly accurate */ + stiffly_accurate = SUNTRUE; + + if (step_mem->explicit) + { + if (!ARKodeButcherTable_IsStifflyAccurate(step_mem->Be)) + { + stiffly_accurate = SUNFALSE; } - if (step_mem->implicit) { /* Implicit pieces */ - cvals[nvec] = ark_mem->h * step_mem->Bi->b[j]; - Xvecs[nvec] = step_mem->Fi[j]; - nvec += 1; + } + + if (step_mem->implicit) + { + if (!ARKodeButcherTable_IsStifflyAccurate(step_mem->Bi)) + { + stiffly_accurate = SUNFALSE; } } - /* call fused vector operation to compute RHS */ - retval = N_VLinearCombination(nvec, cvals, Xvecs, y); - if (retval != 0) return(ARK_VECTOROP_ERR); + /* If the method is stiffly accurate, ycur is already the new solution */ - /* solve for y update (stored in y) */ - retval = step_mem->msolve((void *) ark_mem, y, step_mem->nlscoef); - if (retval < 0) { - *dsmPtr = RCONST(2.0); /* indicate too much error, step with smaller step */ - N_VScale(ONE, ark_mem->yn, y); /* place old solution into y */ - return(CONV_FAIL); - } + if (!stiffly_accurate) + { + /* compute y RHS (store in y) */ + /* set arrays for fused vector operation */ + nvec = 0; + for (j=0; jstages; j++) { + if (step_mem->explicit) { /* Explicit pieces */ + cvals[nvec] = ark_mem->h * step_mem->Be->b[j]; + Xvecs[nvec] = step_mem->Fe[j]; + nvec += 1; + } + if (step_mem->implicit) { /* Implicit pieces */ + cvals[nvec] = ark_mem->h * step_mem->Bi->b[j]; + Xvecs[nvec] = step_mem->Fi[j]; + nvec += 1; + } + } + + /* call fused vector operation to compute RHS */ + retval = N_VLinearCombination(nvec, cvals, Xvecs, y); + if (retval != 0) return(ARK_VECTOROP_ERR); - /* compute y = yn + update */ - N_VLinearSum(ONE, ark_mem->yn, ONE, y, y); + /* solve for y update (stored in y) */ + retval = step_mem->msolve((void *) ark_mem, y, step_mem->nlscoef); + if (retval < 0) { + *dsmPtr = RCONST(2.0); /* indicate too much error, step with smaller step */ + N_VScale(ONE, ark_mem->yn, y); /* place old solution into y */ + return(CONV_FAIL); + } + /* compute y = yn + update */ + N_VLinearSum(ONE, ark_mem->yn, ONE, y, y); + } /* compute yerr (if step adaptivity enabled) */ if (!ark_mem->fixedstep) { @@ -2933,34 +3282,62 @@ int arkStep_MRIStepInnerReset(MRIStepInnerStepper stepper, realtype tR, /*------------------------------------------------------------------------------ arkStep_ApplyForcing - Determines the linear combination coefficients and vectors to apply forcing - at a given value of the independent variable (t). This occurs through - appending coefficients and N_Vector pointers to the underlying cvals and Xvecs - arrays in the step_mem structure. The dereferenced input *nvec should indicate - the next available entry in the cvals/Xvecs arrays. The input 's' is a - scaling factor that should be applied to each of these coefficients. + Determines the scaling values and vectors necessary for the MRI polynomial + forcing terms. This occurs through appending scaling values and N_Vector + pointers to the underlying cvals and Xvecs arrays in the step_mem structure. + + stage_times -- The times at which to evaluate the forcing. + + stage_coefs -- Scaling factors (method A, b, or b - d coefficients) applied to + forcing vectors. + + jmax -- the number of values in stage_times and stage_coefs (the stage index + for explicit methods or the index + 1 for implicit methods). + + nvec -- On input, nvec is the next available entry in the cvals/Xvecs arrays. + This value is incremented for each value/vector appended to the cvals/Xvecs + arrays so on return it is the total number of values/vectors in the linear + combination. ----------------------------------------------------------------------------*/ -void arkStep_ApplyForcing(ARKodeARKStepMem step_mem, realtype t, - realtype s, int *nvec) +void arkStep_ApplyForcing(ARKodeARKStepMem step_mem, realtype* stage_times, + realtype* stage_coefs, int jmax, int* nvec) { realtype tau, taui; - int i; + int j, k; + + /* Shortcuts to step_mem data */ + realtype* vals = step_mem->cvals; + N_Vector* vecs = step_mem->Xvecs; + realtype tshift = step_mem->tshift; + realtype tscale = step_mem->tscale; + int nforcing = step_mem->nforcing; + N_Vector* forcing = step_mem->forcing; - /* always append the constant forcing term */ - step_mem->cvals[*nvec] = s; - step_mem->Xvecs[*nvec] = step_mem->forcing[0]; - (*nvec) += 1; + /* Offset into vals and vecs arrays */ + int offset = *nvec; - /* compute normalized time tau and initialize tau^i */ - tau = (t - step_mem->tshift) / (step_mem->tscale); - taui = tau; - for (i=1; inforcing; i++) { - step_mem->cvals[*nvec] = s*taui; - step_mem->Xvecs[*nvec] = step_mem->forcing[i]; - taui *= tau; - (*nvec) += 1; + /* Initialize scaling values, set vectors */ + for (k = 0; k < nforcing; k++) + { + vals[offset + k] = ZERO; + vecs[offset + k] = forcing[k]; } + + for (j = 0; j < jmax; j++) + { + tau = (stage_times[j] - tshift) / tscale; + taui = ONE; + + for (k = 0; k < nforcing; k++) + { + vals[offset + k] += stage_coefs[j] * taui; + taui *= tau; + } + } + + /* Update vector count for linear combination */ + *nvec += nforcing; } /*------------------------------------------------------------------------------ @@ -3057,64 +3434,6 @@ int arkStep_SetInnerForcing(void* arkode_mem, realtype tshift, realtype tscale, return(0); } -/* ----------------------------------------------------------------------------- - * arkStep_RelaxDeltaY - * - * Computes the RK update to yn for use in relaxation methods - * ---------------------------------------------------------------------------*/ - -int arkStep_RelaxDeltaY(ARKodeMem ark_mem, N_Vector delta_y) -{ - int i, nvec, retval; - realtype* cvals; - N_Vector* Xvecs; - ARKodeARKStepMem step_mem; - - /* Access the stepper memory structure */ - if (!(ark_mem->step_mem)) - { - arkProcessError(ark_mem, ARK_MEM_NULL, "ARKODE::ARKStep", - "arkStep_RelaxDeltaY", MSG_ARKSTEP_NO_MEM); - return ARK_MEM_NULL; - } - step_mem = (ARKodeARKStepMem)(ark_mem->step_mem); - - /* Set arrays for fused vector operation */ - cvals = step_mem->cvals; - Xvecs = step_mem->Xvecs; - - nvec = 0; - for (i = 0; i < step_mem->stages; i++) - { - /* Explicit pieces */ - if (step_mem->explicit) - { - cvals[nvec] = ark_mem->h * step_mem->Be->b[i]; - Xvecs[nvec] = step_mem->Fe[i]; - nvec++; - } - /* Implicit pieces */ - if (step_mem->implicit) - { - cvals[nvec] = ark_mem->h * step_mem->Bi->b[i]; - Xvecs[nvec] = step_mem->Fi[i]; - nvec++; - } - } - - /* Compute time step update (delta_y) */ - retval = N_VLinearCombination(nvec, cvals, Xvecs, delta_y); - if (retval) return ARK_VECTOROP_ERR; - - if (step_mem->mass_type == MASS_FIXED) - { - /* Solve to compute update M^{-1} h * sum_j Ae[i,j] Fe[j] + Ai[i,j] Fi[j] */ - retval = step_mem->msolve((void *) ark_mem, delta_y, step_mem->nlscoef); - if (retval) { return ARK_MASSSOLVE_FAIL; } - } - - return ARK_SUCCESS; -} /* ----------------------------------------------------------------------------- * arkStep_RelaxDeltaE diff --git a/src/arkode/arkode_arkstep_impl.h b/src/arkode/arkode_arkstep_impl.h index 91ff0e6489..9121140da1 100644 --- a/src/arkode/arkode_arkstep_impl.h +++ b/src/arkode/arkode_arkstep_impl.h @@ -156,6 +156,8 @@ typedef struct ARKodeARKStepMemRec { realtype tscale; /* time normalization scaling */ N_Vector* forcing; /* array of forcing vectors */ int nforcing; /* number of forcing vectors */ + realtype* stage_times; /* workspace for applying forcing */ + realtype* stage_coefs; /* workspace for applying forcing */ } *ARKodeARKStepMem; @@ -205,8 +207,8 @@ int arkStep_NlsInit(ARKodeMem ark_mem); int arkStep_Nls(ARKodeMem ark_mem, int nflag); int arkStep_ComputeSolutions(ARKodeMem ark_mem, realtype *dsm); int arkStep_ComputeSolutions_MassFixed(ARKodeMem ark_mem, realtype *dsm); -void arkStep_ApplyForcing(ARKodeARKStepMem step_mem, realtype t, - realtype s, int *nvec); +void arkStep_ApplyForcing(ARKodeARKStepMem step_mem, realtype* stage_times, + realtype* stage_coefs, int jmax, int *nvec); /* private functions passed to nonlinear solver */ int arkStep_NlsResidual_MassIdent(N_Vector zcor, N_Vector r, void* arkode_mem); @@ -231,7 +233,6 @@ int arkStep_MRIStepInnerReset(MRIStepInnerStepper stepper, realtype tR, N_Vector yR); /* private functions for relaxation */ -int arkStep_RelaxDeltaY(ARKodeMem ark_mem, N_Vector delta_y); int arkStep_RelaxDeltaE(ARKodeMem ark_mem, ARKRelaxJacFn relax_jac_fn, long int* relax_jac_fn_evals, sunrealtype* delta_e_out); int arkStep_GetOrder(ARKodeMem ark_mem); diff --git a/src/arkode/arkode_arkstep_io.c b/src/arkode/arkode_arkstep_io.c index fc2df26f98..1151afd1bc 100644 --- a/src/arkode/arkode_arkstep_io.c +++ b/src/arkode/arkode_arkstep_io.c @@ -268,8 +268,8 @@ char *ARKStepGetLinReturnFlagName(long int flag) { int ARKStepSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac) { - return arkRelaxCreate(arkode_mem, rfn, rjac, arkStep_RelaxDeltaY, - arkStep_RelaxDeltaE, arkStep_GetOrder); + return arkRelaxCreate(arkode_mem, rfn, rjac, arkStep_RelaxDeltaE, + arkStep_GetOrder); } int ARKStepSetRelaxEtaFail(void* arkode_mem, sunrealtype eta_rf) diff --git a/src/arkode/arkode_butcher.c b/src/arkode/arkode_butcher.c index e16191fcb5..61a7cb342f 100644 --- a/src/arkode/arkode_butcher.c +++ b/src/arkode/arkode_butcher.c @@ -304,6 +304,20 @@ void ARKodeButcherTable_Write(ARKodeButcherTable B, FILE *outfile) } +sunbooleantype ARKodeButcherTable_IsStifflyAccurate(ARKodeButcherTable B) +{ + int i; + for (i = 0; i < B->stages; i++) + { + if (SUNRabs(B->b[i] - B->A[B->stages - 1][i]) > 100 * SUN_UNIT_ROUNDOFF) + { + return SUNFALSE; + } + } + return SUNTRUE; +} + + /*--------------------------------------------------------------- Routine to determine the analytical order of accuracy for a specified Butcher table. We check the analytical [necessary] diff --git a/src/arkode/arkode_erkstep.c b/src/arkode/arkode_erkstep.c index ebc413e576..4f1265358b 100644 --- a/src/arkode/arkode_erkstep.c +++ b/src/arkode/arkode_erkstep.c @@ -19,6 +19,7 @@ #include #include +#include "arkode/arkode_butcher.h" #include "arkode_impl.h" #include "arkode_erkstep_impl.h" #include "arkode_interp_impl.h" @@ -593,37 +594,42 @@ int erkStep_Init(void* arkode_mem, int init_type) } } - /* Signal to shared arkode module that fullrhs is required after each step */ + /* Signal to shared arkode module that full RHS evaluations are required */ ark_mem->call_fullrhs = SUNTRUE; return(ARK_SUCCESS); } -/*--------------------------------------------------------------- +/*------------------------------------------------------------------------------ erkStep_FullRHS: - This is just a wrapper to call the user-supplied RHS function, - f(t,y). + This is just a wrapper to call the user-supplied RHS function, f(t,y). This will be called in one of three 'modes': - ARK_FULLRHS_START -> called at the beginning of a simulation - or after post processing at step - ARK_FULLRHS_END -> called at the end of a successful step - ARK_FULLRHS_OTHER -> called elsewhere (e.g. for dense output) - - If it is called in ARK_FULLRHS_START mode, we store the vectors - f(t,y) in F[0] for possible reuse in the first stage of the - subsequent time step. - - If it is called in ARK_FULLRHS_END mode and the method coefficients - support it, we may just copy vectors F[stages] to fill f instead - of calling f(). - - ARK_FULLRHS_OTHER mode is only called for dense output in-between - steps, so we strive to store the intermediate parts so that they - do not interfere with the other two modes. - ---------------------------------------------------------------*/ + + ARK_FULLRHS_START -> called at the beginning of a simulation i.e., at + (tn, yn) = (t0, y0) or (tR, yR) + + ARK_FULLRHS_END -> called at the end of a successful step i.e, at + (tcur, ycur) or the start of the subsequent step i.e., + at (tn, yn) = (tcur, ycur) from the end of the last + step + + ARK_FULLRHS_OTHER -> called elsewhere (e.g. for dense output) + + If this function is called in ARK_FULLRHS_START or ARK_FULLRHS_END mode and + evaluating the RHS functions is necessary, we store the vector f(t,y) in Fe[0] + for reuse in the first stage of the subsequent time step. + + In ARK_FULLRHS_END mode we check if the method is "stiffly accurate" and, if + appropriate, copy the vector F[stages - 1] to F[0] for reuse in the first + stage of the subsequent time step. + + ARK_FULLRHS_OTHER mode is only called for dense output in-between steps, or + when estimating the initial time step size, so we strive to store the + intermediate parts so that they do not interfere with the other two modes. + ----------------------------------------------------------------------------*/ int erkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, int mode) { @@ -640,18 +646,19 @@ int erkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, /* perform RHS functions contingent on 'mode' argument */ switch(mode) { - /* ARK_FULLRHS_START: called at the beginning of a simulation - Store the vectors f(t,y) in F[0] for possible reuse - in the first stage of the subsequent time step */ case ARK_FULLRHS_START: - /* call f */ - retval = step_mem->f(t, y, step_mem->F[0], ark_mem->user_data); - step_mem->nfe++; - if (retval != 0) { - arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE::ERKStep", - "erkStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); - return(ARK_RHSFUNC_FAIL); + /* compute the RHS */ + if (!(ark_mem->fn_is_current)) + { + retval = step_mem->f(t, y, step_mem->F[0], ark_mem->user_data); + step_mem->nfe++; + if (retval != 0) + { + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE::ERKStep", + "erkStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); + return(ARK_RHSFUNC_FAIL); + } } /* copy RHS vector into output */ @@ -659,32 +666,33 @@ int erkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, break; - - /* ARK_FULLRHS_END: called at the end of a successful step - If the method coefficients support it, we just copy the last stage RHS - vectors to fill f instead of calling f(t,y). - Copy the results to F[0] if the coefficients support it. */ case ARK_FULLRHS_END: - /* determine if explicit RHS function needs to be recomputed */ - recomputeRHS = SUNFALSE; - if (SUNRabs(step_mem->B->c[step_mem->stages - 1] - ONE) > TINY) - recomputeRHS = SUNTRUE; + /* determine if RHS function needs to be recomputed */ + if (!(ark_mem->fn_is_current)) + { + recomputeRHS = !ARKodeButcherTable_IsStifflyAccurate(step_mem->B); - /* base RHS calls on recomputeRHS argument */ - if (recomputeRHS) { + /* First Same As Last methods are not FSAL when relaxation is enabled */ + if (ark_mem->relax_enabled) { recomputeRHS = SUNTRUE; } - /* call f */ - retval = step_mem->f(t, y, step_mem->F[0], ark_mem->user_data); - step_mem->nfe++; - if (retval != 0) { - arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE::ERKStep", + /* base RHS calls on recomputeRHS argument */ + if (recomputeRHS) + { + /* call f */ + retval = step_mem->f(t, y, step_mem->F[0], ark_mem->user_data); + step_mem->nfe++; + if (retval != 0) + { + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE::ERKStep", "erkStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); - return(ARK_RHSFUNC_FAIL); + return(ARK_RHSFUNC_FAIL); + } + } + else + { + N_VScale(ONE, step_mem->F[step_mem->stages-1], step_mem->F[0]); } - - } else { - N_VScale(ONE, step_mem->F[step_mem->stages-1], step_mem->F[0]); } /* copy RHS vector into output */ @@ -692,9 +700,6 @@ int erkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, break; - /* ARK_FULLRHS_OTHER: called for dense output in-between steps - store the intermediate calculations in such a way as to not - interfere with the other two modes */ case ARK_FULLRHS_OTHER: /* call f */ @@ -741,7 +746,7 @@ int erkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, ---------------------------------------------------------------*/ int erkStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) { - int retval, is, js, nvec; + int retval, is, js, nvec, mode; realtype* cvals; N_Vector* Xvecs; ARKodeMem ark_mem; @@ -777,6 +782,21 @@ int erkStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) N_VPrintFile(step_mem->F[0], ARK_LOGGER->debug_fp); #endif + /* Call the full RHS if needed. If this is the first step then we may need to + evaluate or copy the RHS values from an earlier evaluation (e.g., to + compute h0). For subsequent steps treat this RHS evaluation as an + evaluation at the end of the just completed step to potentially reuse + (FSAL methods) RHS evaluations from the end of the last step. */ + + if (!(ark_mem->fn_is_current)) + { + mode = (ark_mem->initsetup) ? ARK_FULLRHS_START : ARK_FULLRHS_END; + retval = ark_mem->step_fullrhs(ark_mem, ark_mem->tn, ark_mem->yn, + ark_mem->fn, mode); + if (retval) { return ARK_RHSFUNC_FAIL; } + ark_mem->fn_is_current = SUNTRUE; + } + /* Loop over internal stages to the step; since the method is explicit the first stage RHS is just the full RHS from the start of the step */ for (is=1; isstages; is++) { @@ -1174,46 +1194,6 @@ int erkStep_ComputeSolutions(ARKodeMem ark_mem, realtype *dsmPtr) return(ARK_SUCCESS); } -/* ----------------------------------------------------------------------------- - * erkStep_RelaxDeltaY - * - * Computes the RK update to yn for use in relaxation methods - * ---------------------------------------------------------------------------*/ - -int erkStep_RelaxDeltaY(ARKodeMem ark_mem, N_Vector delta_y) -{ - int i, nvec, retval; - realtype* cvals; - N_Vector* Xvecs; - ARKodeERKStepMem step_mem; - - /* Access the stepper memory structure */ - if (!(ark_mem->step_mem)) - { - arkProcessError(ark_mem, ARK_MEM_NULL, "ARKODE::ERKStep", - "erkStep_RelaxDeltaY", MSG_ERKSTEP_NO_MEM); - return ARK_MEM_NULL; - } - step_mem = (ARKodeERKStepMem)(ark_mem->step_mem); - - /* Set arrays for fused vector operation */ - cvals = step_mem->cvals; - Xvecs = step_mem->Xvecs; - - nvec = 0; - for (i = 0; i < step_mem->stages; i++) - { - cvals[nvec] = ark_mem->h * step_mem->B->b[i]; - Xvecs[nvec] = step_mem->F[i]; - nvec++; - } - - /* Compute time step update (delta_y) */ - retval = N_VLinearCombination(nvec, cvals, Xvecs, delta_y); - if (retval) return ARK_VECTOROP_ERR; - - return ARK_SUCCESS; -} /* ----------------------------------------------------------------------------- * erkStep_RelaxDeltaE diff --git a/src/arkode/arkode_erkstep_impl.h b/src/arkode/arkode_erkstep_impl.h index f3684d9d39..236e1779ac 100644 --- a/src/arkode/arkode_erkstep_impl.h +++ b/src/arkode/arkode_erkstep_impl.h @@ -84,7 +84,6 @@ int erkStep_CheckButcherTable(ARKodeMem ark_mem); int erkStep_ComputeSolutions(ARKodeMem ark_mem, realtype *dsm); /* private functions for relaxation */ -int erkStep_RelaxDeltaY(ARKodeMem ark_mem, N_Vector delta_y); int erkStep_RelaxDeltaE(ARKodeMem ark_mem, ARKRelaxJacFn relax_jac_fn, long int* relax_jac_fn_evals, sunrealtype* delta_e_out); int erkStep_GetOrder(ARKodeMem ark_mem); diff --git a/src/arkode/arkode_erkstep_io.c b/src/arkode/arkode_erkstep_io.c index 34bb7d46c2..15845101cc 100644 --- a/src/arkode/arkode_erkstep_io.c +++ b/src/arkode/arkode_erkstep_io.c @@ -159,8 +159,8 @@ char *ERKStepGetReturnFlagName(long int flag) { int ERKStepSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac) { - return arkRelaxCreate(arkode_mem, rfn, rjac, erkStep_RelaxDeltaY, - erkStep_RelaxDeltaE, erkStep_GetOrder); + return arkRelaxCreate(arkode_mem, rfn, rjac, erkStep_RelaxDeltaE, + erkStep_GetOrder); } int ERKStepSetRelaxEtaFail(void* arkode_mem, sunrealtype eta_rf) diff --git a/src/arkode/arkode_impl.h b/src/arkode/arkode_impl.h index 32c73219ee..e4285b6120 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -330,15 +330,17 @@ struct ARKodeMemRec void *step_mem; /* N_Vector storage */ - N_Vector ewt; /* error weight vector */ - N_Vector rwt; /* residual weight vector */ - booleantype rwt_is_ewt; /* SUNTRUE if rwt is a pointer to ewt */ - N_Vector ycur; /* pointer to user-provided solution memory; used - as evolving solution by the timestepper modules */ - N_Vector yn; /* solution from the last successful step */ - N_Vector fn; /* full IVP right-hand side from last step */ - N_Vector tempv1; /* temporary storage vectors (for local use and by */ - N_Vector tempv2; /* time-stepping modules) */ + N_Vector ewt; /* error weight vector */ + N_Vector rwt; /* residual weight vector */ + booleantype rwt_is_ewt; /* SUNTRUE if rwt is a pointer to ewt */ + N_Vector ycur; /* pointer to user-provided solution memory; + used as evolving solution by the time stepper + modules */ + N_Vector yn; /* solution from the last successful step */ + N_Vector fn; /* full IVP right-hand side from last step */ + sunbooleantype fn_is_current; /* SUNTRUE if fn has been evaluated at yn */ + N_Vector tempv1; /* temporary storage vectors (for local use */ + N_Vector tempv2; /* and by time-stepping modules) */ N_Vector tempv3; N_Vector tempv4; @@ -346,6 +348,7 @@ struct ARKodeMemRec /* Temporal interpolation module */ ARKInterp interp; + int interp_type; /* Tstop information */ booleantype tstopset; @@ -409,7 +412,7 @@ struct ARKodeMemRec int init_type; /* initialization type (see constants above) */ booleantype firststage; /* denotes first stage in simulation */ booleantype initialized; /* denotes arkInitialSetup has been done */ - booleantype call_fullrhs; /* denotes fn needs updating after each step */ + booleantype call_fullrhs; /* denotes the full RHS fn will be called */ /* Error handler function and error ouput file */ ARKErrHandlerFn ehfun; /* error messages are handled by ehfun */ @@ -804,13 +807,29 @@ struct ARKodeMemRec ODE RHS function supplied (e.g. ERK, DIRK, IRK), or it may be the sum of many ODE RHS functions (e.g. ARK, MRI). The 'mode' indicates where this routine is called: + ARK_FULLRHS_START -> called at the beginning of a simulation - ARK_FULLRHS_END -> called at the end of a successful step + i.e., at (tn, yn) = (t0, y0) or (tR, yR) + + ARK_FULLRHS_END -> called at the end of a successful step i.e, + at (tcur, ycur) or the start of the subsequent + step i.e., at (tn, yn) = (tcur, ycur) from + the end of the last step + ARK_FULLRHS_OTHER -> called elsewhere (e.g. for dense output) + It is recommended that the stepper use the mode information to maximize reuse between calls to this function and RHS evaluations inside the stepper itself. + This routine is only required to be supplied to ARKODE if: + * ARKODE's initial time step selection algorithm is used, + * the user requests temporal root-finding, + * the Hermite interpolation module is used, or + * the user requests the "bootstrap" implicit predictor. + Note that any stepper can itself require that this routine + exist for its own internal business (e.g., ERKStep). + This routine should return 0 if successful, and a negative value otherwise. If an error does occur, an appropriate message should be sent to the error handler function. @@ -1154,6 +1173,8 @@ int arkGetLastKFlag(void *arkode_mem, int *last_kflag); #define MSG_ARK_POSTPROCESS_STAGE_FAIL "At " MSG_TIME ", the stage postprocessing routine failed in an unrecoverable manner." #define MSG_ARK_NULL_SUNCTX "sunctx = NULL illegal." #define MSG_ARK_CONTEXT_MISMATCH "Outer and inner steppers have different contexts." +#define MSG_ARK_MISSING_FULLRHS "Time-stepping module missing fullrhs routine (required by requested solver configuration)." +#define MSG_ARK_INTERPOLATION_FAIL "At " MSG_TIME ", interpolating the solution failed." #ifdef __cplusplus } diff --git a/src/arkode/arkode_interp.c b/src/arkode/arkode_interp.c index 30ee7aece8..9854194c3f 100644 --- a/src/arkode/arkode_interp.c +++ b/src/arkode/arkode_interp.c @@ -150,10 +150,6 @@ ARKInterp arkInterpCreate_Hermite(void* arkode_mem, int degree) /* set maximum interpolant degree */ content->degree = SUNMIN(ARK_INTERP_MAX_DEGREE, degree); - /* set ynew and fnew pointers to ark_mem->yn and ark_mem->fn, respectively */ - content->ynew = ark_mem->yn; - content->fnew = ark_mem->fn; - /* update workspace sizes */ ark_mem->lrw += 2; ark_mem->liw += 5; @@ -202,10 +198,6 @@ int arkInterpResize_Hermite(void* arkode_mem, ARKInterp interp, liw_diff, y0, &HINT_FB(interp))) return(ARK_MEM_FAIL); - /* update ynew and fnew pointers */ - HINT_YNEW(interp) = ark_mem->yn; - HINT_FNEW(interp) = ark_mem->fn; - /* reinitialize time values */ HINT_TOLD(interp) = ark_mem->tcur; HINT_TNEW(interp) = ark_mem->tcur; @@ -286,12 +278,8 @@ void arkInterpPrintMem_Hermite(ARKInterp interp, FILE *outfile) #ifdef SUNDIALS_DEBUG_PRINTVEC fprintf(outfile, "arkode_interp (Hermite): fold:\n"); N_VPrintFile(HINT_FOLD(interp), outfile); - fprintf(outfile, "arkode_interp (Hermite): fnew:\n"); - N_VPrintFile(HINT_FNEW(interp), outfile); fprintf(outfile, "arkode_interp (Hermite): yold:\n"); N_VPrintFile(HINT_YOLD(interp), outfile); - fprintf(outfile, "arkode_interp (Hermite): ynew:\n"); - N_VPrintFile(HINT_YNEW(interp), outfile); fprintf(outfile, "arkode_interp (Hermite): fa:\n"); N_VPrintFile(HINT_FA(interp), outfile); fprintf(outfile, "arkode_interp (Hermite): fb:\n"); @@ -402,13 +390,7 @@ int arkInterpInit_Hermite(void* arkode_mem, ARKInterp interp, } } - /* copy current solution into yold */ - N_VScale(ONE, ark_mem->yn, HINT_YOLD(interp)); - - /* copy fnew into fold */ - N_VScale(ONE, HINT_FNEW(interp), HINT_FOLD(interp)); - - /* signal that fullrhs is required after each step */ + /* signal that a full RHS data is required for interpolation */ ark_mem->call_fullrhs = SUNTRUE; /* return with success */ @@ -424,15 +406,26 @@ int arkInterpInit_Hermite(void* arkode_mem, ARKInterp interp, ---------------------------------------------------------------*/ int arkInterpUpdate_Hermite(void* arkode_mem, ARKInterp interp, realtype tnew) { + int retval; ARKodeMem ark_mem; /* access ARKodeMem structure */ if (arkode_mem == NULL) return(ARK_MEM_NULL); ark_mem = (ARKodeMem) arkode_mem; + /* call full RHS if needed -- called just BEFORE the end of a step, so yn has + NOT been updated to ycur yet */ + if (!(ark_mem->fn_is_current)) + { + retval = ark_mem->step_fullrhs(ark_mem, ark_mem->tn, ark_mem->yn, + ark_mem->fn, ARK_FULLRHS_START); + if (retval) { return ARK_RHSFUNC_FAIL; } + ark_mem->fn_is_current = SUNTRUE; + } + /* copy ynew and fnew into yold and fold, respectively */ - N_VScale(ONE, HINT_YNEW(interp), HINT_YOLD(interp)); - N_VScale(ONE, HINT_FNEW(interp), HINT_FOLD(interp)); + N_VScale(ONE, ark_mem->yn, HINT_YOLD(interp)); + N_VScale(ONE, ark_mem->fn, HINT_FOLD(interp)); /* update time values */ HINT_TOLD(interp) = HINT_TNEW(interp); @@ -510,6 +503,16 @@ int arkInterpEvaluate_Hermite(void* arkode_mem, ARKInterp interp, "tau = %"RSYM", d = %i, q = %i", tau, d, q); #endif + /* call full RHS if needed -- called just AFTER the end of a step, so yn has + been updated to ycur */ + if (!(ark_mem->fn_is_current)) + { + retval = ark_mem->step_fullrhs(ark_mem, ark_mem->tn, ark_mem->yn, + ark_mem->fn, ARK_FULLRHS_END); + if (retval) { return ARK_RHSFUNC_FAIL; } + ark_mem->fn_is_current = SUNTRUE; + } + /* error on illegal d */ if (d < 0) { arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE", @@ -528,7 +531,7 @@ int arkInterpEvaluate_Hermite(void* arkode_mem, ARKInterp interp, switch (q) { case(0): /* constant interpolant, yout = 0.5*(yn+yp) */ - N_VLinearSum(HALF, HINT_YOLD(interp), HALF, HINT_YNEW(interp), yout); + N_VLinearSum(HALF, HINT_YOLD(interp), HALF, ark_mem->yn, yout); break; case(1): /* linear interpolant */ @@ -539,7 +542,7 @@ int arkInterpEvaluate_Hermite(void* arkode_mem, ARKInterp interp, a0 = -ONE/h; a1 = ONE/h; } - N_VLinearSum(a0, HINT_YOLD(interp), a1, HINT_YNEW(interp), yout); + N_VLinearSum(a0, HINT_YOLD(interp), a1, ark_mem->yn, yout); break; case(2): /* quadratic interpolant */ @@ -557,8 +560,8 @@ int arkInterpEvaluate_Hermite(void* arkode_mem, ARKInterp interp, a[2] = TWO/h; } X[0] = HINT_YOLD(interp); - X[1] = HINT_YNEW(interp); - X[2] = HINT_FNEW(interp); + X[1] = ark_mem->yn; + X[2] = ark_mem->fn; retval = N_VLinearCombination(3, a, X, yout); if (retval != 0) return(ARK_VECTOROP_ERR); break; @@ -586,9 +589,9 @@ int arkInterpEvaluate_Hermite(void* arkode_mem, ARKInterp interp, a[3] = SIX/h2; } X[0] = HINT_YOLD(interp); - X[1] = HINT_YNEW(interp); + X[1] = ark_mem->yn; X[2] = HINT_FOLD(interp); - X[3] = HINT_FNEW(interp); + X[3] = ark_mem->fn; retval = N_VLinearCombination(4, a, X, yout); if (retval != 0) return(ARK_VECTOROP_ERR); break; @@ -639,9 +642,9 @@ int arkInterpEvaluate_Hermite(void* arkode_mem, ARKInterp interp, a[4] = -RCONST(162.0)/h3; } X[0] = HINT_YOLD(interp); - X[1] = HINT_YNEW(interp); + X[1] = ark_mem->yn; X[2] = HINT_FOLD(interp); - X[3] = HINT_FNEW(interp); + X[3] = ark_mem->fn; X[4] = HINT_FA(interp); retval = N_VLinearCombination(5, a, X, yout); if (retval != 0) return(ARK_VECTOROP_ERR); @@ -716,9 +719,9 @@ int arkInterpEvaluate_Hermite(void* arkode_mem, ARKInterp interp, a[5] = a[4]; } X[0] = HINT_YOLD(interp); - X[1] = HINT_YNEW(interp); + X[1] = ark_mem->yn; X[2] = HINT_FOLD(interp); - X[3] = HINT_FNEW(interp); + X[3] = ark_mem->fn; X[4] = HINT_FA(interp); X[5] = HINT_FB(interp); retval = N_VLinearCombination(6, a, X, yout); @@ -1052,7 +1055,7 @@ int arkInterpInit_Lagrange(void* arkode_mem, ARKInterp I, } } - /* update allocated size if necesary */ + /* update allocated size if necessary */ if (LINT_NMAX(I) > LINT_NMAXALLOC(I)) LINT_NMAXALLOC(I) = LINT_NMAX(I); diff --git a/src/arkode/arkode_interp_impl.h b/src/arkode/arkode_interp_impl.h index 75a4696704..7c8794ff82 100644 --- a/src/arkode/arkode_interp_impl.h +++ b/src/arkode/arkode_interp_impl.h @@ -47,9 +47,7 @@ extern "C" { struct _ARKInterpContent_Hermite { int degree; /* maximum interpolant degree to use */ N_Vector fold; /* f(t,y) at beginning of last successful step */ - N_Vector fnew; /* f(t,y) at end of last successful step */ N_Vector yold; /* y at beginning of last successful step */ - N_Vector ynew; /* y at end of last successful step */ N_Vector fa; /* f(t,y) used in higher-order interpolation */ N_Vector fb; /* f(t,y) used in higher-order interpolation */ realtype told; /* t at beginning of last successful step */ @@ -65,9 +63,7 @@ typedef struct _ARKInterpContent_Hermite *ARKInterpContent_Hermite; #define HINT_CONTENT(I) ( (ARKInterpContent_Hermite)(I->content) ) #define HINT_DEGREE(I) ( HINT_CONTENT(I)->degree ) #define HINT_FOLD(I) ( HINT_CONTENT(I)->fold ) -#define HINT_FNEW(I) ( HINT_CONTENT(I)->fnew ) #define HINT_YOLD(I) ( HINT_CONTENT(I)->yold ) -#define HINT_YNEW(I) ( HINT_CONTENT(I)->ynew ) #define HINT_FA(I) ( HINT_CONTENT(I)->fa ) #define HINT_FB(I) ( HINT_CONTENT(I)->fb ) #define HINT_TOLD(I) ( HINT_CONTENT(I)->told ) diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index 60e6d04187..af230fb8e0 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -158,12 +158,20 @@ int arkSetInterpolantType(void *arkode_mem, int itype) /* create requested interpolation module, initially specifying the maximum possible interpolant degree. */ - if (itype == ARK_INTERP_HERMITE) { + if (itype == ARK_INTERP_HERMITE) + { ark_mem->interp = arkInterpCreate_Hermite(arkode_mem, ARK_INTERP_MAX_DEGREE); - } else if (itype == ARK_INTERP_LAGRANGE) { + ark_mem->interp_type = ARK_INTERP_HERMITE; + } + else if (itype == ARK_INTERP_LAGRANGE) + { ark_mem->interp = arkInterpCreate_Lagrange(arkode_mem, ARK_INTERP_MAX_DEGREE); - } else { + ark_mem->interp_type = ARK_INTERP_LAGRANGE; + } + else + { ark_mem->interp = NULL; + ark_mem->interp_type = -1; } if (ark_mem->interp == NULL) { arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", "arkSetInterpolantType", diff --git a/src/arkode/arkode_mri_tables.c b/src/arkode/arkode_mri_tables.c index b1fc0723d6..5552ec6cbf 100644 --- a/src/arkode/arkode_mri_tables.c +++ b/src/arkode/arkode_mri_tables.c @@ -62,8 +62,8 @@ MRIStepCoupling MRIStepCoupling_LoadTableByName(const char *method) #undef ARK_MRI_TABLE arkProcessError(NULL, ARK_ILL_INPUT, "ARKODE", - "MRIStepCoupling_LoadTable", - "Unknown coupling table"); + "MRIStepCoupling_LoadTable", + "Unknown coupling table"); return NULL; } @@ -461,7 +461,8 @@ void MRIStepCoupling_Write(MRIStepCoupling MRIC, FILE *outfile) /* check for vaild coupling structure */ if (!MRIC) return; - if (!(MRIC->G)) return; + if (!(MRIC->W) && !(MRIC->G)) return; + if (!(MRIC->c)) return; if (MRIC->W) { for (i = 0; i < MRIC->nmat; i++) { @@ -479,13 +480,10 @@ void MRIStepCoupling_Write(MRIStepCoupling MRIC, FILE *outfile) } } - if (!(MRIC->c)) return; - fprintf(outfile, " nmat = %i\n", MRIC->nmat); fprintf(outfile, " stages = %i\n", MRIC->stages); fprintf(outfile, " method order (q) = %i\n", MRIC->q); fprintf(outfile, " embedding order (p) = %i\n", MRIC->p); - fprintf(outfile, " c = "); for (i = 0; i < MRIC->stages; i++) fprintf(outfile, "%"RSYM" ", MRIC->c[i]); diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index 11e74e86a5..f6af65c193 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -965,7 +965,6 @@ int mriStep_GetGammas(void* arkode_mem, realtype *gamma, - sets/checks the ARK Butcher tables to be used - allocates any memory that depends on the number of ARK stages, method order, or solver options - - sets the call_fullrhs flag With other initialization types, this routine does nothing. ---------------------------------------------------------------*/ @@ -1207,37 +1206,39 @@ int mriStep_Init(void* arkode_mem, int init_type) } } - /* Signal to shared arkode module that fullrhs is required after each step */ - ark_mem->call_fullrhs = SUNTRUE; - return(ARK_SUCCESS); } -/*--------------------------------------------------------------- +/*------------------------------------------------------------------------------ mriStep_FullRHS: This is just a wrapper to call the user-supplied RHS functions, f(t,y) = fse(t,y) + fsi(t,y) + ff(t,y). This will be called in one of three 'modes': - ARK_FULLRHS_START -> called at the beginning of a simulation - or after post processing at step - ARK_FULLRHS_END -> called at the end of a successful step - ARK_FULLRHS_OTHER -> called elsewhere (e.g. for dense output) - If it is called in ARK_FULLRHS_START mode, we store the vectors - f(t,y) in F[0] for possible reuse in the first stage of the + ARK_FULLRHS_START -> called at the beginning of a simulation i.e., at + (tn, yn) = (t0, y0) or (tR, yR) + + ARK_FULLRHS_END -> called at the end of a successful step i.e, at + (tcur, ycur) or the start of the subsequent step i.e., + at (tn, yn) = (tcur, ycur) from the end of the last + step + + ARK_FULLRHS_OTHER -> called elsewhere (e.g. for dense output) + + If this function is called in ARK_FULLRHS_START or ARK_FULLRHS_END mode and + evaluating the RHS functions is necessary, we store the vectors fse(t,y) and + fsi(t,y) in Fse[0] and Fsi[0] for possible reuse in the first stage of the subsequent time step. - If it is called in ARK_FULLRHS_END mode, we reevauate f(t,y). At - this time no checks are made to see if the method coefficient - support copying vectors F[stages] to fill f instead of calling f(). + ARK_FULLRHS_OTHER mode is only called for dense output in-between steps, or + when estimating the initial time step size, so we strive to store the + intermediate parts so that they do not interfere with the other two modes. - ARK_FULLRHS_OTHER mode is only called for dense output in-between - steps, so we strive to store the intermediate parts so that they - do not interfere with the other two modes. - ---------------------------------------------------------------*/ + Presently ff(t,y) is always called with ARK_FULLRHS_OTHER mode. + ----------------------------------------------------------------------------*/ int mriStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, int mode) { @@ -1250,115 +1251,144 @@ int mriStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) return(retval); + /* ensure that inner stepper provides fullrhs function */ + if (!(step_mem->stepper->ops->fullrhs)) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE::MRIStep", + "mriStep_FullRHS", MSG_ARK_MISSING_FULLRHS); + return ARK_ILL_INPUT; + } + /* perform RHS functions contingent on 'mode' argument */ switch(mode) { - /* ARK_FULLRHS_START: called at the beginning of a simulation - Store the vector fs(t,y) in F[0] for possible reuse - in the first stage of the subsequent time step */ case ARK_FULLRHS_START: - /* call fse if the problem has an explicit component */ - if (step_mem->explicit_rhs) { - retval = step_mem->fse(t, y, step_mem->Fse[0], ark_mem->user_data); - step_mem->nfse++; - if (retval != 0) { - arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE::MRIStep", - "mriStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); - return(ARK_RHSFUNC_FAIL); + /* compute the full RHS */ + if (!(ark_mem->fn_is_current)) + { + /* compute the explicit component */ + if (step_mem->explicit_rhs) + { + retval = step_mem->fse(t, y, step_mem->Fse[0], ark_mem->user_data); + step_mem->nfse++; + if (retval != 0) + { + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE::MRIStep", + "mriStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); + return(ARK_RHSFUNC_FAIL); + } } - } - /* call fsi if the problem has an implicit component */ - if (step_mem->implicit_rhs) { - retval = step_mem->fsi(t, y, step_mem->Fsi[0], ark_mem->user_data); - step_mem->nfsi++; - if (retval != 0) { + /* compute the implicit component */ + if (step_mem->implicit_rhs) + { + retval = step_mem->fsi(t, y, step_mem->Fsi[0], ark_mem->user_data); + step_mem->nfsi++; + if (retval != 0) + { + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE::MRIStep", + "mriStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); + return(ARK_RHSFUNC_FAIL); + } + } + + /* compute the fast component (force new RHS computation) */ + retval = mriStepInnerStepper_FullRhs(step_mem->stepper, t, y, f, + ARK_FULLRHS_OTHER); + if (retval != ARK_SUCCESS) + { arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE::MRIStep", "mriStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); return(ARK_RHSFUNC_FAIL); } } - /* call ff (force new RHS computation) */ - retval = mriStepInnerStepper_FullRhs(step_mem->stepper, t, y, f, - ARK_FULLRHS_OTHER); - if (retval != ARK_SUCCESS) { - arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE::MRIStep", - "mriStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); - return(ARK_RHSFUNC_FAIL); - } - /* combine RHS vectors into output */ - if (step_mem->explicit_rhs && step_mem->implicit_rhs) { /* ImEx */ + if (step_mem->explicit_rhs && step_mem->implicit_rhs) + { + /* ImEx */ N_VLinearSum(ONE, step_mem->Fse[0], ONE, f, f); N_VLinearSum(ONE, step_mem->Fsi[0], ONE, f, f); - } else { - if (step_mem->implicit_rhs) { /* implicit */ - N_VLinearSum(ONE, step_mem->Fsi[0], ONE, f, f); - } else { /* explicit */ - N_VLinearSum(ONE, step_mem->Fse[0], ONE, f, f); - } + } + else if (step_mem->implicit_rhs) + { + /* implicit */ + N_VLinearSum(ONE, step_mem->Fsi[0], ONE, f, f); + } + else + { + /* explicit */ + N_VLinearSum(ONE, step_mem->Fse[0], ONE, f, f); } break; - - /* ARK_FULLRHS_END: called at the end of a successful step - This always recomputes the full RHS (i.e., this is the - same as case 0). */ case ARK_FULLRHS_END: - /* call fse if the problem has an explicit component */ - if (step_mem->explicit_rhs) { - retval = step_mem->fse(t, y, step_mem->Fse[0], ark_mem->user_data); - step_mem->nfse++; - if (retval != 0) { - arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE::MRIStep", - "mriStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); - return(ARK_RHSFUNC_FAIL); + /* compute the full RHS */ + if (!(ark_mem->fn_is_current)) + { + /* compute the explicit component */ + if (step_mem->explicit_rhs) + { + retval = step_mem->fse(t, y, step_mem->Fse[0], ark_mem->user_data); + step_mem->nfse++; + if (retval != 0) + { + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE::MRIStep", + "mriStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); + return(ARK_RHSFUNC_FAIL); + } } - } - /* call fsi if the problem has an implicit component */ - if (step_mem->implicit_rhs) { - retval = step_mem->fsi(t, y, step_mem->Fsi[0], ark_mem->user_data); - step_mem->nfsi++; - if (retval != 0) { + /* compute the implicit component */ + if (step_mem->implicit_rhs) + { + retval = step_mem->fsi(t, y, step_mem->Fsi[0], ark_mem->user_data); + step_mem->nfsi++; + if (retval != 0) + { + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE::MRIStep", + "mriStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); + return(ARK_RHSFUNC_FAIL); + } + } + + /* compute the fast component (force new RHS computation) */ + retval = mriStepInnerStepper_FullRhs(step_mem->stepper, t, y, f, + ARK_FULLRHS_OTHER); + if (retval != ARK_SUCCESS) + { arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE::MRIStep", "mriStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); return(ARK_RHSFUNC_FAIL); } } - /* call ff (force new RHS computation) */ - retval = mriStepInnerStepper_FullRhs(step_mem->stepper, t, y, f, - ARK_FULLRHS_OTHER); - if (retval != ARK_SUCCESS) { - arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, "ARKODE::MRIStep", - "mriStep_FullRHS", MSG_ARK_RHSFUNC_FAILED, t); - return(ARK_RHSFUNC_FAIL); - } - /* combine RHS vectors into output */ - if (step_mem->explicit_rhs && step_mem->implicit_rhs) { /* ImEx */ + if (step_mem->explicit_rhs && step_mem->implicit_rhs) + { + /* ImEx */ N_VLinearSum(ONE, step_mem->Fse[0], ONE, f, f); N_VLinearSum(ONE, step_mem->Fsi[0], ONE, f, f); - } else { - if (step_mem->implicit_rhs) { /* implicit */ - N_VLinearSum(ONE, step_mem->Fsi[0], ONE, f, f); - } else { /* explicit */ - N_VLinearSum(ONE, step_mem->Fse[0], ONE, f, f); - } } + else if (step_mem->implicit_rhs) + { + /* implicit */ + N_VLinearSum(ONE, step_mem->Fsi[0], ONE, f, f); + } + else + { + /* explicit */ + N_VLinearSum(ONE, step_mem->Fse[0], ONE, f, f); + } + break; - /* ARK_FULLRHS_OTHER: called for dense output in-between steps - store the intermediate calculations in such a way as to not - interfere with the other two modes */ case ARK_FULLRHS_OTHER: - /* call fse if the problem has an explicit component (store in ark_tempv2) */ + /* compute the explicit component and store in ark_tempv2 */ if (step_mem->explicit_rhs) { retval = step_mem->fse(t, y, ark_mem->tempv2, ark_mem->user_data); step_mem->nfse++; @@ -1369,7 +1399,7 @@ int mriStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, } } - /* call fsi if the problem has an implicit component (store in sdata) */ + /* compute the implicit component and store in sdata */ if (step_mem->implicit_rhs) { retval = step_mem->fsi(t, y, step_mem->sdata, ark_mem->user_data); step_mem->nfsi++; @@ -1381,7 +1411,7 @@ int mriStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, } - /* call ff (force new RHS computation) */ + /* compute the fast component (force new RHS computation) */ retval = mriStepInnerStepper_FullRhs(step_mem->stepper, t, y, f, ARK_FULLRHS_OTHER); if (retval != ARK_SUCCESS) { @@ -1391,15 +1421,21 @@ int mriStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, } /* combine RHS vectors into output */ - if (step_mem->explicit_rhs && step_mem->implicit_rhs) { /* ImEx */ + if (step_mem->explicit_rhs && step_mem->implicit_rhs) + { + /* ImEx */ N_VLinearSum(ONE, ark_mem->tempv2, ONE, f, f); N_VLinearSum(ONE, step_mem->sdata, ONE, f, f); - } else { /* implicit */ - if (step_mem->implicit_rhs) { - N_VLinearSum(ONE, step_mem->sdata, ONE, f, f); - } else { /* explicit */ - N_VLinearSum(ONE, ark_mem->tempv2, ONE, f, f); - } + } + else if (step_mem->implicit_rhs) + { + /* implicit */ + N_VLinearSum(ONE, step_mem->sdata, ONE, f, f); + } + else + { + /* explicit */ + N_VLinearSum(ONE, ark_mem->tempv2, ONE, f, f); } break; @@ -1457,6 +1493,45 @@ int mriStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) &ark_mem, &step_mem); if (retval != ARK_SUCCESS) return(retval); + /* call nonlinear solver setup if it exists */ + if (step_mem->NLS) + { + if ((step_mem->NLS)->ops->setup) { + N_VConst(ZERO, ark_mem->tempv3); /* set guess to 0 for predictor-corrector form */ + retval = SUNNonlinSolSetup(step_mem->NLS, ark_mem->tempv3, ark_mem); + if (retval < 0) return(ARK_NLS_SETUP_FAIL); + if (retval > 0) return(ARK_NLS_SETUP_RECVR); + } + } + + /* Evaluate the slow RHS functions if needed. NOTE: We do not use the full RHS + function here (unlike ERKStep and ARKStep) since it does not need to check + for FSAL or SA methods and thus avoids potentially unnecessary evaluations + of the inner (fast) RHS function */ + + if (!(ark_mem->fn_is_current)) + { + /* compute the explicit component */ + if (step_mem->explicit_rhs) + { + retval = step_mem->fse(ark_mem->tn, ark_mem->yn, step_mem->Fse[0], + ark_mem->user_data); + step_mem->nfse++; + if (retval) { return ARK_RHSFUNC_FAIL; } + } + + /* compute the implicit component */ + if (step_mem->implicit_rhs) + { + retval = step_mem->fsi(ark_mem->tn, ark_mem->yn, step_mem->Fsi[0], + ark_mem->user_data); + step_mem->nfsi++; + if (retval) { return ARK_RHSFUNC_FAIL; } + } + + ark_mem->fn_is_current = SUNTRUE; + } + #ifdef SUNDIALS_DEBUG printf(" MRIStep step %li, stage 0, h = %"RSYM", t_n = %"RSYM"\n", ark_mem->nst, ark_mem->h, ark_mem->tcur); @@ -1484,15 +1559,6 @@ int mriStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) } #endif - /* call nonlinear solver setup if it exists */ - if (step_mem->NLS) - if ((step_mem->NLS)->ops->setup) { - N_VConst(ZERO, ark_mem->tempv3); /* set guess to 0 for predictor-corrector form */ - retval = SUNNonlinSolSetup(step_mem->NLS, ark_mem->tempv3, ark_mem); - if (retval < 0) return(ARK_NLS_SETUP_FAIL); - if (retval > 0) return(ARK_NLS_SETUP_RECVR); - } - /* The first stage is the previous time-step solution, so its RHS is the [already-computed] slow RHS from the start of the step */ @@ -1510,8 +1576,8 @@ int mriStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, "ARKODE::mriStep_TakeStep", "start-stage", - "step = %li, stage = %i, h = %"RSYM", tcur = %"RSYM, - ark_mem->nst, is, ark_mem->h, ark_mem->tcur); + "step = %li, stage = %i, stage type = %d, h = %"RSYM", tcur = %"RSYM, + ark_mem->nst, is, step_mem->stagetypes[is], ark_mem->h, ark_mem->tcur); #endif /* Determine current stage type, and call corresponding routine; the @@ -2729,7 +2795,7 @@ int mriStepInnerStepper_HasRequiredOps(MRIStepInnerStepper stepper) if (stepper == NULL) return ARK_ILL_INPUT; if (stepper->ops == NULL) return ARK_ILL_INPUT; - if (stepper->ops->evolve && stepper->ops->fullrhs) + if (stepper->ops->evolve) return ARK_SUCCESS; else return ARK_ILL_INPUT; diff --git a/src/arkode/arkode_relaxation.c b/src/arkode/arkode_relaxation.c index cc9fb5d0b8..4badc7cb70 100644 --- a/src/arkode/arkode_relaxation.c +++ b/src/arkode/arkode_relaxation.c @@ -122,6 +122,13 @@ static int arkRelaxNewtonSolve(ARKodeMem ark_mem) ark_mem); if (retval) return retval; +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::arkRelaxNewtonSolve", "residual", + "iter = %i, relax_param = %"RSYM", residual = %"RSYM, + i, relax_mem->relax_param, relax_mem->res); +#endif + /* Check for convergence */ if (SUNRabs(relax_mem->res) < relax_mem->res_tol) { return ARK_SUCCESS; } @@ -344,9 +351,21 @@ int arkRelaxSolve(ARKodeMem ark_mem, ARKodeRelaxMem relax_mem, &(relax_mem->delta_e)); if (retval) return retval; +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::arkRelaxSolve", "compute delta e", + "delta_e = %"RSYM, relax_mem->delta_e); +#endif + /* Get the change in state (delta_y = tempv2) */ - retval = relax_mem->delta_y_fn(ark_mem, ark_mem->tempv2); - if (retval) return retval; + N_VLinearSum(ONE, ark_mem->ycur, -ONE, ark_mem->yn, ark_mem->tempv2); + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::arkRelaxSolve", "compute delta y", + "delta_y =", ""); + N_VPrintFile(ark_mem->tempv2, ARK_LOGGER->debug_fp); +#endif /* Store the current relaxation function value */ retval = relax_mem->relax_fn(ark_mem->yn, &(relax_mem->e_old), @@ -355,6 +374,12 @@ int arkRelaxSolve(ARKodeMem ark_mem, ARKodeRelaxMem relax_mem, if (retval < 0) { return ARK_RELAX_FUNC_FAIL; } if (retval > 0) { return ARK_RELAX_FUNC_RECV; } +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::arkRelaxSolve", "compute old e", + "e_old = %"RSYM, relax_mem->e_old); +#endif + /* Initial guess for relaxation parameter */ relax_mem->relax_param = relax_mem->relax_param_prev; @@ -683,8 +708,8 @@ int arkRelaxPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) /* Constructor called by stepper */ int arkRelaxCreate(void* arkode_mem, ARKRelaxFn relax_fn, - ARKRelaxJacFn relax_jac_fn, ARKRelaxDeltaYFn delta_y_fn, - ARKRelaxDeltaEFn delta_e_fn, ARKRelaxGetOrderFn get_order_fn) + ARKRelaxJacFn relax_jac_fn, ARKRelaxDeltaEFn delta_e_fn, + ARKRelaxGetOrderFn get_order_fn) { ARKodeMem ark_mem; @@ -720,7 +745,7 @@ int arkRelaxCreate(void* arkode_mem, ARKRelaxFn relax_fn, } /* Ensure stepper supplied inputs are provided */ - if (!delta_y_fn || !delta_e_fn || !get_order_fn) + if (!delta_e_fn || !get_order_fn) { arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE", "arkRelaxCreate", "The Delta y, Delta e, or get order function is NULL."); @@ -756,7 +781,6 @@ int arkRelaxCreate(void* arkode_mem, ARKRelaxFn relax_fn, /* Set function pointers */ ark_mem->relax_mem->relax_fn = relax_fn; ark_mem->relax_mem->relax_jac_fn = relax_jac_fn; - ark_mem->relax_mem->delta_y_fn = delta_y_fn; ark_mem->relax_mem->delta_e_fn = delta_e_fn; ark_mem->relax_mem->get_order_fn = get_order_fn; diff --git a/src/arkode/arkode_relaxation_impl.h b/src/arkode/arkode_relaxation_impl.h index 9a6e5b4c38..1b62416d50 100644 --- a/src/arkode/arkode_relaxation_impl.h +++ b/src/arkode/arkode_relaxation_impl.h @@ -30,7 +30,7 @@ * ---------------------------------------------------------------------------*/ #define ARK_RELAX_DEFAULT_MAX_FAILS 10 -#define ARK_RELAX_DEFAULT_RES_TOL (4 * SUN_UNIT_ROUNDOFF) +#define ARK_RELAX_DEFAULT_RES_TOL (10 * SUN_UNIT_ROUNDOFF) #define ARK_RELAX_DEFAULT_REL_TOL (4 * SUN_UNIT_ROUNDOFF) #define ARK_RELAX_DEFAULT_ABS_TOL SUN_RCONST(1.0e-14) #define ARK_RELAX_DEFAULT_MAX_ITERS 10 @@ -42,17 +42,14 @@ * Relaxation Private Return Values (see arkode/arkode.h for public values) * ---------------------------------------------------------------------------*/ -#define ARK_RELAX_FUNC_RECV 1; -#define ARK_RELAX_JAC_RECV 2; -#define ARK_RELAX_SOLVE_RECV 3; +#define ARK_RELAX_FUNC_RECV 1 +#define ARK_RELAX_JAC_RECV 2 +#define ARK_RELAX_SOLVE_RECV 3 /* ----------------------------------------------------------------------------- * Stepper Supplied Relaxation Functions * ---------------------------------------------------------------------------*/ -/* Compute the change in state for the current step y_new = y_old + delta_y */ -typedef int (*ARKRelaxDeltaYFn)(ARKodeMem ark_mem, N_Vector delta_y); - /* Compute the estimated change in entropy for this step delta_e */ typedef int (*ARKRelaxDeltaEFn)(ARKodeMem ark_mem, ARKRelaxJacFn relax_jac_fn, long int* evals_out, sunrealtype* delta_e_out); @@ -69,7 +66,6 @@ struct ARKodeRelaxMemRec /* user-supplied and stepper supplied functions */ ARKRelaxFn relax_fn; /* user relaxation function ("entropy") */ ARKRelaxJacFn relax_jac_fn; /* user relaxation Jacobian */ - ARKRelaxDeltaYFn delta_y_fn; /* get delta y from stepper */ ARKRelaxDeltaEFn delta_e_fn; /* get delta entropy from stepper */ ARKRelaxGetOrderFn get_order_fn; /* get the method order */ @@ -105,8 +101,7 @@ struct ARKodeRelaxMemRec /* Driver and Stepper Functions */ int arkRelaxCreate(void* arkode_mem, ARKRelaxFn relax_fn, - ARKRelaxJacFn relax_jac_fn, ARKRelaxDeltaYFn delta_y_fn, - ARKRelaxDeltaEFn delta_e_fn, + ARKRelaxJacFn relax_jac_fn, ARKRelaxDeltaEFn delta_e_fn, ARKRelaxGetOrderFn get_order_fn); int arkRelaxDestroy(ARKodeRelaxMem relax_mem); int arkRelax(ARKodeMem ark_mem, int* relax_fails, sunrealtype* dsm_inout, diff --git a/src/arkode/arkode_root.c b/src/arkode/arkode_root.c index 7c0b49df81..ff0682ac34 100644 --- a/src/arkode/arkode_root.c +++ b/src/arkode/arkode_root.c @@ -30,7 +30,8 @@ arkRootInit initializes a rootfinding problem to be solved during the integration of the ODE system. It loads the root - function pointer and the number of root functions, and allocates + function pointer and the number of root functions, notifies + ARKODE that the "fullrhs" function is required, and allocates workspace memory. The return value is ARK_SUCCESS = 0 if no errors occurred, or a negative value otherwise. ---------------------------------------------------------------*/ @@ -46,6 +47,24 @@ int arkRootInit(ARKodeMem ark_mem, int nrtfn, ARKRootFn g) } nrt = (nrtfn < 0) ? 0 : nrtfn; + /* Ensure that stepper provides fullrhs function */ + if (nrt > 0) + { + if (!(ark_mem->step_fullrhs)) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE", + "arkRootInit", MSG_ARK_MISSING_FULLRHS); + return ARK_ILL_INPUT; + } + + if (!arkAllocVec(ark_mem, ark_mem->yn, &ark_mem->fn)) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", + "arkInitialSetup", MSG_ARK_MEM_FAIL); + return(ARK_MEM_FAIL); + } + } + /* If unallocated, allocate rootfinding structure, set defaults, update space */ if (ark_mem->root_mem == NULL) { ark_mem->root_mem = (ARKodeRootMem) malloc(sizeof(struct ARKodeRootMemRec)); diff --git a/src/arkode/arkode_sprkstep.c b/src/arkode/arkode_sprkstep.c index 5d6219e98e..f2968ffef3 100644 --- a/src/arkode/arkode_sprkstep.c +++ b/src/arkode/arkode_sprkstep.c @@ -143,6 +143,10 @@ void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, realtype t0, N_Vector y0, /* Zero yerr for compensated summation */ if (ark_mem->use_compensated_sums) { N_VConst(ZERO, step_mem->yerr); } + /* SPRKStep uses Lagrange interpolation by default, since Hermite is + less compatible with these methods. */ + arkSetInterpolantType(ark_mem, ARK_INTERP_LAGRANGE); + /* Initialize main ARKODE infrastructure */ retval = arkInit(ark_mem, t0, y0, FIRST_INIT); if (retval != ARK_SUCCESS) @@ -153,10 +157,6 @@ void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, realtype t0, N_Vector y0, return (NULL); } - /* SPRKStep uses Lagrange interpolation by default, since Hermite is - less compatible with these methods. */ - arkSetInterpolantType(ark_mem, ARK_INTERP_LAGRANGE); - return ((void*)ark_mem); } @@ -459,10 +459,6 @@ int sprkStep_Init(void* arkode_mem, int init_type) } } - /* Signal to shared arkode module that fullrhs is not required after each step - */ - ark_mem->call_fullrhs = SUNFALSE; - return (ARK_SUCCESS); } @@ -500,30 +496,27 @@ int sprkStep_f2(ARKodeSPRKStepMem step_mem, sunrealtype tcur, N_Vector ycur, return retval; } -/*--------------------------------------------------------------- +/*------------------------------------------------------------------------------ sprkStep_FullRHS: This is just a wrapper to call the user-supplied RHS, f1(t,y) + f2(t,y). This will be called in one of three 'modes': - ARK_FULLRHS_START -> called at the beginning of a simulation - or after post processing at step - ARK_FULLRHS_END -> called at the end of a successful step - ARK_FULLRHS_OTHER -> called elsewhere (e.g. for dense output) - - If it is called in ARK_FULLRHS_START mode, we store the vectors - f1(t,y) and f2(t,y) in sdata for possible reuse in the first stage - of the subsequent time step. - - If it is called in ARK_FULLRHS_END mode and the method coefficients - support it, we may just copy the stage vectors to fill f instead - of calling f(). - - ARK_FULLRHS_OTHER mode is only called for dense output in-between - steps, so we strive to store the intermediate parts so that they - do not interfere with the other two modes. - ---------------------------------------------------------------*/ + + ARK_FULLRHS_START -> called at the beginning of a simulation i.e., at + (tn, yn) = (t0, y0) or (tR, yR) + + ARK_FULLRHS_END -> called at the end of a successful step i.e, at + (tcur, ycur) or the start of the subsequent step i.e., + at (tn, yn) = (tcur, ycur) from the end of the last + step + + ARK_FULLRHS_OTHER -> called elsewhere (e.g. for dense output) + + Since RHS values are not stored in SPRKStep we evaluate the RHS functions for + all modes. + ----------------------------------------------------------------------------*/ int sprkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, int mode) { @@ -543,6 +536,9 @@ int sprkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, case ARK_FULLRHS_END: case ARK_FULLRHS_OTHER: + /* Since f1 and f2 do not have overlapping outputs and so the f vector is + passed to both RHS functions. */ + retval = sprkStep_f1(step_mem, t, y, f, ark_mem->user_data); if (retval != 0) { diff --git a/src/sundials/sundials_context.c b/src/sundials/sundials_context.c index 94f90301b8..9ff4204da7 100644 --- a/src/sundials/sundials_context.c +++ b/src/sundials/sundials_context.c @@ -339,4 +339,4 @@ void sunAdiakCollectMetadata() { #endif } -#endif \ No newline at end of file +#endif diff --git a/test/answers b/test/answers index 37f4e6b5b6..a63bd8022c 160000 --- a/test/answers +++ b/test/answers @@ -1 +1 @@ -Subproject commit 37f4e6b5b68e407ea302facba92883126dd39bf7 +Subproject commit a63bd8022ca4e772744769d7b6d5a371d5fb6429 diff --git a/test/unit_tests/arkode/CXX_parallel/CMakeLists.txt b/test/unit_tests/arkode/CXX_parallel/CMakeLists.txt index bf238501f6..d86cd29f31 100644 --- a/test/unit_tests/arkode/CXX_parallel/CMakeLists.txt +++ b/test/unit_tests/arkode/CXX_parallel/CMakeLists.txt @@ -16,73 +16,68 @@ # List of test tuples of the form "name\;tasks\;args" if (NOT SUNDIALS_PRECISION MATCHES "SINGLE") - set(ARKODE_unit_tests - "ark_test_heat2D_mri\;2\;0" - "ark_test_heat2D_mri\;4\;1" + set(unit_tests + "ark_test_heat2D_mri.cpp\;2\;0" + "ark_test_heat2D_mri.cpp\;4\;1" ) endif() -if(MPI_CXX_COMPILER) - # use MPI wrapper as the compiler - set(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER}) - - # disable C++ extensions (for known wrappers) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX -DLAM_BUILDING") -else() - # add MPI_INCLUDE_PATH to include directories - include_directories(${MPI_INCLUDE_PATH}) -endif() - -set(ARKODE_LIB sundials_arkode) -set(NVECP_LIB sundials_nvecparallel) - -# Set-up linker flags and link libraries -set(SUNDIALS_LIBS ${ARKODE_LIB} ${NVECP_LIB} ${EXE_EXTRA_LINK_LIBS}) - # Add the build and install targets for each test -foreach(test_tuple ${ARKODE_unit_tests}) +foreach(test_tuple ${unit_tests}) # parse the test tuple list(GET test_tuple 0 test) list(GET test_tuple 1 number_of_tasks) list(GET test_tuple 2 test_args) + # Extract the file name without extension + get_filename_component(test_target ${test} NAME_WE) + # check if this test has already been added, only need to add # test source files once for testing with different inputs - if(NOT TARGET ${test}) + if(NOT TARGET ${test_target}) # test source files - add_executable(${test} ${test}.cpp) + add_executable(${test_target} ${test}) - set_target_properties(${test} PROPERTIES FOLDER "unit_tests") + set_target_properties(${test_target} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE + target_include_directories(${test_target} PRIVATE $ ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test} ${SUNDIALS_LIBS}) - - if(NOT MPI_CXX_COMPILER) - target_link_libraries(${test} ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARIES}) - endif() + target_link_libraries(${test_target} + MPI::MPI_CXX + sundials_arkode + sundials_nvecparallel + ${EXE_EXTRA_LINK_LIBS}) endif() # check if test args are provided and set the test name if("${test_args}" STREQUAL "") - set(test_name ${test}) + set(test_name ${test_target}) else() - string(REGEX REPLACE " " "_" test_name ${test}_${test_args}) + string(REGEX REPLACE " " "_" test_name "${test_target}_${test_args}") + endif() + + if(SUNDIALS_PRECISION MATCHES "DOUBLE") + set(diff_output "") + else() + set(diff_output "NODIFF") endif() # add test to regression tests - sundials_add_test(${test_name} ${test} + sundials_add_test(${test_name} ${test_target} TEST_ARGS ${test_args} + ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} + ANSWER_FILE ${test_name}.out MPI_NPROCS ${number_of_tasks} - NODIFF) + ${diff_output}) + endforeach() message(STATUS "Added ARKODE CXX parallel unit tests") diff --git a/test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri.cpp b/test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri.cpp index 85ee27e410..479524e8e4 100644 --- a/test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri.cpp +++ b/test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri.cpp @@ -103,6 +103,8 @@ static int SetupDecomp(UserData *udata); static int Exchange(N_Vector y, UserData *udata); // frees memory allocated within UserData static int FreeUserData(UserData *udata); +// check if relative difference is within tolerance +static bool Compare(long int a, long int b, sunrealtype tol); // Main Program int main(int argc, char* argv[]) { @@ -386,7 +388,7 @@ int main(int argc, char* argv[]) { if (outproc) cout << " Internal solver steps error: " << ark_nst << " vs " << mri_nst << "\n"; } - if ((ark_nfi - ark_nst) != mri_nfsi) { + if (ark_nfi != mri_nfsi) { numfails += 1; if (outproc) cout << " RHS evals error: " << ark_nfi << " vs " << mri_nfsi << "\n"; @@ -396,17 +398,17 @@ int main(int argc, char* argv[]) { if (outproc) cout << " Linear solver setups error: " << ark_nsetups << " vs " << mri_nsetups << "\n"; } - if (ark_nli < mri_nli) { + if (!Compare(ark_nli, mri_nli, ONE)) { numfails += 1; if (outproc) cout << " Linear iterations error: " << ark_nli << " vs " << mri_nli << "\n"; } - if (ark_nJv < mri_nJv) { + if (!Compare(ark_nJv, mri_nJv, ONE)) { numfails += 1; if (outproc) cout << " Jacobian-vector products error: " << ark_nJv << " vs " << mri_nJv << "\n"; } - if (ark_nps < mri_nps) { + if (!Compare(ark_nps, mri_nps, ONE)) { numfails += 1; if (outproc) cout << " Preconditioner solves error: " << ark_nps << " vs " << mri_nps << "\n"; @@ -943,5 +945,13 @@ static int FreeUserData(UserData *udata) return 0; // return with success flag } +// Check if relative difference of a and b is less than tolerance +static bool Compare(long int a, long int b, sunrealtype tol) +{ + sunrealtype rel_diff = SUN_RCONST(100.0) * + abs(static_cast(a - b) / static_cast(a)); + + return (rel_diff > tol) ? false : true; +} //---- end of file ---- diff --git a/test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri_0.out b/test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri_0.out new file mode 100644 index 0000000000..a78e16c9fd --- /dev/null +++ b/test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri_0.out @@ -0,0 +1,40 @@ + +2D Heat PDE test problem: + nprocs = 2 + nx = 60 + ny = 120 + kx = 0.5 + ky = 0.75 + rtol = 1e-05 + atol = 1e-10 + nxl (proc 0) = 30 + nyl (proc 0) = 120 + Nonlinear implicit solver + + +ARKStep Solver Statistics: + Internal solver steps = 1000 + Total RHS evals: Fe = 0, Fi = 2769 + Total linear solver setups = 50 + Total linear iterations = 6231 + Total number of Jacobian-vector products = 6231 + Total number of Preconditioner setups = 17 + Total number of Preconditioner solves = 6231 + Total number of linear solver convergence failures = 0 + Total number of Newton iterations = 1768 + Total number of nonlinear solver convergence failures = 0 + +MRIStep Solver Statistics: + Internal solver steps = 1000 + Total RHS evals: Fe = 2769 + Total linear solver setups = 50 + Total linear iterations = 6250 + Total number of Jacobian-vector products = 6250 + Total number of Preconditioner setups = 50 + Total number of Preconditioner solves = 6250 + Total number of linear solver convergence failures = 0 + Total number of Newton iterations = 1768 + Total number of nonlinear solver convergence failures = 0 + +Comparing Solver Statistics: +All tests pass! diff --git a/test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri_1.out b/test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri_1.out new file mode 100644 index 0000000000..bbf3267c89 --- /dev/null +++ b/test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri_1.out @@ -0,0 +1,40 @@ + +2D Heat PDE test problem: + nprocs = 4 + nx = 60 + ny = 120 + kx = 0.5 + ky = 0.75 + rtol = 1e-05 + atol = 1e-10 + nxl (proc 0) = 30 + nyl (proc 0) = 60 + Linearly implicit solver + + +ARKStep Solver Statistics: + Internal solver steps = 1000 + Total RHS evals: Fe = 0, Fi = 2001 + Total linear solver setups = 1 + Total linear iterations = 4711 + Total number of Jacobian-vector products = 4711 + Total number of Preconditioner setups = 1 + Total number of Preconditioner solves = 4711 + Total number of linear solver convergence failures = 0 + Total number of Newton iterations = 1000 + Total number of nonlinear solver convergence failures = 0 + +MRIStep Solver Statistics: + Internal solver steps = 1000 + Total RHS evals: Fe = 2001 + Total linear solver setups = 1 + Total linear iterations = 4731 + Total number of Jacobian-vector products = 4731 + Total number of Preconditioner setups = 1 + Total number of Preconditioner solves = 4731 + Total number of linear solver convergence failures = 0 + Total number of Newton iterations = 1000 + Total number of nonlinear solver convergence failures = 0 + +Comparing Solver Statistics: +All tests pass! diff --git a/test/unit_tests/arkode/CXX_serial/CMakeLists.txt b/test/unit_tests/arkode/CXX_serial/CMakeLists.txt index b0ea386c44..6367e502e4 100644 --- a/test/unit_tests/arkode/CXX_serial/CMakeLists.txt +++ b/test/unit_tests/arkode/CXX_serial/CMakeLists.txt @@ -18,6 +18,14 @@ set(unit_tests "ark_test_analytic_sys_mri.cpp\;0" "ark_test_analytic_sys_mri.cpp\;1" + "ark_test_dahlquist_ark.cpp\;0 0" + "ark_test_dahlquist_ark.cpp\;1 0" + "ark_test_dahlquist_ark.cpp\;2 0" + "ark_test_dahlquist_ark.cpp\;0 1" + "ark_test_dahlquist_ark.cpp\;1 1" + "ark_test_dahlquist_ark.cpp\;2 1" + "ark_test_dahlquist_erk.cpp\;0" + "ark_test_dahlquist_erk.cpp\;1" "ark_test_dahlquist_mri.cpp\;" "ark_test_butcher.cpp\;" "ark_test_getjac.cpp\;" diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri.cpp index ce0b9bdd04..ecb951f6c0 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri.cpp @@ -62,6 +62,9 @@ static int dense_MM(SUNMatrix A, SUNMatrix B, SUNMatrix C); // Private function to check function return values static int check_flag(void *flagvalue, const string funcname, int opt); +// check if relative difference is within tolerance +static bool Compare(long int a, long int b, sunrealtype tol); + // SUNContext for the simulation static SUNContext sunctx = NULL; @@ -312,11 +315,11 @@ int main(int argc, char* argv[]) numfails += 1; cout << " Internal solver steps error: " << ark_nst << " vs " << mri_nst << "\n"; } - if ((ark_nfi - ark_nst) != mri_nfsi) { + if (!Compare(ark_nfi, mri_nfsi, ONE)) { numfails += 1; cout << " RHS evals error: " << ark_nfi << " vs " << mri_nfsi << "\n"; } - if (ark_nni != mri_nni) { + if (!Compare(ark_nni, mri_nni, ONE)) { numfails += 1; cout << " Nonlinear iterations error: " << ark_nni << " vs " << mri_nni << "\n"; } @@ -535,6 +538,13 @@ static int check_flag(void *flagvalue, const string funcname, int opt) return 0; } +// Check if relative difference of a and b is less than tolerance +static bool Compare(long int a, long int b, sunrealtype tol) +{ + sunrealtype rel_diff = SUN_RCONST(100.0) * + abs(static_cast(a - b) / static_cast(a)); + return (rel_diff > tol) ? false : true; +} //---- end of file ---- diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri_0.out b/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri_0.out index a5976da941..384859a985 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri_0.out +++ b/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri_0.out @@ -10,7 +10,7 @@ ARKStep Solver Statistics: Return time = 0.05 Internal final time = 0.05 Internal solver steps = 1000 - Total RHS evals: Fe = 0, Fi = 3001 + Total RHS evals: Fe = 0, Fi = 2001 Total number of nonlinear iterations = 1000 Total number of nonlinear solver convergence failures = 0 Total linear solver setups = 1 diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri_1.out b/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri_1.out index 7ab9908ef6..bd5acb803f 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri_1.out +++ b/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri_1.out @@ -10,7 +10,7 @@ ARKStep Solver Statistics: Return time = 0.05 Internal final time = 0.05 Internal solver steps = 1000 - Total RHS evals: Fe = 0, Fi = 4946 + Total RHS evals: Fe = 0, Fi = 3946 Total number of nonlinear iterations = 2945 Total number of nonlinear solver convergence failures = 0 diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark.cpp new file mode 100644 index 0000000000..6cc8f27c24 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark.cpp @@ -0,0 +1,956 @@ +/* --------------------------------------------------------------------------- + * Programmer(s): David J. Gardner @ LLNL + * --------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2023, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * --------------------------------------------------------------------------- + * IMEX Dahlquist problem: + * + * 1) y' = lambda_e * y + lambda_i * y + * 2) M y' = M (lambda_e * y + lambda_i * y) + * 3) M(t) y' = M(t) (lambda_e * y + lambda_i * y) + * ---------------------------------------------------------------------------*/ + +// Header files +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include "arkode/arkode_butcher.h" + +#if defined(SUNDIALS_EXTENDED_PRECISION) +#define GSYM "Lg" +#define ESYM "Le" +#define FSYM "Lf" +#else +#define GSYM "g" +#define ESYM "e" +#define FSYM "f" +#endif + +// Constants +#define NEG_ONE SUN_RCONST(-1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) + +// Method types +enum class prob_type +{ + identity, + fixed_mass_matrix, + time_dependent_mass_matrix +}; + +enum class method_type +{ + expl, + impl, + imex +}; + +enum class interp_type +{ + hermite, + lagrange +}; + +// Problem parameters +struct ProblemData +{ + sunrealtype lambda_e = NEG_ONE; + sunrealtype lambda_i = NEG_ONE; + prob_type p_type = prob_type::identity; +}; + +// Problem options +struct ProblemOptions +{ + // Initial time + sunrealtype t0 = ZERO; + + // Relative and absolute tolerances + sunrealtype reltol = SUN_RCONST(1.0e-4); + sunrealtype abstol = SUN_RCONST(1.0e-6); + + // Step size + sunrealtype h = SUN_RCONST(0.01); + + // Interpolant type + // 0 = Hermite + // 1 = Lagrange + interp_type i_type = interp_type::hermite; +}; + +// User-supplied Functions called by the solver +int fe(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +int fi(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +int Ji(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, + N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); +int MassMatrix(sunrealtype t, SUNMatrix M, void *user_data, N_Vector tmp1, + N_Vector tmp2, N_Vector tmp3); + +// Private function to check function return values +int check_flag(void* flagvalue, const std::string funcname, int opt); + +// Test drivers +int run_tests(ARKodeButcherTable Be, ARKodeButcherTable Bi, + ProblemData& prob_data, ProblemOptions& prob_opts, + sundials::Context& sunctx); + +int get_method_properties(ARKodeButcherTable Be, ARKodeButcherTable Bi, + int& stages, int& order, bool& explicit_first_stage, + bool& stiffly_accurate, bool& fsal); + +int expected_rhs_evals(method_type m_type, interp_type i_type, int stages, + bool explicit_first_stage, bool stiffly_accurate, + bool fsal, void* arkstep_mem, long int& nfe_expected, + long int& nfi_expected); + +int check_rhs_evals(method_type m_type, void* arkstep_mem, + long int nfe_expected, long int nfi_expected); + +// ----------------------------------------------------------------------------- +// Main Program +// ----------------------------------------------------------------------------- + +int main(int argc, char* argv[]) +{ + // Problem data and options structures + ProblemData prob_data; + ProblemOptions prob_opts; + + // Check for inputs + if (argc > 1) + { + if (std::stoi(argv[1]) == 1) + { + prob_data.p_type = prob_type::fixed_mass_matrix; + } + else if (std::stoi(argv[1]) == 2) + { + prob_data.p_type = prob_type::time_dependent_mass_matrix; + } + else + { + prob_data.p_type = prob_type::identity; + } + } + + if (argc > 2) + { + if (std::stoi(argv[2]) == 1) + { + prob_opts.i_type = interp_type::lagrange; + } + else + { + prob_opts.i_type = interp_type::hermite; + } + } + + // Output problem setup + std::cout << "\nDahlquist ODE test problem:\n"; + if (prob_data.p_type == prob_type::identity) + { + std::cout << " problem type = Identity\n"; + } + else if (prob_data.p_type == prob_type::fixed_mass_matrix) + { + std::cout << " problem type = Fixed mass matrix\n"; + } + else + { + std::cout << " problem type = Time-dependent mass matrix\n"; + } + std::cout << " lambda expl = " << prob_data.lambda_e << "\n" + << " lambda impl = " << prob_data.lambda_i << "\n" + << " step size = " << prob_opts.h << "\n" + << " relative tol = " << prob_opts.reltol << "\n" + << " absolute tol = " << prob_opts.abstol << "\n"; + if (prob_opts.i_type == interp_type::hermite) + { + std::cout << " interp type = Hermite\n"; + } + else + { + std::cout << " interp type = Lagrange\n"; + } + + // Create SUNDIALS context + sundials::Context sunctx; + + // Test methods + int flag, numfails = 0; + + ARKodeButcherTable Be = nullptr; + ARKodeButcherTable Bi = nullptr; + + int stages, order; + bool explicit_first_stage, stiffly_accurate, fsal; + + // -------- + // Explicit + // -------- + + std::cout << "\n========================\n" + << "Test explicit RK methods\n" + << "========================\n"; + + Be = ARKodeButcherTable_Alloc(1, SUNFALSE); + Be->A[0][0] = ZERO; + Be->b[0] = ONE; + Be->c[0] = ZERO; + Be->q = 1; + + flag = get_method_properties(Be, Bi, stages, order, explicit_first_stage, + stiffly_accurate, fsal); + if (check_flag(&flag, "get_method_properties", 1)) return 1; + + std::cout << "\n========================" << std::endl; + std::cout << "Explicit Euler" << std::endl; + std::cout << " stages: " << stages << std::endl; + std::cout << " order: " << order << std::endl; + std::cout << " explicit 1st stage: " << explicit_first_stage << std::endl; + std::cout << " stiffly accurate: " << stiffly_accurate << std::endl; + std::cout << " first same as last: " << fsal << std::endl; + std::cout << "========================" << std::endl; + + numfails += run_tests(Be, Bi, prob_data, prob_opts, sunctx); + + ARKodeButcherTable_Free(Be); + Be = nullptr; + + for (int i = ARKODE_MIN_ERK_NUM; i <= ARKODE_MAX_ERK_NUM; i++) + { + Be = ARKodeButcherTable_LoadERK(static_cast(i)); + flag = get_method_properties(Be, Bi, stages, order, explicit_first_stage, + stiffly_accurate, fsal); + if (check_flag(&flag, "get_method_properties", 1)) return 1; + + std::cout << "\n========================" << std::endl; + std::cout << "ERK Table ID " << i << std::endl; + std::cout << " stages: " << stages << std::endl; + std::cout << " order: " << order << std::endl; + std::cout << " explicit 1st stage: " << explicit_first_stage << std::endl; + std::cout << " stiffly accurate: " << stiffly_accurate << std::endl; + std::cout << " first same as last: " << fsal << std::endl; + std::cout << "========================" << std::endl; + + numfails += run_tests(Be, Bi, prob_data, prob_opts, sunctx); + + ARKodeButcherTable_Free(Be); + Be = nullptr; + } + + // -------- + // Implicit + // -------- + + std::cout << "\n========================\n" + << "Test implicit RK methods\n" + << "========================\n"; + + Bi = ARKodeButcherTable_Alloc(1, SUNFALSE); + Bi->A[0][0] = ONE; + Bi->b[0] = ONE; + Bi->c[0] = ONE; + Bi->q = 1; + + flag = get_method_properties(Be, Bi, stages, order, explicit_first_stage, + stiffly_accurate, fsal); + if (check_flag(&flag, "get_method_properties", 1)) return 1; + + std::cout << "\n========================" << std::endl; + std::cout << "Implicit Euler" << std::endl; + std::cout << " stages: " << stages << std::endl; + std::cout << " order: " << order << std::endl; + std::cout << " explicit 1st stage: " << explicit_first_stage << std::endl; + std::cout << " stiffly accurate: " << stiffly_accurate << std::endl; + std::cout << " first same as last: " << fsal << std::endl; + std::cout << "========================" << std::endl; + + numfails += run_tests(Be, Bi, prob_data, prob_opts, sunctx); + + ARKodeButcherTable_Free(Bi); + Bi = nullptr; + + for (int i = ARKODE_MIN_DIRK_NUM; i <= ARKODE_MAX_DIRK_NUM; i++) + { + Bi = ARKodeButcherTable_LoadDIRK(static_cast(i)); + flag = get_method_properties(Be, Bi, stages, order, explicit_first_stage, + stiffly_accurate, fsal); + if (check_flag(&flag, "get_method_properties", 1)) return 1; + + std::cout << "\n========================" << std::endl; + std::cout << "DIRK Table ID " << i << std::endl; + std::cout << " stages: " << stages << std::endl; + std::cout << " order: " << order << std::endl; + std::cout << " explicit 1st stage: " << explicit_first_stage << std::endl; + std::cout << " stiffly accurate: " << stiffly_accurate << std::endl; + std::cout << " first same as last: " << fsal << std::endl; + std::cout << "========================" << std::endl; + + numfails += run_tests(Be, Bi, prob_data, prob_opts, sunctx); + + ARKodeButcherTable_Free(Bi); + Bi = nullptr; + } + + // ---- + // IMEX + // ---- + + std::cout << "\n=====================\n" + << "Test IMEX ARK methods\n" + << "=====================\n"; + + Be = ARKodeButcherTable_Alloc(2, SUNFALSE); + Be->A[1][0] = ONE; + Be->b[0] = ONE; + Be->c[1] = ONE; + Be->q = 1; + + Bi = ARKodeButcherTable_Alloc(2, SUNFALSE); + Bi->A[1][1] = ONE; + Bi->b[1] = ONE; + Bi->c[1] = ONE; + Bi->q = 1; + + flag = get_method_properties(Be, Bi, stages, order, explicit_first_stage, + stiffly_accurate, fsal); + if (check_flag(&flag, "get_method_properties", 1)) return 1; + + std::cout << "\n========================" << std::endl; + std::cout << "IMEX Euler" << std::endl; + std::cout << " stages: " << stages << std::endl; + std::cout << " order: " << order << std::endl; + std::cout << " explicit 1st stage: " << explicit_first_stage << std::endl; + std::cout << " stiffly accurate: " << stiffly_accurate << std::endl; + std::cout << " first same as last: " << fsal << std::endl; + std::cout << "========================" << std::endl; + + numfails += run_tests(Be, Bi, prob_data, prob_opts, sunctx); + + ARKodeButcherTable_Free(Be); + ARKodeButcherTable_Free(Bi); + Be = nullptr; + Bi = nullptr; + + const char* ark_methods_erk[6] = + {"ARKODE_ARK2_ERK_3_1_2", + "ARKODE_ARK324L2SA_ERK_4_2_3", + "ARKODE_ARK436L2SA_ERK_6_3_4", + "ARKODE_ARK437L2SA_ERK_7_3_4", + "ARKODE_ARK548L2SA_ERK_8_4_5", + "ARKODE_ARK548L2SAb_ERK_8_4_5"}; + + const char* ark_methods_dirk[6] = + {"ARKODE_ARK2_DIRK_3_1_2", + "ARKODE_ARK324L2SA_DIRK_4_2_3", + "ARKODE_ARK436L2SA_DIRK_6_3_4", + "ARKODE_ARK437L2SA_DIRK_7_3_4", + "ARKODE_ARK548L2SA_ERK_8_4_5", + "ARKODE_ARK548L2SAb_ERK_8_4_5"}; + + for (int i = 0; i < 6; i++) + { + Be = ARKodeButcherTable_LoadERKByName(ark_methods_erk[0]); + Bi = ARKodeButcherTable_LoadDIRKByName(ark_methods_dirk[0]); + + flag = get_method_properties(Be, Bi, stages, order, explicit_first_stage, + stiffly_accurate, fsal); + if (check_flag(&flag, "get_method_properties", 1)) return 1; + + std::cout << "\n========================" << std::endl; + std::cout << "IMEX Table ID " << i << std::endl; + std::cout << " stages: " << stages << std::endl; + std::cout << " order: " << order << std::endl; + std::cout << " explicit 1st stage: " << explicit_first_stage << std::endl; + std::cout << " stiffly accurate: " << stiffly_accurate << std::endl; + std::cout << " first same as last: " << fsal << std::endl; + std::cout << "========================" << std::endl; + + numfails += run_tests(Be, Bi, prob_data, prob_opts, sunctx); + + ARKodeButcherTable_Free(Be); + ARKodeButcherTable_Free(Bi); + Be = nullptr; + Bi = nullptr; + } + + if (numfails) { std::cout << "\n\nFailed " << numfails << " tests!\n"; } + else { std::cout << "\n\nAll tests passed!\n"; } + + // Return test status + return numfails; +} + +// ----------------------------------------------------------------------------- +// Test drivers +// ----------------------------------------------------------------------------- + +int run_tests(ARKodeButcherTable Be, ARKodeButcherTable Bi, + ProblemData& prob_data, ProblemOptions& prob_opts, + sundials::Context& sunctx) +{ + // Reusable error-checking flag + int flag; + + // Test failure counter + int numfails = 0; + + // Determine method type + method_type m_type; + if (Be && !Bi) { m_type = method_type::expl; } + else if (!Be && Bi) { m_type = method_type::impl; } + else if (Be && Bi) { m_type = method_type::imex; } + else + { + std::cerr << "ERROR: Both Butcher tables are NULL" << std::endl; + return 1; + } + + // Get method properties + int stages, order; + bool explicit_first_stage, stiffly_accurate, fsal; + flag = get_method_properties(Be, Bi, stages, order, explicit_first_stage, + stiffly_accurate, fsal); + if (check_flag(&flag, "get_method_properties", 1)) return 1; + + // Create initial condition vector + N_Vector y = N_VNew_Serial(1, sunctx); + if (check_flag((void*)y, "N_VNew_Serial", 0)) return 1; + + N_VConst(SUN_RCONST(1.0), y); + + // ----------------- + // Create integrator + // ----------------- + + // Create integrator based on type + void* arkstep_mem = nullptr; + + if (m_type == method_type::expl) + { + arkstep_mem = ARKStepCreate(fe, nullptr, prob_opts.t0, y, sunctx); + } + else if (m_type == method_type::impl) + { + arkstep_mem = ARKStepCreate(nullptr, fi, prob_opts.t0, y, sunctx); + } + else + { + arkstep_mem = ARKStepCreate(fe, fi, prob_opts.t0, y, sunctx); + } + if (check_flag((void*)arkstep_mem, "ARKStepCreate", 0)) return 1; + + // Set user data + flag = ARKStepSetUserData(arkstep_mem, &prob_data); + if (check_flag(&flag, "ARKStepSetUserData", 1)) return 1; + + // Specify tolerances + flag = ARKStepSStolerances(arkstep_mem, prob_opts.reltol, prob_opts.abstol); + if (check_flag(&flag, "ARKStepSStolerances", 1)) return 1; + + // Specify fixed time step size + flag = ARKStepSetFixedStep(arkstep_mem, prob_opts.h); + if (check_flag(&flag, "ARKStepSetFixedStep", 1)) return 1; + + // Attach Butcher tables <<<<<<< correct method order? + flag = ARKStepSetTables(arkstep_mem, 1, 0, Bi, Be); + if (check_flag(&flag, "ARKStepSetTables", 1)) return 1; + + // Lagrange interpolant (removes additional RHS evaluation with DIRK methods) + if (prob_opts.i_type == interp_type::lagrange) + { + flag = ARKStepSetInterpolantType(arkstep_mem, ARK_INTERP_LAGRANGE); + if (check_flag(&flag, "ARKStepSetInterpolantType", 1)) return 1; + } + + // Create matrix and linear solver (if necessary) + SUNMatrix A = nullptr; + SUNLinearSolver LS = nullptr; + + if (m_type == method_type::impl || m_type == method_type::imex) + { + // Initialize dense matrix data structures and solvers + A = SUNDenseMatrix(1, 1, sunctx); + if (check_flag((void*)A, "SUNDenseMatrix", 0)) return 1; + + LS = SUNLinSol_Dense(y, A, sunctx); + if (check_flag((void*)LS, "SUNLinSol_Dense", 0)) return 1; + + // Attach linear solver + flag = ARKStepSetLinearSolver(arkstep_mem, LS, A); + if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) return 1; + + // Set Jacobian function + flag = ARKStepSetJacFn(arkstep_mem, Ji); + if (check_flag(&flag, "ARKStepSetJacFn", 1)) return 1; + + // Specify linearly implicit RHS, with non-time-dependent Jacobian + flag = ARKStepSetLinear(arkstep_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 1)) return 1; + } + + // Create mass matrix and linear solver (if necessary) + SUNMatrix M = nullptr; + SUNLinearSolver MLS = nullptr; + + if (prob_data.p_type == prob_type::fixed_mass_matrix || + prob_data.p_type == prob_type::time_dependent_mass_matrix) + { + M = SUNDenseMatrix(1, 1, sunctx); + if (check_flag((void *)M, "SUNDenseMatrix", 0)) return 1; + + MLS = SUNLinSol_Dense(y, M, sunctx); + if (check_flag((void *)MLS, "SUNLinSol_Dense", 0)) return 1; + + int time_dep = 0; + if (prob_data.p_type == prob_type::time_dependent_mass_matrix) + time_dep = 1; + + flag = ARKStepSetMassLinearSolver(arkstep_mem, MLS, M, time_dep); + if (check_flag(&flag, "ARKStepSetMassLinearSolver", 1)) return 1; + + flag = ARKStepSetMassFn(arkstep_mem, MassMatrix); + if (check_flag(&flag, "ARKStepSetMassFn", 1)) return 1; + } + + // -------------- + // Evolve in time + // -------------- + + sunrealtype t_ret = prob_opts.t0; + sunrealtype t_out = 3 * prob_opts.h; + + long int nfe_expected, nfi_expected; + + for (int i = 0; i < 3; i++) + { + std::cout << "--------------------" << std::endl; + + // Advance in time + flag = ARKStepEvolve(arkstep_mem, t_out, y, &t_ret, ARK_ONE_STEP); + if (check_flag(&flag, "ARKStepEvolve", 1)) return 1; + + // Update output time + t_out += prob_opts.h; + + // Check statistics + flag = expected_rhs_evals(m_type, prob_opts.i_type, stages, + explicit_first_stage, stiffly_accurate, fsal, + arkstep_mem,nfe_expected, nfi_expected); + if (check_flag(&flag, "expected_rhs_evals", 1)) return 1; + + numfails += check_rhs_evals(m_type, arkstep_mem, nfe_expected, nfi_expected); + + if (numfails) + { + std::cout << "Failed " << numfails << " checks\n"; + break; + } + } + + // ---------------- + // Get dense output + // ---------------- + + long int extra_fe_evals = 0; + long int extra_fi_evals = 0; + + if (numfails == 0) + { + std::cout << "--------------------" << std::endl; + std::cout << "Dense Output" << std::endl; + + sunrealtype h_last; + flag = ARKStepGetLastStep(arkstep_mem, &h_last); + if (check_flag(&flag, "ARKStepGetLastStep", 1)) return 1; + + flag = ARKStepGetDky(arkstep_mem, t_ret - h_last / TWO, 0, y); + if (check_flag(&flag, "ARKStepGetDky", 1)) return 1; + + // Stiffly accurate (and FSAL) methods do not require an additional RHS + // evaluation to get the new RHS value at the end of a step for dense + // output. However, for methods with an explicit first stage this evaluation + // can be used at the start of the next step. For methods with an implicit + // first stage that are not stiffly accurate this evaluation replaces one + // that would happen at the end of the next step (this is accounted for in + // expected_rhs_evals after the next step is taken below). + if (prob_opts.i_type == interp_type::hermite && !stiffly_accurate) + { + if (m_type == method_type::expl || m_type == method_type::imex) + { + nfe_expected++; + } + if (m_type == method_type::impl || m_type == method_type::imex) + { + nfi_expected++; + } + } + + // Higher order methods require additional RHS evaluations for dense output + // with the Hermite interpolant (note default degree is order - 1, except + // for first order where the degree is 1. These are not accounted for in + // explicit_rhs_evals and must be carried forward. + int degree = (order == 1) ? 1 : order - 1; + if (prob_opts.i_type == interp_type::hermite && degree > 3) + { + if (m_type == method_type::expl || m_type == method_type::imex) + { + extra_fe_evals += (degree == 4) ? 1 : 4; + } + if (m_type == method_type::impl || m_type == method_type::imex) + { + extra_fi_evals += (degree == 4) ? 1 : 4; + } + } + + numfails += check_rhs_evals(m_type, arkstep_mem, + nfe_expected + extra_fe_evals, + nfi_expected + extra_fi_evals); + + std::cout << "--------------------" << std::endl; + } + + // -------------------- + // Additional time step + // -------------------- + + if (numfails == 0) + { + // Advance in time + flag = ARKStepEvolve(arkstep_mem, t_out, y, &t_ret, ARK_ONE_STEP); + if (check_flag(&flag, "ARKStepEvolve", 1)) return 1; + + // Update output time + t_out += prob_opts.h; + + // Check statistics + flag = expected_rhs_evals(m_type, prob_opts.i_type, stages, + explicit_first_stage, stiffly_accurate, fsal, + arkstep_mem, nfe_expected, nfi_expected); + if (check_flag(&flag, "expected_rhs_evals", 1)) return 1; + + numfails += check_rhs_evals(m_type, arkstep_mem, + nfe_expected + extra_fe_evals, + nfi_expected + extra_fi_evals); + + std::cout << "--------------------" << std::endl; + } + + // -------- + // Clean up + // -------- + + ARKStepFree(&arkstep_mem); + SUNLinSolFree(LS); + SUNMatDestroy(A); + SUNLinSolFree(MLS); + SUNMatDestroy(M); + N_VDestroy(y); + + return numfails; +} + +int get_method_properties(ARKodeButcherTable Be, ARKodeButcherTable Bi, + int& stages, int& order, bool& explicit_first_stage, + bool& stiffly_accurate, bool& fsal) +{ + stages = 0; + if (Bi) { stages = Bi->stages; } + else if (Be) { stages = Be->stages; } + else + { + std::cerr << "ERROR: Both Butcher tables are NULL!" << std::endl; + return 1; + } + + // Built-in ARK methods have the same order for Bi and Be + order = 0; + if (Bi) { order = Bi->q; } + else if (Be) { order= Be->q; } + else + { + std::cerr << "ERROR: Both Butcher tables are NULL!" << std::endl; + return 1; + } + + // Check for explicit first stage + explicit_first_stage = true; + if (Bi) + { + if (std::abs(Bi->A[0][0]) > ZERO) { explicit_first_stage = false; } + } + if (Be) + { + if (std::abs(Be->A[0][0]) > ZERO) { explicit_first_stage = false; } + } + + // Check for stiffly accurate method + stiffly_accurate = true; + if (Bi) + { + if (!ARKodeButcherTable_IsStifflyAccurate(Bi)) + { + stiffly_accurate = false; + } + } + if (Be) + { + if (!ARKodeButcherTable_IsStifflyAccurate(Be)) + { + stiffly_accurate = false; + } + } + + // Check for first same as last (FSAL) property + fsal = explicit_first_stage && stiffly_accurate; + + return 0; +} + +int expected_rhs_evals(method_type m_type, interp_type i_type, int stages, + bool explicit_first_stage, bool stiffly_accurate, + bool fsal, void* arkstep_mem, + long int& nfe_expected, long int& nfi_expected) +{ + int flag = 0; + + // Get number of steps and nonlinear solver iterations + long int nst = 0; + flag = ARKStepGetNumSteps(arkstep_mem, &nst); + if (check_flag(&flag, "ARKStepGetNumSteps", 1)) return 1; + + long int nni = 0; + if (m_type == method_type::impl || m_type == method_type::imex) + { + flag = ARKStepGetNumNonlinSolvIters(arkstep_mem, &nni); + if (check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1)) return 1; + } + + // Expected number of explicit functions evaluations + nfe_expected = 0; + if (m_type == method_type::expl || m_type == method_type::imex) + { + if (fsal) + { + // Save one function evaluation after first step + nfe_expected = stages + (stages - 1) * (nst - 1); + } + else + { + nfe_expected = stages * nst; + } + + if (i_type == interp_type::hermite && !explicit_first_stage) + { + if (stiffly_accurate) + { + // One extra evaluation in the first step only + nfe_expected++; + } + else + { + // One extra evaluation in each step + nfe_expected += nst; + } + } + } + + // Expected number of implicit functions evaluations + nfi_expected = 0; + if (m_type == method_type::impl || m_type == method_type::imex) + { + if (fsal) + { + // Save one function evaluation after first step + nfi_expected = stages + (stages - 1) * (nst - 1) + nni; + } + else + { + nfi_expected = stages * nst + nni; + } + + if (i_type == interp_type::hermite && !explicit_first_stage) + { + if (stiffly_accurate) + { + // One extra evaluation in the first step only + nfi_expected++; + } + else + { + // One extra evaluation in each step + nfi_expected += nst; + } + } + } + + std::cout << "Steps: " << nst << std::endl; + + if (m_type == method_type::impl || m_type == method_type::imex) + { + std::cout << "NLS iters: " << nni << std::endl; + } + + return 0; +} + +int check_rhs_evals(method_type m_type, void* arkstep_mem, + long int nfe_expected, long int nfi_expected) +{ + int flag = 0; + + long int nst = 0; + flag = ARKStepGetNumSteps(arkstep_mem, &nst); + if (check_flag(&flag, "ARKStepGetNumSteps", 1)) return 1; + + long int nfe, nfi; + flag = ARKStepGetNumRhsEvals(arkstep_mem, &nfe, &nfi); + if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) return 1; + + + if (m_type == method_type::expl || m_type == method_type::imex) + { + std::cout << "Fe RHS evals:\n" + << " actual: " << nfe << "\n" + << " expected: " << nfe_expected << "\n"; + } + if (m_type == method_type::impl || m_type == method_type::imex) + { + std::cout << "Fi RHS evals:\n" + << " actual: " << nfi << "\n" + << " expected: " << nfi_expected << "\n"; + } + + if (nfe != nfe_expected || nfi != nfi_expected) + { + std::cout << ">>> Check failed <<<" << std::endl; + return 1; + } + + return 0; +} + +// ----------------------------------------------------------------------------- +// Functions called by the solver +// ----------------------------------------------------------------------------- + +// Explicit ODE RHS function fe(t,y) +int fe(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + sunrealtype* y_data = N_VGetArrayPointer(y); + sunrealtype* yd_data = N_VGetArrayPointer(ydot); + ProblemData* prob_data = static_cast(user_data); + + yd_data[0] = prob_data->lambda_e * y_data[0]; + + if (prob_data->p_type == prob_type::fixed_mass_matrix) + { + yd_data[0] *= TWO; + } + else if (prob_data->p_type == prob_type::time_dependent_mass_matrix) + { + yd_data[0] *= TWO + std::cos(t); + } + + return 0; +} + +// Implicit ODE RHS function fi(t,y) +int fi(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + sunrealtype* y_data = N_VGetArrayPointer(y); + sunrealtype* yd_data = N_VGetArrayPointer(ydot); + ProblemData* prob_data = static_cast(user_data); + + yd_data[0] = prob_data->lambda_i * y_data[0]; + + if (prob_data->p_type == prob_type::fixed_mass_matrix) + { + yd_data[0] *= TWO; + } + else if (prob_data->p_type == prob_type::time_dependent_mass_matrix) + { + yd_data[0] *= TWO + std::cos(t); + } + + return 0; +} + +// Jacobian routine to compute J(t,y) = dfi/dy. +int Ji(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, + N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +{ + sunrealtype* J_data = SUNDenseMatrix_Data(J); + ProblemData* prob_data = static_cast(user_data); + + J_data[0] = prob_data->lambda_i; + + return 0; +} + +int MassMatrix(sunrealtype t, SUNMatrix M, void *user_data, N_Vector tmp1, + N_Vector tmp2, N_Vector tmp3) +{ + sunrealtype* M_data = SUNDenseMatrix_Data(M); + ProblemData* prob_data = static_cast(user_data); + + if (prob_data->p_type == prob_type::fixed_mass_matrix) + { + M_data[0] = TWO; + } + else + { + M_data[0] = TWO + std::cos(t); + } + + return 0; +} + +// ----------------------------------------------------------------------------- +// Utility functions +// ----------------------------------------------------------------------------- + +// Check function return value +int check_flag(void* flagvalue, const std::string funcname, int opt) +{ + int* errflag; + + // Check if function returned NULL pointer - no memory allocated + if (opt == 0 && flagvalue == nullptr) + { + std::cerr << "\nMEMORY_ERROR: " << funcname + << " failed - returned NULL pointer\n\n"; + return 1; + } + // Check if flag < 0 + else if (opt == 1) + { + errflag = (int*)flagvalue; + if (*errflag < 0) + { + std::cerr << "\nSUNDIALS_ERROR: " << funcname + << " failed with flag = " << *errflag << "\n\n"; + return 1; + } + } + + return 0; +} diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark.out new file mode 100644 index 0000000000..92d1e73a20 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark.out @@ -0,0 +1,1972 @@ + +Dahlquist ODE test problem: + problem type = Identity + lambda expl = -1 + lambda impl = -1 + step size = 0.01 + relative tol = 0.0001 + absolute tol = 1e-06 + interp type = Hermite + +======================== +Test explicit RK methods +======================== + +======================== +Explicit Euler + stages: 1 + order: 1 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 1 + expected: 1 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Dense Output +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- + +======================== +ERK Table ID 0 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Dense Output +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- + +======================== +ERK Table ID 1 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- + +======================== +ERK Table ID 2 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Dense Output +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- + +======================== +ERK Table ID 3 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +ERK Table ID 4 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 5 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 6 + stages: 6 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +ERK Table ID 7 + stages: 6 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +ERK Table ID 8 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- + +======================== +ERK Table ID 9 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +ERK Table ID 10 + stages: 8 + order: 6 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 36 + expected: 36 +-------------------- + +======================== +ERK Table ID 11 + stages: 13 + order: 8 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 44 + expected: 44 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 56 + expected: 56 +-------------------- + +======================== +ERK Table ID 12 + stages: 3 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 13 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fe RHS evals: + actual: 22 + expected: 22 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +ERK Table ID 14 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +ERK Table ID 15 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +Test implicit RK methods +======================== + +======================== +Implicit Euler + stages: 1 + order: 1 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 1 +Fi RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 3 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Dense Output +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- + +======================== +DIRK Table ID 100 + stages: 2 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +DIRK Table ID 101 + stages: 3 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +DIRK Table ID 102 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +DIRK Table ID 103 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK Table ID 104 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK Table ID 105 + stages: 5 + order: 4 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 106 + stages: 5 + order: 4 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 107 + stages: 5 + order: 4 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 108 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK Table ID 109 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 110 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 38 + expected: 38 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 50 + expected: 50 +-------------------- + +======================== +DIRK Table ID 111 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fi RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 43 + expected: 43 +-------------------- +Dense Output +Fi RHS evals: + actual: 44 + expected: 44 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 58 + expected: 58 +-------------------- + +======================== +DIRK Table ID 112 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 113 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fi RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 43 + expected: 43 +-------------------- +Dense Output +Fi RHS evals: + actual: 44 + expected: 44 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 58 + expected: 58 +-------------------- + +======================== +DIRK Table ID 114 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK Table ID 115 + stages: 5 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK Table ID 116 + stages: 5 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK Table ID 117 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 118 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 119 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 120 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 121 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 38 + expected: 38 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 50 + expected: 50 +-------------------- + +======================== +DIRK Table ID 122 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 38 + expected: 38 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 50 + expected: 50 +-------------------- + +======================== +DIRK Table ID 123 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +===================== +Test IMEX ARK methods +===================== + +======================== +IMEX Euler + stages: 2 + order: 1 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 1 +Fe RHS evals: + actual: 2 + expected: 2 +Fi RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 3 +NLS iters: 3 +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Dense Output +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +NLS iters: 4 +Fe RHS evals: + actual: 5 + expected: 5 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- + +======================== +IMEX Table ID 0 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 1 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 2 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 3 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 4 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 5 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + + +All tests passed! diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_0.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_0.out new file mode 100644 index 0000000000..beedca56db --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_0.out @@ -0,0 +1,2182 @@ + +Dahlquist ODE test problem: + problem type = Identity + lambda expl = -1 + lambda impl = -1 + step size = 0.01 + relative tol = 0.0001 + absolute tol = 1e-06 + interp type = Hermite + +======================== +Test explicit RK methods +======================== + +======================== +Explicit Euler + stages: 1 + order: 1 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 1 + expected: 1 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Dense Output +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- + +======================== +ERK Table ID 0 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Dense Output +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- + +======================== +ERK Table ID 1 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- + +======================== +ERK Table ID 2 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Dense Output +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- + +======================== +ERK Table ID 3 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +ERK Table ID 4 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 5 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 6 + stages: 6 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +ERK Table ID 7 + stages: 6 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +ERK Table ID 8 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- + +======================== +ERK Table ID 9 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +ERK Table ID 10 + stages: 8 + order: 6 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 36 + expected: 36 +-------------------- + +======================== +ERK Table ID 11 + stages: 13 + order: 8 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 44 + expected: 44 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 56 + expected: 56 +-------------------- + +======================== +ERK Table ID 12 + stages: 3 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 13 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fe RHS evals: + actual: 22 + expected: 22 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +ERK Table ID 14 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +ERK Table ID 15 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 16 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +ERK Table ID 17 + stages: 3 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 18 + stages: 9 + order: 6 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fe RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 37 + expected: 37 +-------------------- + +======================== +ERK Table ID 19 + stages: 10 + order: 7 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 30 + expected: 30 +-------------------- +Dense Output +Fe RHS evals: + actual: 35 + expected: 35 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 44 + expected: 44 +-------------------- + +======================== +ERK Table ID 20 + stages: 13 + order: 8 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 44 + expected: 44 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 56 + expected: 56 +-------------------- + +======================== +ERK Table ID 21 + stages: 16 + order: 9 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 32 + expected: 32 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 48 + expected: 48 +-------------------- +Dense Output +Fe RHS evals: + actual: 53 + expected: 53 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 68 + expected: 68 +-------------------- + +======================== +Test implicit RK methods +======================== + +======================== +Implicit Euler + stages: 1 + order: 1 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 1 +Fi RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 3 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Dense Output +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- + +======================== +DIRK Table ID 100 + stages: 2 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +DIRK Table ID 101 + stages: 3 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +DIRK Table ID 102 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +DIRK Table ID 103 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK Table ID 104 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK Table ID 105 + stages: 5 + order: 4 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 106 + stages: 5 + order: 4 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 107 + stages: 5 + order: 4 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 108 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK Table ID 109 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 110 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 38 + expected: 38 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 50 + expected: 50 +-------------------- + +======================== +DIRK Table ID 111 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fi RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 43 + expected: 43 +-------------------- +Dense Output +Fi RHS evals: + actual: 44 + expected: 44 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 58 + expected: 58 +-------------------- + +======================== +DIRK Table ID 112 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 113 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fi RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 43 + expected: 43 +-------------------- +Dense Output +Fi RHS evals: + actual: 44 + expected: 44 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 58 + expected: 58 +-------------------- + +======================== +DIRK Table ID 114 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK Table ID 115 + stages: 5 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK Table ID 116 + stages: 5 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK Table ID 117 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 118 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 119 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 120 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 121 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 38 + expected: 38 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 50 + expected: 50 +-------------------- + +======================== +DIRK Table ID 122 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 38 + expected: 38 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 50 + expected: 50 +-------------------- + +======================== +DIRK Table ID 123 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +===================== +Test IMEX ARK methods +===================== + +======================== +IMEX Euler + stages: 2 + order: 1 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 1 +Fe RHS evals: + actual: 2 + expected: 2 +Fi RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 3 +NLS iters: 3 +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Dense Output +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +NLS iters: 4 +Fe RHS evals: + actual: 5 + expected: 5 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- + +======================== +IMEX Table ID 0 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 1 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 2 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 3 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 4 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 5 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + + +All tests passed! diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_1.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_1.out new file mode 100644 index 0000000000..215d59d55e --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_1.out @@ -0,0 +1,2182 @@ + +Dahlquist ODE test problem: + problem type = Identity + lambda expl = -1 + lambda impl = -1 + step size = 0.01 + relative tol = 0.0001 + absolute tol = 1e-06 + interp type = Lagrange + +======================== +Test explicit RK methods +======================== + +======================== +Explicit Euler + stages: 1 + order: 1 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 1 + expected: 1 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Dense Output +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- + +======================== +ERK Table ID 0 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Dense Output +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- + +======================== +ERK Table ID 1 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- + +======================== +ERK Table ID 2 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Dense Output +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- + +======================== +ERK Table ID 3 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +ERK Table ID 4 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 5 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 6 + stages: 6 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 7 + stages: 6 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 8 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +ERK Table ID 9 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 32 + expected: 32 +-------------------- + +======================== +ERK Table ID 10 + stages: 8 + order: 6 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 32 + expected: 32 +-------------------- + +======================== +ERK Table ID 11 + stages: 13 + order: 8 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 52 + expected: 52 +-------------------- + +======================== +ERK Table ID 12 + stages: 3 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 13 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fe RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +ERK Table ID 14 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 32 + expected: 32 +-------------------- + +======================== +ERK Table ID 15 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 16 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +ERK Table ID 17 + stages: 3 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 18 + stages: 9 + order: 6 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +ERK Table ID 19 + stages: 10 + order: 7 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 30 + expected: 30 +-------------------- +Dense Output +Fe RHS evals: + actual: 30 + expected: 30 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 40 + expected: 40 +-------------------- + +======================== +ERK Table ID 20 + stages: 13 + order: 8 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 52 + expected: 52 +-------------------- + +======================== +ERK Table ID 21 + stages: 16 + order: 9 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 32 + expected: 32 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 48 + expected: 48 +-------------------- +Dense Output +Fe RHS evals: + actual: 48 + expected: 48 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 64 + expected: 64 +-------------------- + +======================== +Test implicit RK methods +======================== + +======================== +Implicit Euler + stages: 1 + order: 1 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 1 +Fi RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 2 +NLS iters: 2 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 3 +NLS iters: 3 +Fi RHS evals: + actual: 6 + expected: 6 +-------------------- +Dense Output +Fi RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 4 +NLS iters: 4 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- + +======================== +DIRK Table ID 100 + stages: 2 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Dense Output +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- + +======================== +DIRK Table ID 101 + stages: 3 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fi RHS evals: + actual: 18 + expected: 18 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +DIRK Table ID 102 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +DIRK Table ID 103 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK Table ID 104 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK Table ID 105 + stages: 5 + order: 4 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Dense Output +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 40 + expected: 40 +-------------------- + +======================== +DIRK Table ID 106 + stages: 5 + order: 4 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Dense Output +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 40 + expected: 40 +-------------------- + +======================== +DIRK Table ID 107 + stages: 5 + order: 4 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Dense Output +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 40 + expected: 40 +-------------------- + +======================== +DIRK Table ID 108 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK Table ID 109 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 110 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 111 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fi RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 43 + expected: 43 +-------------------- +Dense Output +Fi RHS evals: + actual: 43 + expected: 43 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 57 + expected: 57 +-------------------- + +======================== +DIRK Table ID 112 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 113 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fi RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 43 + expected: 43 +-------------------- +Dense Output +Fi RHS evals: + actual: 43 + expected: 43 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 57 + expected: 57 +-------------------- + +======================== +DIRK Table ID 114 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK Table ID 115 + stages: 5 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK Table ID 116 + stages: 5 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK Table ID 117 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 118 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 119 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 120 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 121 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 122 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 123 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +===================== +Test IMEX ARK methods +===================== + +======================== +IMEX Euler + stages: 2 + order: 1 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 1 +Fe RHS evals: + actual: 2 + expected: 2 +Fi RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 3 +NLS iters: 3 +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Dense Output +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +NLS iters: 4 +Fe RHS evals: + actual: 5 + expected: 5 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- + +======================== +IMEX Table ID 0 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 1 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 2 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 3 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 4 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 5 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + + +All tests passed! diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_0.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_0.out new file mode 100644 index 0000000000..b2d194bc1e --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_0.out @@ -0,0 +1,2182 @@ + +Dahlquist ODE test problem: + problem type = Fixed mass matrix + lambda expl = -1 + lambda impl = -1 + step size = 0.01 + relative tol = 0.0001 + absolute tol = 1e-06 + interp type = Hermite + +======================== +Test explicit RK methods +======================== + +======================== +Explicit Euler + stages: 1 + order: 1 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 1 + expected: 1 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Dense Output +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- + +======================== +ERK Table ID 0 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Dense Output +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- + +======================== +ERK Table ID 1 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- + +======================== +ERK Table ID 2 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Dense Output +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- + +======================== +ERK Table ID 3 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +ERK Table ID 4 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 5 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 6 + stages: 6 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +ERK Table ID 7 + stages: 6 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +ERK Table ID 8 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- + +======================== +ERK Table ID 9 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +ERK Table ID 10 + stages: 8 + order: 6 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 36 + expected: 36 +-------------------- + +======================== +ERK Table ID 11 + stages: 13 + order: 8 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 44 + expected: 44 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 56 + expected: 56 +-------------------- + +======================== +ERK Table ID 12 + stages: 3 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 13 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fe RHS evals: + actual: 22 + expected: 22 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +ERK Table ID 14 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +ERK Table ID 15 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 16 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +ERK Table ID 17 + stages: 3 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 18 + stages: 9 + order: 6 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fe RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 37 + expected: 37 +-------------------- + +======================== +ERK Table ID 19 + stages: 10 + order: 7 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 30 + expected: 30 +-------------------- +Dense Output +Fe RHS evals: + actual: 35 + expected: 35 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 44 + expected: 44 +-------------------- + +======================== +ERK Table ID 20 + stages: 13 + order: 8 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 44 + expected: 44 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 56 + expected: 56 +-------------------- + +======================== +ERK Table ID 21 + stages: 16 + order: 9 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 32 + expected: 32 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 48 + expected: 48 +-------------------- +Dense Output +Fe RHS evals: + actual: 53 + expected: 53 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 68 + expected: 68 +-------------------- + +======================== +Test implicit RK methods +======================== + +======================== +Implicit Euler + stages: 1 + order: 1 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 1 +Fi RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 3 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Dense Output +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- + +======================== +DIRK Table ID 100 + stages: 2 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +DIRK Table ID 101 + stages: 3 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +DIRK Table ID 102 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +DIRK Table ID 103 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK Table ID 104 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK Table ID 105 + stages: 5 + order: 4 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 106 + stages: 5 + order: 4 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 107 + stages: 5 + order: 4 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 108 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK Table ID 109 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 110 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 38 + expected: 38 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 50 + expected: 50 +-------------------- + +======================== +DIRK Table ID 111 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fi RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 43 + expected: 43 +-------------------- +Dense Output +Fi RHS evals: + actual: 44 + expected: 44 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 58 + expected: 58 +-------------------- + +======================== +DIRK Table ID 112 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 113 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fi RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 43 + expected: 43 +-------------------- +Dense Output +Fi RHS evals: + actual: 44 + expected: 44 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 58 + expected: 58 +-------------------- + +======================== +DIRK Table ID 114 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK Table ID 115 + stages: 5 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK Table ID 116 + stages: 5 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK Table ID 117 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 118 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 119 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 120 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 121 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 38 + expected: 38 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 50 + expected: 50 +-------------------- + +======================== +DIRK Table ID 122 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 38 + expected: 38 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 50 + expected: 50 +-------------------- + +======================== +DIRK Table ID 123 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +===================== +Test IMEX ARK methods +===================== + +======================== +IMEX Euler + stages: 2 + order: 1 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 1 +Fe RHS evals: + actual: 2 + expected: 2 +Fi RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 3 +NLS iters: 3 +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Dense Output +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +NLS iters: 4 +Fe RHS evals: + actual: 5 + expected: 5 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- + +======================== +IMEX Table ID 0 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 1 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 2 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 3 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 4 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 5 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + + +All tests passed! diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_1.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_1.out new file mode 100644 index 0000000000..0f7bb5584a --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_1.out @@ -0,0 +1,2182 @@ + +Dahlquist ODE test problem: + problem type = Fixed mass matrix + lambda expl = -1 + lambda impl = -1 + step size = 0.01 + relative tol = 0.0001 + absolute tol = 1e-06 + interp type = Lagrange + +======================== +Test explicit RK methods +======================== + +======================== +Explicit Euler + stages: 1 + order: 1 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 1 + expected: 1 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Dense Output +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- + +======================== +ERK Table ID 0 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Dense Output +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- + +======================== +ERK Table ID 1 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- + +======================== +ERK Table ID 2 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Dense Output +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- + +======================== +ERK Table ID 3 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +ERK Table ID 4 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 5 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 6 + stages: 6 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 7 + stages: 6 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 8 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +ERK Table ID 9 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 32 + expected: 32 +-------------------- + +======================== +ERK Table ID 10 + stages: 8 + order: 6 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 32 + expected: 32 +-------------------- + +======================== +ERK Table ID 11 + stages: 13 + order: 8 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 52 + expected: 52 +-------------------- + +======================== +ERK Table ID 12 + stages: 3 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 13 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fe RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +ERK Table ID 14 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 32 + expected: 32 +-------------------- + +======================== +ERK Table ID 15 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 16 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +ERK Table ID 17 + stages: 3 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 18 + stages: 9 + order: 6 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +ERK Table ID 19 + stages: 10 + order: 7 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 30 + expected: 30 +-------------------- +Dense Output +Fe RHS evals: + actual: 30 + expected: 30 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 40 + expected: 40 +-------------------- + +======================== +ERK Table ID 20 + stages: 13 + order: 8 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 52 + expected: 52 +-------------------- + +======================== +ERK Table ID 21 + stages: 16 + order: 9 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 32 + expected: 32 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 48 + expected: 48 +-------------------- +Dense Output +Fe RHS evals: + actual: 48 + expected: 48 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 64 + expected: 64 +-------------------- + +======================== +Test implicit RK methods +======================== + +======================== +Implicit Euler + stages: 1 + order: 1 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 1 +Fi RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 2 +NLS iters: 2 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 3 +NLS iters: 3 +Fi RHS evals: + actual: 6 + expected: 6 +-------------------- +Dense Output +Fi RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 4 +NLS iters: 4 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- + +======================== +DIRK Table ID 100 + stages: 2 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Dense Output +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- + +======================== +DIRK Table ID 101 + stages: 3 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fi RHS evals: + actual: 18 + expected: 18 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +DIRK Table ID 102 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +DIRK Table ID 103 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK Table ID 104 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK Table ID 105 + stages: 5 + order: 4 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Dense Output +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 40 + expected: 40 +-------------------- + +======================== +DIRK Table ID 106 + stages: 5 + order: 4 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Dense Output +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 40 + expected: 40 +-------------------- + +======================== +DIRK Table ID 107 + stages: 5 + order: 4 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Dense Output +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 40 + expected: 40 +-------------------- + +======================== +DIRK Table ID 108 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK Table ID 109 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 110 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 111 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fi RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 43 + expected: 43 +-------------------- +Dense Output +Fi RHS evals: + actual: 43 + expected: 43 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 57 + expected: 57 +-------------------- + +======================== +DIRK Table ID 112 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 113 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fi RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 43 + expected: 43 +-------------------- +Dense Output +Fi RHS evals: + actual: 43 + expected: 43 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 57 + expected: 57 +-------------------- + +======================== +DIRK Table ID 114 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK Table ID 115 + stages: 5 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK Table ID 116 + stages: 5 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK Table ID 117 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 118 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 119 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 120 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 121 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 122 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 123 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +===================== +Test IMEX ARK methods +===================== + +======================== +IMEX Euler + stages: 2 + order: 1 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 1 +Fe RHS evals: + actual: 2 + expected: 2 +Fi RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 3 +NLS iters: 3 +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Dense Output +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +NLS iters: 4 +Fe RHS evals: + actual: 5 + expected: 5 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- + +======================== +IMEX Table ID 0 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 1 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 2 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 3 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 4 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 5 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + + +All tests passed! diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_0.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_0.out new file mode 100644 index 0000000000..0d00667042 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_0.out @@ -0,0 +1,2182 @@ + +Dahlquist ODE test problem: + problem type = Time-dependent mass matrix + lambda expl = -1 + lambda impl = -1 + step size = 0.01 + relative tol = 0.0001 + absolute tol = 1e-06 + interp type = Hermite + +======================== +Test explicit RK methods +======================== + +======================== +Explicit Euler + stages: 1 + order: 1 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 1 + expected: 1 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Dense Output +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- + +======================== +ERK Table ID 0 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Dense Output +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- + +======================== +ERK Table ID 1 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- + +======================== +ERK Table ID 2 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Dense Output +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- + +======================== +ERK Table ID 3 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +ERK Table ID 4 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 5 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 6 + stages: 6 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +ERK Table ID 7 + stages: 6 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +ERK Table ID 8 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- + +======================== +ERK Table ID 9 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +ERK Table ID 10 + stages: 8 + order: 6 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 36 + expected: 36 +-------------------- + +======================== +ERK Table ID 11 + stages: 13 + order: 8 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 44 + expected: 44 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 56 + expected: 56 +-------------------- + +======================== +ERK Table ID 12 + stages: 3 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 13 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fe RHS evals: + actual: 22 + expected: 22 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +ERK Table ID 14 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +ERK Table ID 15 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 16 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +ERK Table ID 17 + stages: 3 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 18 + stages: 9 + order: 6 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fe RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 37 + expected: 37 +-------------------- + +======================== +ERK Table ID 19 + stages: 10 + order: 7 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 30 + expected: 30 +-------------------- +Dense Output +Fe RHS evals: + actual: 35 + expected: 35 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 44 + expected: 44 +-------------------- + +======================== +ERK Table ID 20 + stages: 13 + order: 8 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 44 + expected: 44 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 56 + expected: 56 +-------------------- + +======================== +ERK Table ID 21 + stages: 16 + order: 9 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 32 + expected: 32 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 48 + expected: 48 +-------------------- +Dense Output +Fe RHS evals: + actual: 53 + expected: 53 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 68 + expected: 68 +-------------------- + +======================== +Test implicit RK methods +======================== + +======================== +Implicit Euler + stages: 1 + order: 1 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 1 +Fi RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 3 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Dense Output +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- + +======================== +DIRK Table ID 100 + stages: 2 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +DIRK Table ID 101 + stages: 3 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +DIRK Table ID 102 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +DIRK Table ID 103 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK Table ID 104 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK Table ID 105 + stages: 5 + order: 4 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 106 + stages: 5 + order: 4 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 107 + stages: 5 + order: 4 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 108 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK Table ID 109 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 110 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 38 + expected: 38 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 50 + expected: 50 +-------------------- + +======================== +DIRK Table ID 111 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fi RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 43 + expected: 43 +-------------------- +Dense Output +Fi RHS evals: + actual: 44 + expected: 44 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 58 + expected: 58 +-------------------- + +======================== +DIRK Table ID 112 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 113 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fi RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 43 + expected: 43 +-------------------- +Dense Output +Fi RHS evals: + actual: 44 + expected: 44 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 58 + expected: 58 +-------------------- + +======================== +DIRK Table ID 114 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK Table ID 115 + stages: 5 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK Table ID 116 + stages: 5 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK Table ID 117 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 118 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 119 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 120 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 121 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 38 + expected: 38 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 50 + expected: 50 +-------------------- + +======================== +DIRK Table ID 122 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 38 + expected: 38 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 50 + expected: 50 +-------------------- + +======================== +DIRK Table ID 123 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +===================== +Test IMEX ARK methods +===================== + +======================== +IMEX Euler + stages: 2 + order: 1 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 1 +Fe RHS evals: + actual: 2 + expected: 2 +Fi RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 3 +NLS iters: 3 +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Dense Output +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +NLS iters: 4 +Fe RHS evals: + actual: 5 + expected: 5 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- + +======================== +IMEX Table ID 0 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 1 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 2 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 3 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 4 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 5 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + + +All tests passed! diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_1.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_1.out new file mode 100644 index 0000000000..b48ee0df1d --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_1.out @@ -0,0 +1,2182 @@ + +Dahlquist ODE test problem: + problem type = Time-dependent mass matrix + lambda expl = -1 + lambda impl = -1 + step size = 0.01 + relative tol = 0.0001 + absolute tol = 1e-06 + interp type = Lagrange + +======================== +Test explicit RK methods +======================== + +======================== +Explicit Euler + stages: 1 + order: 1 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 1 + expected: 1 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Dense Output +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- + +======================== +ERK Table ID 0 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Dense Output +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- + +======================== +ERK Table ID 1 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- + +======================== +ERK Table ID 2 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Dense Output +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- + +======================== +ERK Table ID 3 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +ERK Table ID 4 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 5 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 6 + stages: 6 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 7 + stages: 6 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 8 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +ERK Table ID 9 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 32 + expected: 32 +-------------------- + +======================== +ERK Table ID 10 + stages: 8 + order: 6 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 32 + expected: 32 +-------------------- + +======================== +ERK Table ID 11 + stages: 13 + order: 8 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 52 + expected: 52 +-------------------- + +======================== +ERK Table ID 12 + stages: 3 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 13 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fe RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +ERK Table ID 14 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 32 + expected: 32 +-------------------- + +======================== +ERK Table ID 15 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 16 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +ERK Table ID 17 + stages: 3 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 18 + stages: 9 + order: 6 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +ERK Table ID 19 + stages: 10 + order: 7 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 30 + expected: 30 +-------------------- +Dense Output +Fe RHS evals: + actual: 30 + expected: 30 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 40 + expected: 40 +-------------------- + +======================== +ERK Table ID 20 + stages: 13 + order: 8 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 52 + expected: 52 +-------------------- + +======================== +ERK Table ID 21 + stages: 16 + order: 9 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 32 + expected: 32 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 48 + expected: 48 +-------------------- +Dense Output +Fe RHS evals: + actual: 48 + expected: 48 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 64 + expected: 64 +-------------------- + +======================== +Test implicit RK methods +======================== + +======================== +Implicit Euler + stages: 1 + order: 1 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 1 +Fi RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 2 +NLS iters: 2 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 3 +NLS iters: 3 +Fi RHS evals: + actual: 6 + expected: 6 +-------------------- +Dense Output +Fi RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 4 +NLS iters: 4 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- + +======================== +DIRK Table ID 100 + stages: 2 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Dense Output +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- + +======================== +DIRK Table ID 101 + stages: 3 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fi RHS evals: + actual: 18 + expected: 18 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +DIRK Table ID 102 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +DIRK Table ID 103 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK Table ID 104 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK Table ID 105 + stages: 5 + order: 4 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Dense Output +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 40 + expected: 40 +-------------------- + +======================== +DIRK Table ID 106 + stages: 5 + order: 4 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Dense Output +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 40 + expected: 40 +-------------------- + +======================== +DIRK Table ID 107 + stages: 5 + order: 4 + explicit 1st stage: 0 + stiffly accurate: 1 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Dense Output +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 40 + expected: 40 +-------------------- + +======================== +DIRK Table ID 108 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK Table ID 109 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 110 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 111 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fi RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 43 + expected: 43 +-------------------- +Dense Output +Fi RHS evals: + actual: 43 + expected: 43 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 57 + expected: 57 +-------------------- + +======================== +DIRK Table ID 112 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 113 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fi RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 43 + expected: 43 +-------------------- +Dense Output +Fi RHS evals: + actual: 43 + expected: 43 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 57 + expected: 57 +-------------------- + +======================== +DIRK Table ID 114 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK Table ID 115 + stages: 5 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK Table ID 116 + stages: 5 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK Table ID 117 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 118 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 119 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Dense Output +Fi RHS evals: + actual: 31 + expected: 31 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 41 + expected: 41 +-------------------- + +======================== +DIRK Table ID 120 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 121 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 122 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Dense Output +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- + +======================== +DIRK Table ID 123 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +===================== +Test IMEX ARK methods +===================== + +======================== +IMEX Euler + stages: 2 + order: 1 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 1 +Fe RHS evals: + actual: 2 + expected: 2 +Fi RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 3 +NLS iters: 3 +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Dense Output +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +NLS iters: 4 +Fe RHS evals: + actual: 5 + expected: 5 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- + +======================== +IMEX Table ID 0 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 1 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 2 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 3 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 4 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +IMEX Table ID 5 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- + + +All tests passed! diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk.cpp new file mode 100644 index 0000000000..ec10883eeb --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk.cpp @@ -0,0 +1,529 @@ +/* --------------------------------------------------------------------------- + * Programmer(s): David J. Gardner @ LLNL + * --------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2023, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * --------------------------------------------------------------------------- + * Dahlquist problem: + * + * y' = lambda_e * y + * ---------------------------------------------------------------------------*/ + +// Header files +#include +#include +#include +#include +#include + +#include +#include +#include "arkode/arkode_butcher.h" + +#if defined(SUNDIALS_EXTENDED_PRECISION) +#define GSYM "Lg" +#define ESYM "Le" +#define FSYM "Lf" +#else +#define GSYM "g" +#define ESYM "e" +#define FSYM "f" +#endif + +// Constants +#define NEG_ONE SUN_RCONST(-1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) + +enum class interp_type +{ + hermite, + lagrange +}; + +// Problem parameters +struct ProblemData +{ + sunrealtype lambda_e = NEG_ONE; + sunrealtype lambda_i = NEG_ONE; +}; + +// Problem options +struct ProblemOptions +{ + // Initial time + sunrealtype t0 = ZERO; + + // Relative and absolute tolerances + sunrealtype reltol = SUN_RCONST(1.0e-4); + sunrealtype abstol = SUN_RCONST(1.0e-6); + + // Step size + sunrealtype h = SUN_RCONST(0.01); + + // Interpolant type + // 0 = Hermite + // 1 = Lagrange + interp_type i_type = interp_type::hermite; +}; + +// User-supplied Functions called by the solver +int fe(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); + +// Private function to check function return values +int check_flag(void* flagvalue, const std::string funcname, int opt); + +// Test drivers +int run_tests(ARKodeButcherTable Be, ProblemData& prob_data, + ProblemOptions& prob_opts, sundials::Context& sunctx); + +int get_method_properties(ARKodeButcherTable Be, int& stages, int& order, + bool& explicit_first_stage, bool& stiffly_accurate, + bool& fsal); + +int expected_rhs_evals(interp_type i_type, int stages, + bool explicit_first_stage, bool stiffly_accurate, + bool fsal, void* erkstep_mem, long int& nfe_expected); + +int check_rhs_evals(void* erkstep_mem, long int nfe_expected); + +// ----------------------------------------------------------------------------- +// Main Program +// ----------------------------------------------------------------------------- + +int main(int argc, char* argv[]) +{ + // Problem data and options structures + ProblemData prob_data; + ProblemOptions prob_opts; + + // Check for inputs + if (argc > 1) + { + if (std::stoi(argv[1]) == 0) + { + prob_opts.i_type = interp_type::hermite; + } + else + { + prob_opts.i_type = interp_type::lagrange; + } + } + + // Output problem setup + std::cout << "\nDahlquist ODE test problem:\n" + << " lambda expl = " << prob_data.lambda_e << "\n" + << " step size = " << prob_opts.h << "\n" + << " relative tol = " << prob_opts.reltol << "\n" + << " absolute tol = " << prob_opts.abstol << "\n"; + if (prob_opts.i_type == interp_type::hermite) + { + std::cout << " interp type = Hermite\n"; + } + else + { + std::cout << " interp type = Lagrange\n"; + } + + // Create SUNDIALS context + sundials::Context sunctx; + + // Test methods + int flag, numfails = 0; + + ARKodeButcherTable Be = nullptr; + + int stages, order; + bool explicit_first_stage, stiffly_accurate, fsal; + + // -------- + // Explicit + // -------- + + std::cout << "\n========================\n" + << "Test explicit RK methods\n" + << "========================\n"; + + Be = ARKodeButcherTable_Alloc(1, SUNFALSE); + Be->A[0][0] = ZERO; + Be->b[0] = ONE; + Be->c[0] = ZERO; + Be->q = 1; + + flag = get_method_properties(Be, stages, order, explicit_first_stage, + stiffly_accurate, fsal); + if (check_flag(&flag, "get_method_properties", 1)) return 1; + + std::cout << "\n========================" << std::endl; + std::cout << "Explicit Euler" << std::endl; + std::cout << " stages: " << stages << std::endl; + std::cout << " order: " << order << std::endl; + std::cout << " explicit 1st stage: " << explicit_first_stage << std::endl; + std::cout << " stiffly accurate: " << stiffly_accurate << std::endl; + std::cout << " first same as last: " << fsal << std::endl; + std::cout << "========================" << std::endl; + + numfails += run_tests(Be, prob_data, prob_opts, sunctx); + + ARKodeButcherTable_Free(Be); + Be = nullptr; + + for (int i = ARKODE_MIN_ERK_NUM; i <= ARKODE_MAX_ERK_NUM; i++) + { + Be = ARKodeButcherTable_LoadERK(static_cast(i)); + flag = get_method_properties(Be, stages, order, explicit_first_stage, + stiffly_accurate, fsal); + if (check_flag(&flag, "get_method_properties", 1)) return 1; + + std::cout << "\n========================" << std::endl; + std::cout << "ERK Table ID " << i << std::endl; + std::cout << " stages: " << stages << std::endl; + std::cout << " order: " << order << std::endl; + std::cout << " explicit 1st stage: " << explicit_first_stage << std::endl; + std::cout << " stiffly accurate: " << stiffly_accurate << std::endl; + std::cout << " first same as last: " << fsal << std::endl; + std::cout << "========================" << std::endl; + + numfails += run_tests(Be, prob_data, prob_opts, sunctx); + + ARKodeButcherTable_Free(Be); + Be = nullptr; + } + + if (numfails) { std::cout << "\n\nFailed " << numfails << " tests!\n"; } + else { std::cout << "\n\nAll tests passed!\n"; } + + // Return test status + return numfails; +} + +// ----------------------------------------------------------------------------- +// Test drivers +// ----------------------------------------------------------------------------- + +int run_tests(ARKodeButcherTable Be, ProblemData& prob_data, + ProblemOptions& prob_opts, sundials::Context& sunctx) +{ + // Reusable error-checking flag + int flag; + + // Test failure counter + int numfails = 0; + + // Get method properties + int stages, order; + bool explicit_first_stage, stiffly_accurate, fsal; + flag = get_method_properties(Be, stages, order, explicit_first_stage, + stiffly_accurate, fsal); + if (check_flag(&flag, "get_method_properties", 1)) return 1; + + // Create initial condition vector + N_Vector y = N_VNew_Serial(1, sunctx); + if (check_flag((void*)y, "N_VNew_Serial", 0)) return 1; + + N_VConst(SUN_RCONST(1.0), y); + + // ----------------- + // Create integrator + // ----------------- + + // Create integrator based on type + void* erkstep_mem = nullptr; + + erkstep_mem = ERKStepCreate(fe, prob_opts.t0, y, sunctx); + if (check_flag((void*)erkstep_mem, "ERKStepCreate", 0)) return 1; + + // Set user data + flag = ERKStepSetUserData(erkstep_mem, &prob_data); + if (check_flag(&flag, "ERKStepSetUserData", 1)) return 1; + + // Specify tolerances + flag = ERKStepSStolerances(erkstep_mem, prob_opts.reltol, prob_opts.abstol); + if (check_flag(&flag, "ERKStepSStolerances", 1)) return 1; + + // Specify fixed time step size + flag = ERKStepSetFixedStep(erkstep_mem, prob_opts.h); + if (check_flag(&flag, "ERKStepSetFixedStep", 1)) return 1; + + // Lagrange interpolant (removes additional RHS evaluation with DIRK methods) + if (prob_opts.i_type == interp_type::lagrange) + { + flag = ERKStepSetInterpolantType(erkstep_mem, ARK_INTERP_LAGRANGE); + if (check_flag(&flag, "ERKStepSetInterpolantType", 1)) return 1; + } + + // Attach Butcher tables + flag = ERKStepSetTable(erkstep_mem, Be); + if (check_flag(&flag, "ERKStepSetTables", 1)) return 1; + + // -------------- + // Evolve in time + // -------------- + + sunrealtype t_ret = prob_opts.t0; + sunrealtype t_out = 3 * prob_opts.h; + + long int nfe_expected; + + for (int i = 0; i < 3; i++) + { + std::cout << "--------------------" << std::endl; + + // Advance in time + flag = ERKStepEvolve(erkstep_mem, t_out, y, &t_ret, ARK_ONE_STEP); + if (check_flag(&flag, "ERKStepEvolve", 1)) return 1; + + // Update output time + t_out += prob_opts.h; + + // Check statistics + flag = expected_rhs_evals(prob_opts.i_type, stages, + explicit_first_stage, stiffly_accurate, fsal, + erkstep_mem,nfe_expected); + if (check_flag(&flag, "expected_rhs_evals", 1)) return 1; + + numfails += check_rhs_evals(erkstep_mem, nfe_expected); + + if (numfails) + { + std::cout << "Failed " << numfails << " checks\n"; + break; + } + } + + // ---------------- + // Get dense output + // ---------------- + + long int extra_fe_evals = 0; + + if (numfails == 0) + { + std::cout << "--------------------" << std::endl; + std::cout << "Dense Output" << std::endl; + + sunrealtype h_last; + flag = ERKStepGetLastStep(erkstep_mem, &h_last); + if (check_flag(&flag, "ERKStepGetLastStep", 1)) return 1; + + flag = ERKStepGetDky(erkstep_mem, t_ret - h_last / TWO, 0, y); + if (check_flag(&flag, "ERKStepGetDky", 1)) return 1; + + // Stiffly accurate (and FSAL) methods do not require an additional RHS + // evaluation to get the new RHS value at the end of a step for dense + // output. However, for methods with an explicit first stage this evaluation + // can be used at the start of the next step. For methods with an implicit + // first stage that are not stiffly accurate this evaluation replaces one + // that would happen at the end of the next step (this is accounted for in + // expected_rhs_evals after the next step is taken below). + if (prob_opts.i_type == interp_type::hermite && !stiffly_accurate) + { + nfe_expected++; + } + + // Higher order methods require additional RHS evaluations for dense output + // with the Hermite interpolant (note default degree is order - 1, except + // for first order where the degree is 1. These are not accounted for in + // explicit_rhs_evals and must be carried forward. + int degree = (order == 1) ? 1 : order - 1; + if (prob_opts.i_type == interp_type::hermite && degree > 3) + { + extra_fe_evals += (degree == 4) ? 1 : 4; + } + + numfails += check_rhs_evals(erkstep_mem, + nfe_expected + extra_fe_evals); + + std::cout << "--------------------" << std::endl; + } + + // -------------------- + // Additional time step + // -------------------- + + if (numfails == 0) + { + // Advance in time + flag = ERKStepEvolve(erkstep_mem, t_out, y, &t_ret, ARK_ONE_STEP); + if (check_flag(&flag, "ERKStepEvolve", 1)) return 1; + + // Update output time + t_out += prob_opts.h; + + // Check statistics + flag = expected_rhs_evals(prob_opts.i_type, stages, + explicit_first_stage, stiffly_accurate, fsal, + erkstep_mem, nfe_expected); + if (check_flag(&flag, "expected_rhs_evals", 1)) return 1; + + numfails += check_rhs_evals(erkstep_mem, + nfe_expected + extra_fe_evals); + + std::cout << "--------------------" << std::endl; + } + + // -------- + // Clean up + // -------- + + ERKStepFree(&erkstep_mem); + N_VDestroy(y); + + return numfails; +} + +int get_method_properties(ARKodeButcherTable Be, int& stages, int& order, + bool& explicit_first_stage, bool& stiffly_accurate, + bool& fsal) +{ + stages = 0; + if (Be) { stages = Be->stages; } + else + { + std::cerr << "ERROR: Butcher table is NULL!" << std::endl; + return 1; + } + + order = 0; + if (Be) { order= Be->q; } + else + { + std::cerr << "ERROR: Both Butcher tables are NULL!" << std::endl; + return 1; + } + + // Check for explicit first stage + explicit_first_stage = true; + if (std::abs(Be->A[0][0]) > ZERO) { explicit_first_stage = false; } + + // Check for stiffly accurate method + stiffly_accurate = ARKodeButcherTable_IsStifflyAccurate(Be); + + // Check for first same as last (FSAL) property + fsal = explicit_first_stage && stiffly_accurate; + + return 0; +} + +int expected_rhs_evals(interp_type i_type, int stages, + bool explicit_first_stage, bool stiffly_accurate, + bool fsal, void* erkstep_mem, + long int& nfe_expected) +{ + int flag = 0; + + // Get number of steps and nonlinear solver iterations + long int nst = 0; + flag = ERKStepGetNumSteps(erkstep_mem, &nst); + if (check_flag(&flag, "ERKStepGetNumSteps", 1)) return 1; + + // Expected number of explicit functions evaluations + nfe_expected = 0; + if (fsal) + { + // Save one function evaluation after first step + nfe_expected = stages + (stages - 1) * (nst - 1); + } + else + { + nfe_expected = stages * nst; + } + + if (i_type == interp_type::hermite && !explicit_first_stage) + { + if (stiffly_accurate) + { + // One extra evaluation in the first step only + nfe_expected++; + } + else + { + // One extra evaluation in each step + nfe_expected += nst; + } + } + + std::cout << "Steps: " << nst << std::endl; + + return 0; +} + +int check_rhs_evals(void* erkstep_mem, long int nfe_expected) +{ + int flag = 0; + + long int nst = 0; + flag = ERKStepGetNumSteps(erkstep_mem, &nst); + if (check_flag(&flag, "ERKStepGetNumSteps", 1)) return 1; + + long int nfe; + flag = ERKStepGetNumRhsEvals(erkstep_mem, &nfe); + if (check_flag(&flag, "ERKStepGetNumRhsEvals", 1)) return 1; + + std::cout << "Fe RHS evals:\n" + << " actual: " << nfe << "\n" + << " expected: " << nfe_expected << "\n"; + + if (nfe != nfe_expected) + { + std::cout << ">>> Check failed <<<" << std::endl; + return 1; + } + + return 0; +} + +// ----------------------------------------------------------------------------- +// Functions called by the solver +// ----------------------------------------------------------------------------- + +// Explicit ODE RHS function fe(t,y) +int fe(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + sunrealtype* y_data = N_VGetArrayPointer(y); + sunrealtype* yd_data = N_VGetArrayPointer(ydot); + ProblemData* prob_data = static_cast(user_data); + + yd_data[0] = prob_data->lambda_e * y_data[0]; + + return 0; +} + +// ----------------------------------------------------------------------------- +// Utility functions +// ----------------------------------------------------------------------------- + +// Check function return value +int check_flag(void* flagvalue, const std::string funcname, int opt) +{ + int* errflag; + + // Check if function returned NULL pointer - no memory allocated + if (opt == 0 && flagvalue == nullptr) + { + std::cerr << "\nMEMORY_ERROR: " << funcname + << " failed - returned NULL pointer\n\n"; + return 1; + } + // Check if flag < 0 + else if (opt == 1) + { + errflag = (int*)flagvalue; + if (*errflag < 0) + { + std::cerr << "\nSUNDIALS_ERROR: " << funcname + << " failed with flag = " << *errflag << "\n\n"; + return 1; + } + } + + return 0; +} diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk.out new file mode 100644 index 0000000000..d4900dcca0 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk.out @@ -0,0 +1,609 @@ + +Dahlquist ODE test problem: + lambda expl = -1 + step size = 0.01 + relative tol = 0.0001 + absolute tol = 1e-06 + interp type = Hermite + +======================== +Test explicit RK methods +======================== + +======================== +Explicit Euler + stages: 1 + order: 1 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 1 + expected: 1 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Dense Output +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- + +======================== +ERK Table ID 0 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Dense Output +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- + +======================== +ERK Table ID 1 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- + +======================== +ERK Table ID 2 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Dense Output +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- + +======================== +ERK Table ID 3 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +ERK Table ID 4 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 5 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 6 + stages: 6 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +ERK Table ID 7 + stages: 6 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +ERK Table ID 8 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- + +======================== +ERK Table ID 9 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +ERK Table ID 10 + stages: 8 + order: 6 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 36 + expected: 36 +-------------------- + +======================== +ERK Table ID 11 + stages: 13 + order: 8 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 44 + expected: 44 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 56 + expected: 56 +-------------------- + +======================== +ERK Table ID 12 + stages: 3 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 13 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fe RHS evals: + actual: 22 + expected: 22 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +ERK Table ID 14 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +ERK Table ID 15 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + + +All tests passed! diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk_0.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk_0.out new file mode 100644 index 0000000000..7e2256037c --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk_0.out @@ -0,0 +1,819 @@ + +Dahlquist ODE test problem: + lambda expl = -1 + step size = 0.01 + relative tol = 0.0001 + absolute tol = 1e-06 + interp type = Hermite + +======================== +Test explicit RK methods +======================== + +======================== +Explicit Euler + stages: 1 + order: 1 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 1 + expected: 1 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Dense Output +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- + +======================== +ERK Table ID 0 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Dense Output +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- + +======================== +ERK Table ID 1 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- + +======================== +ERK Table ID 2 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Dense Output +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- + +======================== +ERK Table ID 3 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +ERK Table ID 4 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 5 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 6 + stages: 6 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +ERK Table ID 7 + stages: 6 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +ERK Table ID 8 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- + +======================== +ERK Table ID 9 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +ERK Table ID 10 + stages: 8 + order: 6 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 36 + expected: 36 +-------------------- + +======================== +ERK Table ID 11 + stages: 13 + order: 8 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 44 + expected: 44 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 56 + expected: 56 +-------------------- + +======================== +ERK Table ID 12 + stages: 3 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 13 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fe RHS evals: + actual: 22 + expected: 22 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +ERK Table ID 14 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +ERK Table ID 15 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 16 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +ERK Table ID 17 + stages: 3 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 18 + stages: 9 + order: 6 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fe RHS evals: + actual: 29 + expected: 29 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 37 + expected: 37 +-------------------- + +======================== +ERK Table ID 19 + stages: 10 + order: 7 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 30 + expected: 30 +-------------------- +Dense Output +Fe RHS evals: + actual: 35 + expected: 35 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 44 + expected: 44 +-------------------- + +======================== +ERK Table ID 20 + stages: 13 + order: 8 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 44 + expected: 44 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 56 + expected: 56 +-------------------- + +======================== +ERK Table ID 21 + stages: 16 + order: 9 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 32 + expected: 32 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 48 + expected: 48 +-------------------- +Dense Output +Fe RHS evals: + actual: 53 + expected: 53 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 68 + expected: 68 +-------------------- + + +All tests passed! diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk_1.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk_1.out new file mode 100644 index 0000000000..74bc1b6a8d --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk_1.out @@ -0,0 +1,819 @@ + +Dahlquist ODE test problem: + lambda expl = -1 + step size = 0.01 + relative tol = 0.0001 + absolute tol = 1e-06 + interp type = Lagrange + +======================== +Test explicit RK methods +======================== + +======================== +Explicit Euler + stages: 1 + order: 1 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 1 + expected: 1 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Dense Output +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- + +======================== +ERK Table ID 0 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Dense Output +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- + +======================== +ERK Table ID 1 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- + +======================== +ERK Table ID 2 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Dense Output +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- + +======================== +ERK Table ID 3 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 15 + expected: 15 +-------------------- +Dense Output +Fe RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- + +======================== +ERK Table ID 4 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 5 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 6 + stages: 6 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 7 + stages: 6 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 18 + expected: 18 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +ERK Table ID 8 + stages: 7 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fe RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +ERK Table ID 9 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 32 + expected: 32 +-------------------- + +======================== +ERK Table ID 10 + stages: 8 + order: 6 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 32 + expected: 32 +-------------------- + +======================== +ERK Table ID 11 + stages: 13 + order: 8 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 52 + expected: 52 +-------------------- + +======================== +ERK Table ID 12 + stages: 3 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 13 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fe RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +ERK Table ID 14 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 32 + expected: 32 +-------------------- + +======================== +ERK Table ID 15 + stages: 3 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 16 + stages: 5 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +ERK Table ID 17 + stages: 3 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +ERK Table ID 18 + stages: 9 + order: 6 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 17 + expected: 17 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- +Dense Output +Fe RHS evals: + actual: 25 + expected: 25 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +ERK Table ID 19 + stages: 10 + order: 7 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 30 + expected: 30 +-------------------- +Dense Output +Fe RHS evals: + actual: 30 + expected: 30 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 40 + expected: 40 +-------------------- + +======================== +ERK Table ID 20 + stages: 13 + order: 8 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 39 + expected: 39 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 52 + expected: 52 +-------------------- + +======================== +ERK Table ID 21 + stages: 16 + order: 9 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +Fe RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 2 +Fe RHS evals: + actual: 32 + expected: 32 +-------------------- +Steps: 3 +Fe RHS evals: + actual: 48 + expected: 48 +-------------------- +Dense Output +Fe RHS evals: + actual: 48 + expected: 48 +-------------------- +Steps: 4 +Fe RHS evals: + actual: 64 + expected: 64 +-------------------- + + +All tests passed! diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri.cpp index ffb23ec7c1..0e491eb229 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri.cpp @@ -18,6 +18,7 @@ // Header files #include +#include #include #include #include @@ -268,9 +269,9 @@ int run_tests(MRISTEP_METHOD_TYPE type, realtype t0, int nsteps, num_methods = 3; methods = new ARKODE_MRITableID[num_methods]; - methods[0] = ARKODE_MRI_GARK_ERK45a; + methods[0] = ARKODE_MIS_KW3; methods[1] = ARKODE_MRI_GARK_ERK33a; - methods[2] = ARKODE_MIS_KW3; + methods[2] = ARKODE_MRI_GARK_ERK45a; } else if (type == MRISTEP_IMPLICIT) { @@ -282,13 +283,13 @@ int run_tests(MRISTEP_METHOD_TYPE type, realtype t0, int nsteps, methods = new ARKODE_MRITableID[num_methods]; stiffly_accurate = new bool[num_methods]; - methods[0] = ARKODE_MRI_GARK_ESDIRK46a; + methods[0] = ARKODE_MRI_GARK_IRK21a; stiffly_accurate[0] = true; methods[1] = ARKODE_MRI_GARK_ESDIRK34a; stiffly_accurate[1] = true; - methods[2] = ARKODE_MRI_GARK_IRK21a; + methods[2] = ARKODE_MRI_GARK_ESDIRK46a; stiffly_accurate[2] = true; } else if (type == MRISTEP_IMEX) @@ -301,13 +302,13 @@ int run_tests(MRISTEP_METHOD_TYPE type, realtype t0, int nsteps, methods = new ARKODE_MRITableID[num_methods]; stiffly_accurate = new bool[num_methods]; - methods[0] = ARKODE_IMEX_MRI_GARK4; + methods[0] = ARKODE_IMEX_MRI_GARK3a; stiffly_accurate[0] = false; methods[1] = ARKODE_IMEX_MRI_GARK3b; stiffly_accurate[1] = false; - methods[2] = ARKODE_IMEX_MRI_GARK3a; + methods[2] = ARKODE_IMEX_MRI_GARK4; stiffly_accurate[2] = false; } else @@ -433,7 +434,7 @@ int run_tests(MRISTEP_METHOD_TYPE type, realtype t0, int nsteps, long int fe_evals = 0; if (type == MRISTEP_EXPLICIT || type == MRISTEP_IMEX) { - fe_evals = mri_nst * nstages_stored + 1; + fe_evals = mri_nst * nstages_stored; } if (mri_nfse != fe_evals) @@ -445,8 +446,20 @@ int run_tests(MRISTEP_METHOD_TYPE type, realtype t0, int nsteps, long int fi_evals = 0; if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) { - fi_evals = mri_nst * nstages_stored + mri_nni; - if (stiffly_accurate && !stiffly_accurate[i]) fi_evals++; + if (stiffly_accurate[i]) + { + // The last stage is implicit so it does not correspond to a column of + // zeros in the coupling matrix and is counted in "nstages_stored" + // however we do not evaluate the RHS functions after the solve since + // the methods is "FSAL" (the index map value and allocated space is + // used in the nonlinear for this stage). The RHS functions will be + // evaluated and stored at the start of the next step. + fi_evals = mri_nst * (nstages_stored - 1) + mri_nni; + } + else + { + fi_evals = mri_nst * nstages_stored + mri_nni; + } } if (mri_nfsi != fi_evals) diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri.out index ed079b7511..5e7243e3e8 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri.out +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri.out @@ -13,21 +13,49 @@ Test explicit MRI methods ========================= Testing method 0 - Stored stages = 5 + nmat = 1 + stages = 4 + method order (q) = 3 + embedding order (p) = 0 + c = 0 0.3333333333333333 0.75 1 + W[0] = + 0 0 0 0 + 0.3333333333333333 0 0 0 + -0.5208333333333333 0.9375 0 0 + 0.3541666666666666 -0.6375 0.5333333333333333 0 + + Stored stages = 3 MRIStep Statistics: Time = 0.01 y(t) = 0.980199 y_n = 0.980199 - Error = -5.31519e-12 + Error = 1.86014e-09 Steps = 1 - Fe evals = 6 + Fe evals = 3 Fi evals = 0 Comparing Solver Statistics: All checks passed Testing method 1 + nmat = 2 + stages = 4 + method order (q) = 3 + embedding order (p) = 0 + c = 0 0.3333333333333333 0.6666666666666666 1 + W[0] = + 0 0 0 0 + 0.3333333333333333 0 0 0 + -0.3333333333333333 0.6666666666666666 0 0 + 0 -0.6666666666666666 1 0 + + W[1] = + 0 0 0 0 + 0 0 0 0 + 0 0 0 0 + 0.5 0 -0.5 0 + Stored stages = 3 MRIStep Statistics: @@ -36,22 +64,43 @@ MRIStep Statistics: y_n = 0.980199 Error = 1.7757e-09 Steps = 1 - Fe evals = 4 + Fe evals = 3 Fi evals = 0 Comparing Solver Statistics: All checks passed Testing method 2 - Stored stages = 3 + nmat = 2 + stages = 6 + method order (q) = 4 + embedding order (p) = 0 + c = 0 0.2 0.4 0.6 0.8 1 + W[0] = + 0 0 0 0 0 0 + 0.2 0 0 0 0 0 + -3.3125 3.5125 0 0 0 0 + -0.5121234603937985 1.955496920787597 -1.243373460393798 0 0 0 + -0.1068927211587161 -4.656693056981116 3.994968532757531 0.9686172453823019 0 0 + 0.911960843690752 -0.1837327083772207 -1.193926866090864 -2.611983006811319 3.277681737588653 0 + + W[1] = + 0 0 0 0 0 0 + 0 0 0 0 0 0 + 6.2875 -6.2875 0 0 0 0 + -0.0382530792124029 0.6952561584248058 -0.6570030792124029 0 0 0 + 1.87616694642529 3.003768197383342 -3 -1.879935143808632 0 0 + -2.423803191489362 2 1 5 -5.576196808510638 0 + + Stored stages = 5 MRIStep Statistics: Time = 0.01 y(t) = 0.980199 y_n = 0.980199 - Error = 1.86014e-09 + Error = -5.3153e-12 Steps = 1 - Fe evals = 4 + Fe evals = 5 Fi evals = 0 Comparing Solver Statistics: @@ -62,6 +111,70 @@ Test implicit MRI methods ========================= Testing method 0 + nmat = 1 + stages = 3 + method order (q) = 2 + embedding order (p) = 0 + c = 0 1 1 + G[0] = + 0 0 0 + 1 0 0 + -0.5 0 0.5 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = -8.22598e-10 + Steps = 1 + Fe evals = 0 + Fi evals = 2 + NLS iters = 1 + NLS fails = 0 + LS setups = 1 + LS Fi evals = 0 + Ji evals = 1 + +Comparing Solver Statistics: +All checks passed + +Testing method 1 + nmat = 1 + stages = 7 + method order (q) = 3 + embedding order (p) = 0 + c = 0 0.3333333333333333 0.3333333333333333 0.6666666666666666 0.6666666666666666 1 1 + G[0] = + 0 0 0 0 0 0 0 + 0.3333333333333333 0 0 0 0 0 0 + -0.435866521508459 0 0.435866521508459 0 0 0 0 + -0.3045790611944505 0 0.6379123945277838 0 0 0 0 + 0.2116913105640267 0 -0.6475578320724856 0 0.435866521508459 0 0 + 0.4454209388055495 0 0.8813784805616198 0 -0.993466086033836 0 0 + -0.435866521508459 0 0 0 0 0 0.435866521508459 + + Stored stages = 4 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = 1.40689e-10 + Steps = 1 + Fe evals = 0 + Fi evals = 6 + NLS iters = 3 + NLS fails = 0 + LS setups = 1 + LS Fi evals = 0 + Ji evals = 1 + +Comparing Solver Statistics: +All checks passed + +Testing method 2 nmat = 2 stages = 11 method order (q) = 4 @@ -99,10 +212,10 @@ MRIStep Statistics: Time = 0.01 y(t) = 0.980199 y_n = 0.980199 - Error = 1.36091e-12 + Error = 1.36036e-12 Steps = 1 Fe evals = 0 - Fi evals = 11 + Fi evals = 10 NLS iters = 5 NLS fails = 0 LS setups = 1 @@ -112,30 +225,45 @@ MRIStep Statistics: Comparing Solver Statistics: All checks passed -Testing method 1 +===================== +Test IMEX MRI methods +===================== + +Testing method 0 nmat = 1 - stages = 7 + stages = 8 method order (q) = 3 embedding order (p) = 0 - c = 0 0.3333333333333333 0.3333333333333333 0.6666666666666666 0.6666666666666666 1 1 + c = 0 0.435866521508459 0.435866521508459 0.7179332607542295 0.7179332607542295 1 1 1 + W[0] = + 0 0 0 0 0 0 0 0 + 0.435866521508459 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + -0.5688715801234401 0 0.8509383193692106 0 0 0 0 0 + 0.4542839446436089 0 -0.4542839446436089 0 0 0 0 0 + -0.4271371821005074 0 0.1562747733103381 0 0.5529291480359398 0 0 0 + 0 0 0 0 0 0 0 0 + 0.1058582960718796 0 0.6555675011400702 0 -1.197292318720409 0 0.435866521508459 0 + G[0] = - 0 0 0 0 0 0 0 - 0.3333333333333333 0 0 0 0 0 0 - -0.435866521508459 0 0.435866521508459 0 0 0 0 - -0.3045790611944505 0 0.6379123945277838 0 0 0 0 - 0.2116913105640267 0 -0.6475578320724856 0 0.435866521508459 0 0 - 0.4454209388055495 0 0.8813784805616198 0 -0.993466086033836 0 0 - -0.435866521508459 0 0 0 0 0 0.435866521508459 + 0 0 0 0 0 0 0 0 + 0.435866521508459 0 0 0 0 0 0 0 + -0.435866521508459 0 0.435866521508459 0 0 0 0 0 + -0.4103336962288525 0 0.692400435474623 0 0 0 0 0 + 0.4103336962288525 0 -0.8462002177373115 0 0.435866521508459 0 0 0 + 0.435866521508459 0 0.9264299099302395 0 -1.080229692192928 0 0 0 + -0.435866521508459 0 0 0 0 0 0.435866521508459 0 + 0 0 0 0 0 0 0 0 Stored stages = 4 MRIStep Statistics: Time = 0.01 - y(t) = 0.980199 - y_n = 0.980199 - Error = 1.40689e-10 + y(t) = 0.970446 + y_n = 0.970446 + Error = 2.79396e-10 Steps = 1 - Fe evals = 0 + Fe evals = 4 Fi evals = 7 NLS iters = 3 NLS fails = 0 @@ -146,28 +274,43 @@ MRIStep Statistics: Comparing Solver Statistics: All checks passed -Testing method 2 +Testing method 1 nmat = 1 - stages = 3 - method order (q) = 2 + stages = 8 + method order (q) = 3 embedding order (p) = 0 - c = 0 1 1 + c = 0 0.435866521508459 0.435866521508459 0.7179332607542295 0.7179332607542295 1 1 1 + W[0] = + 0 0 0 0 0 0 0 0 + 0.435866521508459 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + -0.1750145285570468 0 0.4570812678028173 0 0 0 0 0 + 0.06042689307721552 0 -0.06042689307721552 0 0 0 0 0 + 0.1195213959425454 0 -1.843725226689662 0 2.006270569992887 0 0 0 + -0.5466585780430528 0 2 0 -1.453341421956947 0 0 0 + 0.1058582960718796 0 0.6555675011400702 0 -1.197292318720409 0 0.435866521508459 0 + G[0] = - 0 0 0 - 1 0 0 - -0.5 0 0.5 + 0 0 0 0 0 0 0 0 + 0.435866521508459 0 0 0 0 0 0 0 + -0.435866521508459 0 0.435866521508459 0 0 0 0 0 + 0.04142737535644148 0 0.240639363889329 0 0 0 0 0 + -0.04142737535644148 0 -0.3944391461520175 0 0.435866521508459 0 0 0 + 0.1123373143006048 0 1.051807513648115 0 -0.8820780887029493 0 0 0 + -0.1123373143006048 0 -0.1253776037178755 0 -0.1981516034899788 0 0.435866521508459 0 + 0 0 0 0 0 0 0 0 - Stored stages = 2 + Stored stages = 4 MRIStep Statistics: Time = 0.01 - y(t) = 0.980199 - y_n = 0.980199 - Error = -8.22598e-10 + y(t) = 0.970446 + y_n = 0.970446 + Error = -3.9875e-09 Steps = 1 - Fe evals = 0 - Fi evals = 3 - NLS iters = 1 + Fe evals = 4 + Fi evals = 7 + NLS iters = 3 NLS fails = 0 LS setups = 1 LS Fi evals = 0 @@ -176,11 +319,7 @@ MRIStep Statistics: Comparing Solver Statistics: All checks passed -===================== -Test IMEX MRI methods -===================== - -Testing method 0 +Testing method 2 nmat = 2 stages = 12 method order (q) = 4 @@ -248,10 +387,10 @@ MRIStep Statistics: Time = 0.01 y(t) = 0.970446 y_n = 0.970446 - Error = -2.09771e-11 + Error = -2.09769e-11 Steps = 1 - Fe evals = 7 - Fi evals = 12 + Fe evals = 6 + Fi evals = 11 NLS iters = 5 NLS fails = 0 LS setups = 1 @@ -261,95 +400,5 @@ MRIStep Statistics: Comparing Solver Statistics: All checks passed -Testing method 1 - nmat = 1 - stages = 8 - method order (q) = 3 - embedding order (p) = 0 - c = 0 0.435866521508459 0.435866521508459 0.7179332607542295 0.7179332607542295 1 1 1 - W[0] = - 0 0 0 0 0 0 0 0 - 0.435866521508459 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - -0.1750145285570468 0 0.4570812678028173 0 0 0 0 0 - 0.06042689307721552 0 -0.06042689307721552 0 0 0 0 0 - 0.1195213959425454 0 -1.843725226689662 0 2.006270569992887 0 0 0 - -0.5466585780430528 0 2 0 -1.453341421956947 0 0 0 - 0.1058582960718796 0 0.6555675011400702 0 -1.197292318720409 0 0.435866521508459 0 - - G[0] = - 0 0 0 0 0 0 0 0 - 0.435866521508459 0 0 0 0 0 0 0 - -0.435866521508459 0 0.435866521508459 0 0 0 0 0 - 0.04142737535644148 0 0.240639363889329 0 0 0 0 0 - -0.04142737535644148 0 -0.3944391461520175 0 0.435866521508459 0 0 0 - 0.1123373143006048 0 1.051807513648115 0 -0.8820780887029493 0 0 0 - -0.1123373143006048 0 -0.1253776037178755 0 -0.1981516034899788 0 0.435866521508459 0 - 0 0 0 0 0 0 0 0 - - Stored stages = 4 - -MRIStep Statistics: - Time = 0.01 - y(t) = 0.970446 - y_n = 0.970446 - Error = -3.9875e-09 - Steps = 1 - Fe evals = 5 - Fi evals = 8 - NLS iters = 3 - NLS fails = 0 - LS setups = 1 - LS Fi evals = 0 - Ji evals = 1 - -Comparing Solver Statistics: -All checks passed - -Testing method 2 - nmat = 1 - stages = 8 - method order (q) = 3 - embedding order (p) = 0 - c = 0 0.435866521508459 0.435866521508459 0.7179332607542295 0.7179332607542295 1 1 1 - W[0] = - 0 0 0 0 0 0 0 0 - 0.435866521508459 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - -0.5688715801234401 0 0.8509383193692106 0 0 0 0 0 - 0.4542839446436089 0 -0.4542839446436089 0 0 0 0 0 - -0.4271371821005074 0 0.1562747733103381 0 0.5529291480359398 0 0 0 - 0 0 0 0 0 0 0 0 - 0.1058582960718796 0 0.6555675011400702 0 -1.197292318720409 0 0.435866521508459 0 - - G[0] = - 0 0 0 0 0 0 0 0 - 0.435866521508459 0 0 0 0 0 0 0 - -0.435866521508459 0 0.435866521508459 0 0 0 0 0 - -0.4103336962288525 0 0.692400435474623 0 0 0 0 0 - 0.4103336962288525 0 -0.8462002177373115 0 0.435866521508459 0 0 0 - 0.435866521508459 0 0.9264299099302395 0 -1.080229692192928 0 0 0 - -0.435866521508459 0 0 0 0 0 0.435866521508459 0 - 0 0 0 0 0 0 0 0 - - Stored stages = 4 - -MRIStep Statistics: - Time = 0.01 - y(t) = 0.970446 - y_n = 0.970446 - Error = 2.79396e-10 - Steps = 1 - Fe evals = 5 - Fi evals = 8 - NLS iters = 3 - NLS fails = 0 - LS setups = 1 - LS Fi evals = 0 - Ji evals = 1 - -Comparing Solver Statistics: -All checks passed - All tests passed! diff --git a/test/unit_tests/arkode/C_serial/CMakeLists.txt b/test/unit_tests/arkode/C_serial/CMakeLists.txt index bddff54d88..5fc081c930 100644 --- a/test/unit_tests/arkode/C_serial/CMakeLists.txt +++ b/test/unit_tests/arkode/C_serial/CMakeLists.txt @@ -26,6 +26,7 @@ set(ARKODE_unit_tests "ark_test_arkstepsetforcing\;1 3 2.0 10.0 2.0 8.0" "ark_test_arkstepsetforcing\;1 3 2.0 10.0 1.0 5.0" "ark_test_getuserdata\;" + "ark_test_innerstepper\;" "ark_test_interp\;-100" "ark_test_interp\;-10000" "ark_test_interp\;-1000000" diff --git a/test/unit_tests/arkode/C_serial/ark_test_innerstepper.c b/test/unit_tests/arkode/C_serial/ark_test_innerstepper.c new file mode 100644 index 0000000000..330a2ed817 --- /dev/null +++ b/test/unit_tests/arkode/C_serial/ark_test_innerstepper.c @@ -0,0 +1,155 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): David J. Gardner @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2023, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * ----------------------------------------------------------------------------- + * Unit test for creating a minimal MRIStepInnerStepper using the multirate + * Dahlquist problem problem y' = lambda_s y + lambda_f y and a custom explicit + * Euler inner stepper. + * ---------------------------------------------------------------------------*/ + +#include +#include + +#include "arkode/arkode.h" +#include "nvector/nvector_serial.h" +#include "arkode/arkode_mristep.h" + +#if defined(SUNDIALS_EXTENDED_PRECISION) +#define GSYM "Lg" +#else +#define GSYM "g" +#endif + +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) + +int ode_slow_rhs(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) +{ + sunrealtype* y_data = N_VGetArrayPointer(ydot); + sunrealtype* ydot_data = N_VGetArrayPointer(ydot); + ydot_data[0] = -ONE * y_data[0]; + return 0; +} + +int fast_evolve(MRIStepInnerStepper fast_mem, sunrealtype t0, sunrealtype tf, + N_Vector y) +{ + int i = 0; + sunrealtype h_fast = (t0 - tf) / SUN_RCONST(10.0); + sunrealtype* y_data = N_VGetArrayPointer(y); + + for (i = 0; i < 10; i++) + { + y_data[0] += (h_fast * -ONE * y_data[0]); + } + + return 0; +} + +int main(int argc, char *argv[]) +{ + SUNContext sunctx = NULL; + N_Vector y = NULL; + void* arkode_mem = NULL; + MRIStepInnerStepper fast_mem = NULL; + + int flag = 0; + int arkode_flag = 0; + sunrealtype tout = SUN_RCONST(0.10); + sunrealtype tret = ZERO; + + /* -------------- + * Create context + * -------------- */ + + flag = SUNContext_Create(NULL, &sunctx); + if (flag) { return 1; } + + /* ----------------------- + * Setup initial condition + * ----------------------- */ + + y = N_VNew_Serial(1, sunctx); + if (!y) { return 1; } + N_VConst(ONE, y); + + /* --------------------- + * Setup fast integrator + * --------------------- */ + + flag = MRIStepInnerStepper_Create(sunctx, &fast_mem); + if (flag) { return 1; } + + flag = MRIStepInnerStepper_SetEvolveFn(fast_mem, fast_evolve); + if (flag) { return 1; } + + /* --------------------- + * Setup slow integrator + * --------------------- */ + + arkode_mem = MRIStepCreate(ode_slow_rhs, NULL, ZERO, y, fast_mem, sunctx); + if (!arkode_mem) { return 1; } + + flag = MRIStepSetFixedStep(arkode_mem, SUN_RCONST(0.01)); + if (flag) { return 1; } + + flag = MRIStepSetInterpolantType(arkode_mem, ARK_INTERP_HERMITE); + if (flag) { return 1; } + + /* --------------- + * Advance in time + * --------------- */ + + /* Evolve should return a failure when using Hermite interpolation */ + arkode_flag = MRIStepEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); + printf("MRIStepEvolve returned %i\n", arkode_flag); + if (arkode_flag != ARK_RHSFUNC_FAIL) { return 1; } + + /* ----------------------- + * Reinitialize integrator + * ----------------------- */ + + N_VConst(ONE, y); + + flag = MRIStepReInit(arkode_mem, ode_slow_rhs, NULL, ZERO, y); + if (flag) { return 1; } + + flag = MRIStepSetInterpolantType(arkode_mem, ARK_INTERP_LAGRANGE); + if (flag) { return 1; } + + /* --------------- + * Advance in time + * --------------- */ + + /* Evolve should succeed when using Lagrange interpolation */ + arkode_flag = MRIStepEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); + printf("MRIStepEvolve returned %i\n", arkode_flag); + if (arkode_flag != ARK_SUCCESS) { return 1; } + + /* -------- + * Clean up + * -------- */ + + MRIStepInnerStepper_Free(&fast_mem); + MRIStepFree(&arkode_mem); + N_VDestroy(y); + SUNContext_Free(&sunctx); + + if (!flag) + { + printf("SUCCESS\n"); + } + + return flag; +} + +/*---- end of file ----*/ From afbc36f908478cd8ee858a3e82447153ad707492 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Tue, 7 Nov 2023 22:43:46 -0800 Subject: [PATCH 04/24] remove unused variable --- .../arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp | 2 -- examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp b/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp index 69db66ca35..2d157c3d8c 100644 --- a/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp +++ b/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp @@ -232,7 +232,6 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata, long int nfe, nfi; /* RHS stats */ long int nni, ncnf; /* nonlinear solver stats */ long int nli, npsol; /* linear solver stats */ - char fname[MXSTR]; /* Create the ARK timestepper module */ arkode_mem = ARKStepCreate(Advection, Reaction, uopt->t0, y, ctx); @@ -380,7 +379,6 @@ int EvolveProblemExplicit(SUNContext ctx, N_Vector y, UserData* udata, int iout; /* output counter */ long int nst, nst_a, netf; /* step stats */ long int nfe; /* RHS stats */ - char fname[MXSTR]; /* Create the ERK timestepper module */ arkode_mem = ERKStepCreate(AdvectionReaction, uopt->t0, y, ctx); diff --git a/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c b/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c index 3110dc980f..b05278871a 100644 --- a/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c +++ b/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c @@ -369,7 +369,6 @@ int EvolveProblemIMEX(N_Vector y, UserData udata, UserOptions uopt, long int nfe, nfi; /* RHS stats */ long int nni, ncnf; /* nonlinear solver stats */ long int nli, npre, npsol; /* linear solver stats */ - char fname[MXSTR]; /* Create the ARK timestepper module */ arkode_mem = ARKStepCreate(Advection, Reaction, uopt->t0, y, ctx); @@ -520,7 +519,6 @@ int EvolveProblemExplicit(N_Vector y, UserData udata, UserOptions uopt, int iout; /* output counter */ long int nst, nst_a, netf; /* step stats */ long int nfe; /* RHS stats */ - char fname[MXSTR]; /* Create the ERK timestepper module */ arkode_mem = ERKStepCreate(AdvectionReaction, uopt->t0, y, ctx); From 110a6d9852858d9273ff8b1894de857ac0420117 Mon Sep 17 00:00:00 2001 From: "Daniel R. Reynolds" Date: Wed, 8 Nov 2023 19:23:37 -0600 Subject: [PATCH 05/24] Feature/oo adaptivity2 (#358) New object-oriented infrastructure for time step adaptivity controllers. --------- Co-authored-by: David J. Gardner Co-authored-by: Balos, Cody, J Co-authored-by: Cody Balos --- CHANGELOG.md | 15 + cmake/macros/SundialsAddLibrary.cmake | 9 + doc/arkode/guide/source/Constants.rst | 2 + doc/arkode/guide/source/Introduction.rst | 15 + doc/arkode/guide/source/Mathematics.rst | 147 +---- .../ARKStep_c_interface/User_callable.rst | 104 +++- .../ERKStep_c_interface/User_callable.rst | 129 +++- doc/arkode/guide/source/index.rst | 3 +- .../SUNAdaptController_links.rst | 15 + .../guide/source/sunadaptcontroller/index.rst | 29 + .../SUNAdaptController_Description.rst | 338 ++++++++++ .../SUNAdaptController_ImExGus.rst | 128 ++++ .../SUNAdaptController_Soderlind.rst | 315 ++++++++++ doc/superbuild/source/arkode/index.rst | 2 + doc/superbuild/source/index.rst | 1 + .../SUNAdaptController_links.rst | 15 + .../source/sunadaptcontroller/index.rst | 31 + .../CXX_parallel/ark_diffusion_reaction_p.cpp | 50 +- examples/arkode/CXX_parallel/ark_heat2D_p.cpp | 15 +- .../arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp | 15 +- .../CXX_parhyp/ark_heat2D_hypre_pfmg.cpp | 15 +- .../CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp | 15 +- .../CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp | 15 +- .../ark_advection_diffusion_reaction.cpp | 56 +- .../ark_advection_diffusion_reaction.hpp | 6 +- examples/arkode/CXX_serial/ark_heat2D.cpp | 15 +- .../ark_heat2D_hypre_pfmg_xbraid.cpp | 26 +- .../arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp | 26 +- .../arkode/CXX_xbraid/ark_heat2D_xbraid.cpp | 42 +- .../C_openmpdev/ark_heat1D_adapt_ompdev.c | 8 + .../C_parallel/ark_diurnal_kry_bbd_p.out | 4 +- .../arkode/C_parallel/ark_diurnal_kry_p.out | 8 +- .../arkode/C_parhyp/ark_diurnal_kry_ph.out | 9 +- examples/arkode/C_petsc/ark_petsc_ex25.c | 8 +- .../arkode/C_serial/ark_KrylovDemo_prec.out | 8 +- .../arkode/C_serial/ark_KrylovDemo_prec_1.out | 8 +- .../arkode/C_serial/ark_KrylovDemo_prec_2.out | 8 +- .../F2003_serial/ark_analytic_f2003.f90 | 28 +- .../F2003_serial/ark_analytic_f2003.out | 16 +- include/arkode/arkode.h | 1 + include/arkode/arkode_arkstep.h | 22 +- include/arkode/arkode_erkstep.h | 22 +- .../sunadaptcontroller_imexgus.h | 77 +++ .../sunadaptcontroller_soderlind.h | 111 ++++ include/sundials/sundials_adaptcontroller.h | 159 +++++ scripts/shared | 2 + scripts/tarscript | 2 + src/CMakeLists.txt | 1 + src/arkode/CMakeLists.txt | 3 + src/arkode/arkode.c | 70 ++- src/arkode/arkode_adapt.c | 274 +-------- src/arkode/arkode_adapt_impl.h | 62 +- src/arkode/arkode_arkstep_io.c | 207 +++++-- src/arkode/arkode_erkstep_io.c | 81 ++- src/arkode/arkode_impl.h | 3 + src/arkode/arkode_io.c | 557 ++++++++++++----- src/arkode/arkode_user_controller.c | 155 +++++ src/arkode/arkode_user_controller.h | 72 +++ src/arkode/fmod/CMakeLists.txt | 2 + src/arkode/fmod/farkode_arkstep_mod.c | 28 + src/arkode/fmod/farkode_arkstep_mod.f90 | 55 ++ src/arkode/fmod/farkode_erkstep_mod.c | 28 + src/arkode/fmod/farkode_erkstep_mod.f90 | 55 ++ src/arkode/fmod/farkode_mod.f90 | 15 +- src/arkode/fmod/farkode_mristep_mod.f90 | 1 + src/arkode/fmod/farkode_sprkstep_mod.f90 | 1 + src/sunadaptcontroller/CMakeLists.txt | 19 + src/sunadaptcontroller/imexgus/CMakeLists.txt | 29 + .../imexgus/fmod/CMakeLists.txt | 25 + .../fmod/fsunadaptcontroller_imexgus_mod.c | 359 +++++++++++ .../fmod/fsunadaptcontroller_imexgus_mod.f90 | 315 ++++++++++ .../imexgus/sunadaptcontroller_imexgus.c | 230 +++++++ .../soderlind/CMakeLists.txt | 29 + .../soderlind/fmod/CMakeLists.txt | 25 + .../fmod/fsunadaptcontroller_soderlind_mod.c | 501 +++++++++++++++ .../fsunadaptcontroller_soderlind_mod.f90 | 579 ++++++++++++++++++ .../soderlind/sunadaptcontroller_soderlind.c | 444 ++++++++++++++ src/sundials/CMakeLists.txt | 12 +- src/sundials/fmod/CMakeLists.txt | 4 +- .../fmod/fsundials_adaptcontroller_mod.c | 333 ++++++++++ .../fmod/fsundials_adaptcontroller_mod.f90 | 313 ++++++++++ src/sundials/fmod/fsundials_profiler_mod.c | 30 + src/sundials/fmod/fsundials_profiler_mod.f90 | 58 ++ src/sundials/sundials_adaptcontroller.c | 175 ++++++ swig/Makefile | 17 +- swig/arkode/farkode_mod.i | 1 + swig/sunadaptcontroller/fsunadaptcontroller.i | 30 + .../fsunadaptcontroller_imexgus_mod.i | 29 + .../fsunadaptcontroller_soderlind_mod.i | 29 + swig/sundials/fsundials.i | 1 + swig/sundials/fsundials_adaptcontroller_mod.i | 28 + test/answers | 2 +- .../arkode/CXX_serial/CMakeLists.txt | 4 +- .../unit_tests/arkode/C_serial/CMakeLists.txt | 2 + 94 files changed, 6517 insertions(+), 871 deletions(-) create mode 100644 doc/arkode/guide/source/sunadaptcontroller/SUNAdaptController_links.rst create mode 100644 doc/arkode/guide/source/sunadaptcontroller/index.rst create mode 100644 doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst create mode 100644 doc/shared/sunadaptcontroller/SUNAdaptController_ImExGus.rst create mode 100644 doc/shared/sunadaptcontroller/SUNAdaptController_Soderlind.rst create mode 100644 doc/superbuild/source/sunadaptcontroller/SUNAdaptController_links.rst create mode 100644 doc/superbuild/source/sunadaptcontroller/index.rst create mode 100644 include/sunadaptcontroller/sunadaptcontroller_imexgus.h create mode 100644 include/sunadaptcontroller/sunadaptcontroller_soderlind.h create mode 100644 include/sundials/sundials_adaptcontroller.h create mode 100644 src/arkode/arkode_user_controller.c create mode 100644 src/arkode/arkode_user_controller.h create mode 100644 src/sunadaptcontroller/CMakeLists.txt create mode 100644 src/sunadaptcontroller/imexgus/CMakeLists.txt create mode 100644 src/sunadaptcontroller/imexgus/fmod/CMakeLists.txt create mode 100644 src/sunadaptcontroller/imexgus/fmod/fsunadaptcontroller_imexgus_mod.c create mode 100644 src/sunadaptcontroller/imexgus/fmod/fsunadaptcontroller_imexgus_mod.f90 create mode 100644 src/sunadaptcontroller/imexgus/sunadaptcontroller_imexgus.c create mode 100644 src/sunadaptcontroller/soderlind/CMakeLists.txt create mode 100644 src/sunadaptcontroller/soderlind/fmod/CMakeLists.txt create mode 100644 src/sunadaptcontroller/soderlind/fmod/fsunadaptcontroller_soderlind_mod.c create mode 100644 src/sunadaptcontroller/soderlind/fmod/fsunadaptcontroller_soderlind_mod.f90 create mode 100644 src/sunadaptcontroller/soderlind/sunadaptcontroller_soderlind.c create mode 100644 src/sundials/fmod/fsundials_adaptcontroller_mod.c create mode 100644 src/sundials/fmod/fsundials_adaptcontroller_mod.f90 create mode 100644 src/sundials/sundials_adaptcontroller.c create mode 100644 swig/sunadaptcontroller/fsunadaptcontroller.i create mode 100644 swig/sunadaptcontroller/fsunadaptcontroller_imexgus_mod.i create mode 100644 swig/sunadaptcontroller/fsunadaptcontroller_soderlind_mod.i create mode 100644 swig/sundials/fsundials_adaptcontroller_mod.i diff --git a/CHANGELOG.md b/CHANGELOG.md index f7e7870f60..48b6a0b1b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,21 @@ ## Changes to SUNDIALS in release X.X.X +Added the `SUNAdaptController` base class, ported ARKODE's internal +implementations of time step controllers into implementations of this class, +and updated ARKODE to use these objects instead of its own implementations. +Added `ARKStepSetAdaptController` and `ERKStepSetAdaptController` routines +so that users can modify controller parameters, or even provide custom +implementations. + +Added the routines `ARKStepSetAdaptivityAdjustment` and +`ERKStepSetAdaptivityAdjustment`, that allow users to adjust the +value for the method order supplied to the temporal adaptivity controllers. +The ARKODE default for this adjustment has been -1 since its initial +release, but for some applications a value of 0 is more appropriate. +Users who notice that their simulations encounter a large number of +temporal error test failures may want to experiment with adjusting this value. + Fixed a regression introduced by the stop time bug fix in v6.6.1 where ARKODE, CVODE, CVODES, IDA, and IDAS would return at the stop time rather than the requested output time if the stop time was reached in the same step in which the diff --git a/cmake/macros/SundialsAddLibrary.cmake b/cmake/macros/SundialsAddLibrary.cmake index 5bf25ab4b8..2717e66bf8 100644 --- a/cmake/macros/SundialsAddLibrary.cmake +++ b/cmake/macros/SundialsAddLibrary.cmake @@ -176,6 +176,15 @@ macro(sundials_add_library target) target_link_libraries(${obj_target} ${_all_libs}) endif() + if(SUNDIALS_BUILD_WITH_PROFILING) + if(ENABLE_CALIPER) + target_link_libraries(${obj_target} PUBLIC caliper) + endif() + if(ENABLE_ADIAK) + target_link_libraries(${obj_target} PUBLIC adiak::adiak ${CMAKE_DL_LIBS}) + endif() + endif() + # add includes to object library target_include_directories(${obj_target} PUBLIC diff --git a/doc/arkode/guide/source/Constants.rst b/doc/arkode/guide/source/Constants.rst index 9510f656a0..833a061251 100644 --- a/doc/arkode/guide/source/Constants.rst +++ b/doc/arkode/guide/source/Constants.rst @@ -468,6 +468,8 @@ contains the ARKODE output constants. | :index:`ARK_RELAX_JAC_FAIL` | -46 | The relaxation Jacobian function returned an unrecoverable | | | | error | +-------------------------------------+------+------------------------------------------------------------+ + | :index:`ARK_CONTROLLER_ERR` | -47 | An error with a SUNAdaptController object was encountered. | + +-------------------------------------+------+------------------------------------------------------------+ | :index:`ARK_UNRECOGNIZED_ERROR` | -99 | An unknown error was encountered. | +-------------------------------------+------+------------------------------------------------------------+ | | diff --git a/doc/arkode/guide/source/Introduction.rst b/doc/arkode/guide/source/Introduction.rst index 736b7ddc18..6eaf50a9ec 100644 --- a/doc/arkode/guide/source/Introduction.rst +++ b/doc/arkode/guide/source/Introduction.rst @@ -133,6 +133,21 @@ Changes from previous versions Changes in vX.X.X ----------------- +Added the :c:type:`SUNAdaptController` base class, ported ARKODE's internal +implementations of time step controllers into implementations of this class, +and updated ARKODE to use these objects instead of its own implementations. Added +:c:func:`ARKStepSetAdaptController` and :c:func:`ERKStepSetAdaptController` +routines so that users can modify controller parameters, or even provide custom +implementations. + +Added the routines :c:func:`ARKStepSetAdaptivityAdjustment` and +:c:func:`ERKStepSetAdaptivityAdjustment`, that allow users to adjust the +value for the method order supplied to the temporal adaptivity controllers. +The ARKODE default for this adjustment has been :math:`-1` since its initial +release, but for some applications a value of :math:`0` is more appropriate. +Users who notice that their simulations encounter a large number of +temporal error test failures may want to experiment with adjusting this value. + Fixed the build system support for MAGMA when using a NVIDIA HPC SDK installation of CUDA and fixed the targets used for rocBLAS and rocSPARSE. diff --git a/doc/arkode/guide/source/Mathematics.rst b/doc/arkode/guide/source/Mathematics.rst index 135bf33f4c..aa8b389dc8 100644 --- a/doc/arkode/guide/source/Mathematics.rst +++ b/doc/arkode/guide/source/Mathematics.rst @@ -906,147 +906,24 @@ steps, :math:`t_{n-3} \to t_{n-2} \to t_{n-1} \to t_n`. These local error history values are all initialized to 1 upon program initialization, to accommodate the few initial time steps of a calculation where some of these error estimates have not yet been -computed. With these estimates, ARKODE supports a variety of error -control algorithms, as specified in the subsections below. +computed. With these estimates, ARKODE supports one of two approaches +for temporal error control. +First, any valid implementation of the SUNAdaptController class +:numref:`SUNAdaptController.Description` may be used by ARKODE's adaptive +time-stepping modules to provide a candidate error-based prospective step +size :math:`h'`. -.. _ARKODE.Mathematics.Adaptivity.ErrorControl.PID: - -PID controller ------------------ - -This is the default time adaptivity controller used by the ARKStep and -ERKStep modules. It derives from those found in :cite:p:`KenCarp:03`, :cite:p:`Sod:98`, :cite:p:`Sod:03` and -:cite:p:`Sod:06`, and uses all three of the local error estimates -:math:`\varepsilon_n`, :math:`\varepsilon_{n-1}` and -:math:`\varepsilon_{n-2}` in determination of a prospective step size, - -.. math:: - h' \;=\; h_n\; \varepsilon_n^{-k_1/p}\; \varepsilon_{n-1}^{k_2/p}\; - \varepsilon_{n-2}^{-k_3/p}, - -where the constants :math:`k_1`, :math:`k_2` and :math:`k_3` default -to 0.58, 0.21 and 0.1, respectively, and may be modified by the user. -In this estimate, a floor of :math:`\varepsilon > 10^{-10}` is -enforced to avoid division-by-zero errors. - - - -.. _ARKODE.Mathematics.Adaptivity.ErrorControl.PI: - -PI controller ----------------------- - -Like with the previous method, the PI controller derives from those -found in :cite:p:`KenCarp:03`, :cite:p:`Sod:98`, :cite:p:`Sod:03` and :cite:p:`Sod:06`, but it differs in -that it only uses the two most recent step sizes in its adaptivity -algorithm, - -.. math:: - h' \;=\; h_n\; \varepsilon_n^{-k_1/p}\; \varepsilon_{n-1}^{k_2/p}. - -Here, the default values of :math:`k_1` and :math:`k_2` default -to 0.8 and 0.31, respectively, though they may be changed by the user. - - - -.. _ARKODE.Mathematics.Adaptivity.ErrorControl.I: - -I controller ----------------------- - -This is the standard time adaptivity control algorithm in use by most -publicly-available ODE solver codes. It bases the prospective time step -estimate entirely off of the current local error estimate, - -.. math:: - h' \;=\; h_n\; \varepsilon_n^{-k_1/p}. - -By default, :math:`k_1=1`, but that may be modified by the user. - - - - -.. _ARKODE.Mathematics.Adaptivity.ErrorControl.eGus: - -Explicit Gustafsson controller ---------------------------------- - -This step adaptivity algorithm was proposed in :cite:p:`Gust:91`, and -is primarily useful with explicit Runge--Kutta methods. -In the notation of our earlier controllers, it has the form - -.. math:: - h' \;=\; \begin{cases} - h_1\; \varepsilon_1^{-1/p}, &\quad\text{on the first step}, \\ - h_n\; \varepsilon_n^{-k_1/p}\; - \left(\dfrac{\varepsilon_n}{\varepsilon_{n-1}}\right)^{k_2/p}, & - \quad\text{on subsequent steps}. - \end{cases} - :label: ARKODE_expGus - -The default values of :math:`k_1` and :math:`k_2` are 0.367 and 0.268, -respectively, and may be modified by the user. - - - - -.. _ARKODE.Mathematics.Adaptivity.ErrorControl.iGus: - -Implicit Gustafsson controller ---------------------------------- - -A version of the above controller suitable for implicit Runge--Kutta -methods was introduced in :cite:p:`Gust:94`, and has the form - -.. math:: - h' = \begin{cases} - h_1 \varepsilon_1^{-1/p}, &\quad\text{on the first step}, \\ - h_n \left(\dfrac{h_n}{h_{n-1}}\right) \varepsilon_n^{-k_1/p} - \left(\dfrac{\varepsilon_n}{\varepsilon_{n-1}}\right)^{-k_2/p}, & - \quad\text{on subsequent steps}. - \end{cases} - :label: ARKODE_impGus - -The algorithm parameters default to :math:`k_1 = 0.98` and -:math:`k_2 = 0.95`, but may be modified by the user. - - - - -.. _ARKODE.Mathematics.Adaptivity.ErrorControl.ieGus: - -ImEx Gustafsson controller ---------------------------------- - -An ImEx version of these two preceding controllers is also available. -This approach computes the estimates :math:`h'_1` arising from -equation :eq:`ARKODE_expGus` and the estimate :math:`h'_2` arising from -equation :eq:`ARKODE_impGus`, and selects - -.. math:: - h' = \frac{h}{|h|}\min\left\{|h'_1|, |h'_2|\right\}. - -Here, equation :eq:`ARKODE_expGus` uses :math:`k_1` and -:math:`k_2` with default values of 0.367 and 0.268, while equation -:eq:`ARKODE_impGus` sets both parameters to the input :math:`k_3` that -defaults to 0.95. All of these values may be modified by the user. - - - -.. _ARKODE.Mathematics.Adaptivity.ErrorControl.User: - -User-supplied controller ---------------------------------- - -Finally, ARKODE's time-stepping modules allow the user to define their -own time step adaptivity function, +Second, ARKODE's adaptive time-stepping modules currently still allow the +user to define their own time step adaptivity function, .. math:: h' = H(y, t, h_n, h_{n-1}, h_{n-2}, \varepsilon_n, \varepsilon_{n-1}, \varepsilon_{n-2}, q, p), -to allow for problem-specific choices, or for continued -experimentation with temporal error controllers. +allowing for problem-specific choices, or for continued +experimentation with temporal error controllers. We note that this +support has been deprecated in favor of the SUNAdaptController class, +and will be removed in a future release. diff --git a/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst b/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst index eb1f05979e..8db35e2510 100644 --- a/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst @@ -1107,8 +1107,9 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst :c:func:`ARKStepSetMaxGrowth()`, :c:func:`ARKStepSetMinReduction()`, :c:func:`ARKStepSetSafetyFactor()`, - :c:func:`ARKStepSetSmallNumEFails()` and - :c:func:`ARKStepSetStabilityFn()` + :c:func:`ARKStepSetSmallNumEFails()`, + :c:func:`ARKStepSetStabilityFn()`, and + :c:func:`ARKStepSetAdaptController()` will be ignored, since temporal adaptivity is disabled. If both :c:func:`ARKStepSetFixedStep()` and @@ -1688,26 +1689,44 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. .. cssclass:: table-bordered -======================================================== ====================================== ======== -Optional input Function name Default -======================================================== ====================================== ======== -Set a custom time step adaptivity function :c:func:`ARKStepSetAdaptivityFn()` internal -Choose an existing time step adaptivity method :c:func:`ARKStepSetAdaptivityMethod()` 0 -Explicit stability safety factor :c:func:`ARKStepSetCFLFraction()` 0.5 -Time step error bias factor :c:func:`ARKStepSetErrorBias()` 1.5 -Bounds determining no change in step size :c:func:`ARKStepSetFixedStepBounds()` 1.0 1.5 -Maximum step growth factor on convergence fail :c:func:`ARKStepSetMaxCFailGrowth()` 0.25 -Maximum step growth factor on error test fail :c:func:`ARKStepSetMaxEFailGrowth()` 0.3 -Maximum first step growth factor :c:func:`ARKStepSetMaxFirstGrowth()` 10000.0 -Maximum allowed general step growth factor :c:func:`ARKStepSetMaxGrowth()` 20.0 -Minimum allowed step reduction factor on error test fail :c:func:`ARKStepSetMinReduction()` 0.1 -Time step safety factor :c:func:`ARKStepSetSafetyFactor()` 0.96 -Error fails before MaxEFailGrowth takes effect :c:func:`ARKStepSetSmallNumEFails()` 2 -Explicit stability function :c:func:`ARKStepSetStabilityFn()` none -======================================================== ====================================== ======== +========================================================= ========================================== ======== +Optional input Function name Default +========================================================= ========================================== ======== +Provide a :c:type:`SUNAdaptController` for ARKStep to use :c:func:`ARKStepSetAdaptController()` PID +Set a custom time step adaptivity function :c:func:`ARKStepSetAdaptivityFn()` internal +Choose an existing time step adaptivity method :c:func:`ARKStepSetAdaptivityMethod()` 0 +Adjust the method order used in the controller :c:func:`ERKStepSetAdaptivityAdjustment()` -1 +Explicit stability safety factor :c:func:`ARKStepSetCFLFraction()` 0.5 +Time step error bias factor :c:func:`ARKStepSetErrorBias()` 1.5 +Bounds determining no change in step size :c:func:`ARKStepSetFixedStepBounds()` 1.0 1.5 +Maximum step growth factor on convergence fail :c:func:`ARKStepSetMaxCFailGrowth()` 0.25 +Maximum step growth factor on error test fail :c:func:`ARKStepSetMaxEFailGrowth()` 0.3 +Maximum first step growth factor :c:func:`ARKStepSetMaxFirstGrowth()` 10000.0 +Maximum allowed general step growth factor :c:func:`ARKStepSetMaxGrowth()` 20.0 +Minimum allowed step reduction factor on error test fail :c:func:`ARKStepSetMinReduction()` 0.1 +Time step safety factor :c:func:`ARKStepSetSafetyFactor()` 0.96 +Error fails before MaxEFailGrowth takes effect :c:func:`ARKStepSetSmallNumEFails()` 2 +Explicit stability function :c:func:`ARKStepSetStabilityFn()` none +========================================================= ========================================== ======== +.. c:function:: int ARKStepSetAdaptController(void* arkode_mem, SUNAdaptController C) + + Sets a user-supplied time-step controller object. + + **Arguments:** + * *arkode_mem* -- pointer to the ARKStep memory block. + * *C* -- user-supplied time adaptivity controller. If ``NULL`` then the PID controller will be created (see :numref:`SUNAdaptController.Soderlind`). + + **Return value:** + * *ARK_SUCCESS* if successful + * *ARK_MEM_NULL* if the ARKStep memory is ``NULL`` + * *ARK_MEM_FAIL* if *C* was ``NULL`` and the PID controller could not be allocated. + + .. versionadded:: x.x.x + + .. c:function:: int ARKStepSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data) Sets a user-supplied time-step adaptivity function. @@ -1729,6 +1748,11 @@ Explicit stability function :c:func:`ARKStepSetSt :c:func:`ARKStepSetStabilityFn()` should be used instead. + .. deprecated:: x.x.x + + Use the SUNAdaptController infrastructure instead (see :numref:`SUNAdaptController.Description`). + + .. c:function:: int ARKStepSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, int pq, realtype* adapt_params) @@ -1744,7 +1768,8 @@ Explicit stability function :c:func:`ARKStepSetSt parameters (1), or that they will be supplied in the *adapt_params* argument (0). * *pq* -- flag denoting whether to use the embedding order of - accuracy *p* (0) or the method order of accuracy *q* (1) + accuracy *p* (0), the method order of accuracy *q* (1), or the + minimum of the two (any input not equal to 0 or 1) within the adaptivity algorithm. *p* is the default. * *adapt_params[0]* -- :math:`k_1` parameter within accuracy-based adaptivity algorithms. * *adapt_params[1]* -- :math:`k_2` parameter within accuracy-based adaptivity algorithms. @@ -1761,8 +1786,40 @@ Explicit stability function :c:func:`ARKStepSetSt parameter values are desired, it is recommended to instead provide a custom function through a call to :c:func:`ARKStepSetAdaptivityFn()`. + .. versionchanged:: x.x.x + + Prior to version x.x.x, any nonzero value for *pq* would result in use of the + embedding order of accuracy. + + + .. deprecated:: x.x.x + + Use the SUNAdaptController infrastructure instead (see :numref:`SUNAdaptController.Description`). + +.. c:function:: int ARKStepSetAdaptivityAdjustment(void* arkode_mem, int adjust) + + Called by a user to adjust the method order supplied to the temporal adaptivity + controller. For example, if the user expects order reduction due to problem stiffness, + they may request that the controller assume a reduced order of accuracy for the method + by specifying a value :math:`adjust < 0`. + + **Arguments:** + * *arkode_mem* -- pointer to the ARKStep memory block. + * *adjust* -- adjustment factor (default is -1). + + **Return value:** + * *ARK_SUCCESS* if successful + * *ARK_MEM_NULL* if the ARKStep memory is ``NULL`` + * *ARK_ILL_INPUT* if an argument has an illegal value + + **Notes:** + This should be called prior to calling :c:func:`ARKStepEvolve()`, and can only be + reset following a call to :c:func:`ARKStepReInit()`. + + .. versionadded:: x.x.x + .. c:function:: int ARKStepSetCFLFraction(void* arkode_mem, realtype cfl_frac) Specifies the fraction of the estimated explicitly stable step to use. @@ -1800,6 +1857,13 @@ Explicit stability function :c:func:`ARKStepSetSt **Notes:** Any value below 1.0 will imply a reset to the default value. + If both this and one of :c:func:`ARKStepSetAdaptivityMethod` or + :c:func:`ARKStepSetAdaptController` will be called, then this routine must be called + *second*. + + .. deprecated:: x.x.x + + Use the SUNAdaptController infrastructure instead (see :numref:`SUNAdaptController.Description`). .. c:function:: int ARKStepSetFixedStepBounds(void* arkode_mem, realtype lb, realtype ub) diff --git a/doc/arkode/guide/source/Usage/ERKStep_c_interface/User_callable.rst b/doc/arkode/guide/source/Usage/ERKStep_c_interface/User_callable.rst index a14ed89456..94493fc0cb 100644 --- a/doc/arkode/guide/source/Usage/ERKStep_c_interface/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ERKStep_c_interface/User_callable.rst @@ -731,8 +731,9 @@ Optional inputs for ERKStep :c:func:`ERKStepSetMaxGrowth()`, :c:func:`ERKStepSetMinReduction()`, :c:func:`ERKStepSetSafetyFactor()`, - :c:func:`ERKStepSetSmallNumEFails()` and - :c:func:`ERKStepSetStabilityFn()` + :c:func:`ERKStepSetSmallNumEFails()`, + :c:func:`ERKStepSetStabilityFn()`, and + :c:func:`ERKStepSetAdaptController()` will be ignored, since temporal adaptivity is disabled. If both :c:func:`ERKStepSetFixedStep()` and @@ -1158,36 +1159,61 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. .. _ARKODE.Usage.ERKStep.ERKStepAdaptivityInputTable: .. table:: Optional inputs for time step adaptivity - +-----------------------------------------------------------+----------------------------------------+-----------+ - | Optional input | Function name | Default | - +-----------------------------------------------------------+----------------------------------------+-----------+ - | Set a custom time step adaptivity function | :c:func:`ERKStepSetAdaptivityFn()` | internal | - +-----------------------------------------------------------+----------------------------------------+-----------+ - | Choose an existing time step adaptivity method | :c:func:`ERKStepSetAdaptivityMethod()` | 0 | - +-----------------------------------------------------------+----------------------------------------+-----------+ - | Explicit stability safety factor | :c:func:`ERKStepSetCFLFraction()` | 0.5 | - +-----------------------------------------------------------+----------------------------------------+-----------+ - | Time step error bias factor | :c:func:`ERKStepSetErrorBias()` | 1.5 | - +-----------------------------------------------------------+----------------------------------------+-----------+ - | Bounds determining no change in step size | :c:func:`ERKStepSetFixedStepBounds()` | 1.0 1.5 | - +-----------------------------------------------------------+----------------------------------------+-----------+ - | Maximum step growth factor on error test fail | :c:func:`ERKStepSetMaxEFailGrowth()` | 0.3 | - +-----------------------------------------------------------+----------------------------------------+-----------+ - | Maximum first step growth factor | :c:func:`ERKStepSetMaxFirstGrowth()` | 10000.0 | - +-----------------------------------------------------------+----------------------------------------+-----------+ - | Maximum allowed general step growth factor | :c:func:`ERKStepSetMaxGrowth()` | 20.0 | - +-----------------------------------------------------------+----------------------------------------+-----------+ - | Minimum allowed step reduction factor on error test fail | :c:func:`ERKStepSetMinReduction()` | 0.1 | - +-----------------------------------------------------------+----------------------------------------+-----------+ - | Time step safety factor | :c:func:`ERKStepSetSafetyFactor()` | 0.96 | - +-----------------------------------------------------------+----------------------------------------+-----------+ - | Error fails before MaxEFailGrowth takes effect | :c:func:`ERKStepSetSmallNumEFails()` | 2 | - +-----------------------------------------------------------+----------------------------------------+-----------+ - | Explicit stability function | :c:func:`ERKStepSetStabilityFn()` | none | - +-----------------------------------------------------------+----------------------------------------+-----------+ + +-----------------------------------------------------------+--------------------------------------------+-----------+ + | Optional input | Function name | Default | + +-----------------------------------------------------------+--------------------------------------------+-----------+ + | Provide a :c:type:`SUNAdaptController` for ERKStep to use | :c:func:`ERKStepSetAdaptController()` | PI | + +-----------------------------------------------------------+--------------------------------------------+-----------+ + | Set a custom time step adaptivity function | :c:func:`ERKStepSetAdaptivityFn()` | internal | + +-----------------------------------------------------------+--------------------------------------------+-----------+ + | Choose an existing time step adaptivity method | :c:func:`ERKStepSetAdaptivityMethod()` | 0 | + +-----------------------------------------------------------+--------------------------------------------+-----------+ + | Adjust the method order used in the controller | :c:func:`ERKStepSetAdaptivityAdjustment()` | -1 | + +-----------------------------------------------------------+--------------------------------------------+-----------+ + | Explicit stability safety factor | :c:func:`ERKStepSetCFLFraction()` | 0.5 | + +-----------------------------------------------------------+--------------------------------------------+-----------+ + | Time step error bias factor | :c:func:`ERKStepSetErrorBias()` | 1.5 | + +-----------------------------------------------------------+--------------------------------------------+-----------+ + | Bounds determining no change in step size | :c:func:`ERKStepSetFixedStepBounds()` | 1.0 1.5 | + +-----------------------------------------------------------+--------------------------------------------+-----------+ + | Maximum step growth factor on error test fail | :c:func:`ERKStepSetMaxEFailGrowth()` | 0.3 | + +-----------------------------------------------------------+--------------------------------------------+-----------+ + | Maximum first step growth factor | :c:func:`ERKStepSetMaxFirstGrowth()` | 10000.0 | + +-----------------------------------------------------------+--------------------------------------------+-----------+ + | Maximum allowed general step growth factor | :c:func:`ERKStepSetMaxGrowth()` | 20.0 | + +-----------------------------------------------------------+--------------------------------------------+-----------+ + | Minimum allowed step reduction factor on error test fail | :c:func:`ERKStepSetMinReduction()` | 0.1 | + +-----------------------------------------------------------+--------------------------------------------+-----------+ + | Time step safety factor | :c:func:`ERKStepSetSafetyFactor()` | 0.96 | + +-----------------------------------------------------------+--------------------------------------------+-----------+ + | Error fails before MaxEFailGrowth takes effect | :c:func:`ERKStepSetSmallNumEFails()` | 2 | + +-----------------------------------------------------------+--------------------------------------------+-----------+ + | Explicit stability function | :c:func:`ERKStepSetStabilityFn()` | none | + +-----------------------------------------------------------+--------------------------------------------+-----------+ +.. c:function:: int ERKStepSetAdaptController(void* arkode_mem, SUNAdaptController C) + + Sets a user-supplied time-step controller object. + + **Arguments:** + * *arkode_mem* -- pointer to the ERKStep memory block. + * *C* -- user-supplied time adaptivity controller. If ``NULL`` then the PID controller will be created (see :numref:`SUNAdaptController.Soderlind`). + + **Return value:** + * *ARK_SUCCESS* if successful + * *ARK_MEM_NULL* if the ERKStep memory is ``NULL`` + * *ARK_MEM_FAIL* if *C* was ``NULL`` and the PID controller could not be allocated. + + **Notes:** + When *C* is ``NULL``, the PID controller that is created is not the same as the ERKStep default (PI). + To reset ERKStep to its default behavior after a non-default controller has been used, users should either + specifically create the PI controller *C* and attach it here, or call :c:func:`ERKStepSetDefaults()`. + + .. versionadded:: x.x.x + + .. c:function:: int ERKStepSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data) Sets a user-supplied time-step adaptivity function. @@ -1209,6 +1235,10 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. :c:func:`ERKStepSetStabilityFn()` should be used instead. + .. deprecated:: x.x.x + + Use the SUNAdaptController infrastructure instead (see :numref:`SUNAdaptController.Description`). + .. c:function:: int ERKStepSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, int pq, realtype* adapt_params) @@ -1224,7 +1254,8 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. parameters (1), or that they will be supplied in the *adapt_params* argument (0). * *pq* -- flag denoting whether to use the embedding order of - accuracy *p* (0) or the method order of accuracy *q* (1) + accuracy *p* (0), the method order of accuracy *q* (1), or the + minimum of the two (any input not equal to 0 or 1) within the adaptivity algorithm. *p* is the default. * *adapt_params[0]* -- :math:`k_1` parameter within accuracy-based adaptivity algorithms. * *adapt_params[1]* -- :math:`k_2` parameter within accuracy-based adaptivity algorithms. @@ -1241,8 +1272,38 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. parameter values are desired, it is recommended to instead provide a custom function through a call to :c:func:`ERKStepSetAdaptivityFn()`. + .. versionchanged:: x.x.x + + Prior to version x.x.x, any nonzero value for *pq* would result in use of the + embedding order of accuracy. + + .. deprecated:: x.x.x + + Use the SUNAdaptController infrastructure instead (see :numref:`SUNAdaptController.Description`). +.. c:function:: int ERKStepSetAdaptivityAdjustment(void* arkode_mem, int adjust) + + Called by a user to adjust the method order supplied to the temporal adaptivity + controller. For example, if the user expects order reduction due to problem stiffness, + they may request that the controller assume a reduced order of accuracy for the method + by specifying a value :math:`adjust < 0`. + + **Arguments:** + * *arkode_mem* -- pointer to the ERKStep memory block. + * *adjust* -- adjustment factor (default is -1). + + **Return value:** + * *ARK_SUCCESS* if successful + * *ARK_MEM_NULL* if the ERKStep memory is ``NULL`` + * *ARK_ILL_INPUT* if an argument has an illegal value + + **Notes:** + This should be called prior to calling :c:func:`ERKStepEvolve()`, and can only be + reset following a call to :c:func:`ERKStepReInit()`. + + .. versionadded:: x.x.x + .. c:function:: int ERKStepSetCFLFraction(void* arkode_mem, realtype cfl_frac) Specifies the fraction of the estimated explicitly stable step to use. @@ -1280,6 +1341,14 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **Notes:** Any value below 1.0 will imply a reset to the default value. + If both this and one of :c:func:`ERKStepSetAdaptivityMethod` or + :c:func:`ERKStepSetAdaptController` will be called, then this routine must be called + *second*. + + .. deprecated:: x.x.x + + Use the SUNAdaptController infrastructure instead (see :numref:`SUNAdaptController.Description`). + .. c:function:: int ERKStepSetFixedStepBounds(void* arkode_mem, realtype lb, realtype ub) diff --git a/doc/arkode/guide/source/index.rst b/doc/arkode/guide/source/index.rst index fd61ab5981..4d4828f787 100644 --- a/doc/arkode/guide/source/index.rst +++ b/doc/arkode/guide/source/index.rst @@ -28,7 +28,7 @@ to have a similar user experience to the `CVODE solver, including user modes to allow adaptive integration to specified output times, return after each internal step and root-finding capabilities, and for calculations in serial, using shared-memory -parallelism (via OpenMP, Pthreads, CUDA, Raja) or distributed-memory +parallelism (e.g., via OpenMP, CUDA, Raja, Kokkos) or distributed-memory parallelism (via MPI). The default integration and solver options should apply to most users, though control over nearly all internal parameters and time adaptivity algorithms is enabled through optional @@ -64,6 +64,7 @@ with support by the `US Department of Energy `_, sunmatrix/index.rst sunlinsol/index.rst sunnonlinsol/index.rst + sunadaptcontroller/index.rst sunmemory/index.rst Install_link.rst Constants diff --git a/doc/arkode/guide/source/sunadaptcontroller/SUNAdaptController_links.rst b/doc/arkode/guide/source/sunadaptcontroller/SUNAdaptController_links.rst new file mode 100644 index 0000000000..949d84196f --- /dev/null +++ b/doc/arkode/guide/source/sunadaptcontroller/SUNAdaptController_links.rst @@ -0,0 +1,15 @@ +.. ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2023, Lawrence Livermore National Security + and Southern Methodist University. + All rights reserved. + + See the top-level LICENSE and NOTICE files for details. + + SPDX-License-Identifier: BSD-3-Clause + SUNDIALS Copyright End + ---------------------------------------------------------------- + +.. include:: ../../../../shared/sunadaptcontroller/SUNAdaptController_Description.rst +.. include:: ../../../../shared/sunadaptcontroller/SUNAdaptController_Soderlind.rst +.. include:: ../../../../shared/sunadaptcontroller/SUNAdaptController_ImExGus.rst diff --git a/doc/arkode/guide/source/sunadaptcontroller/index.rst b/doc/arkode/guide/source/sunadaptcontroller/index.rst new file mode 100644 index 0000000000..bd4ab38d7b --- /dev/null +++ b/doc/arkode/guide/source/sunadaptcontroller/index.rst @@ -0,0 +1,29 @@ +.. ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2023, Lawrence Livermore National Security + and Southern Methodist University. + All rights reserved. + + See the top-level LICENSE and NOTICE files for details. + + SPDX-License-Identifier: BSD-3-Clause + SUNDIALS Copyright End + ---------------------------------------------------------------- + +.. _SUNAdaptController: + +##################################### +Time Step Adaptivity Controllers +##################################### + +The SUNDIALS library comes packaged with a variety of :c:type:`SUNAdaptController` +implementations, designed to support various forms of error-based time step +adaptivity within SUNDIALS time integrators. To support applications that may +want to adjust the controller parameters or provide their own implementations, +SUNDIALS defines the :c:type:`SUNAdaptController` base class, along with a +variety of default implementations. + +.. toctree:: + :maxdepth: 1 + + SUNAdaptController_links.rst diff --git a/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst b/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst new file mode 100644 index 0000000000..acea4a0790 --- /dev/null +++ b/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst @@ -0,0 +1,338 @@ +.. + ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2023, Lawrence Livermore National Security + and Southern Methodist University. + All rights reserved. + + See the top-level LICENSE and NOTICE files for details. + + SPDX-License-Identifier: BSD-3-Clause + SUNDIALS Copyright End + ---------------------------------------------------------------- + +.. _SUNAdaptController.Description: + +The SUNAdaptController API +========================== + +.. versionadded:: x.x.x + +The SUNAdaptController base class provides a common API for accuracy-based adaptivity +controllers to be used by SUNDIALS integrators. These controllers estimate step +sizes (among other things) such that the next step solution satisfies a desired +temporal accuracy, while striving to maximize computational efficiency. We note +that in the descriptions below, we frequently use *dsm* to represent +temporal error. This is **not** the raw temporal error estimate; instead, it is +a norm of the temporal error estimate after scaling by the user-supplied +accuracy tolerances (see :eq:`ARKODE_WRMS_NORM`), + +.. math:: + \text{dsm} = \left( \frac{1}{N} \sum_{i=1}^N + \left(\frac{\text{error}_i}{\text{rtol}\cdot |y_{n-1,i}| + \text{atol}_i}\right)^2\right)^{1/2}. + +Thus *dsm* values below one represent errors estimated to be more accurate than +needed, whereas errors above one are considered to be larger than allowable. + +The base ``SUNAdaptController`` class is modeled after SUNDIALS' other object-oriented +classes, in that this class contains a pointer to an implementation-specific +*content*, an *ops* structure with generic controller operations, and a +:c:type:`SUNContext` object. Specifically, the type ``SUNAdaptController`` is defined +as: + +.. c:type:: struct _generic_SUNAdaptController *SUNAdaptController + +and the base class structure is defined as + +.. code-block:: C + + struct _generic_SUNAdaptController { + void* content; + generic_SUNAdaptController_Ops* ops; + SUNContext sunctx; + }; + +Here, ``_generic_SUNAdaptController_Ops`` is the pointer to a structure containing +function pointers to the various controller operations, and is defined as + +.. code-block:: c + + struct _generic_SUNAdaptController_Ops { + SUNAdaptController_Type (*getid)(SUNAdaptController C); + int (*destroy)(SUNAdaptController C); + int (*estimatestep)(SUNAdaptController C, sunrealtype h, int p, sunrealtype dsm, sunrealtype* hnew); + int (*reset)(SUNAdaptController C); + int (*setdefaults)(SUNAdaptController C); + int (*write)(SUNAdaptController C, FILE* fptr); + int (*seterrorbias)(SUNAdaptController C, sunrealtype bias); + int (*updateh)(SUNAdaptController C, sunrealtype h, sunrealtype dsm); + int (*space)(SUNAdaptController C, long int *lenrw, long int *leniw); + }; + + +.. _SUNAdaptController.Description.controllerTypes: + +SUNAdaptController Types +------------------------ + +The time integrators in SUNDIALS adapt a variety of parameters to achieve +accurate and efficient computations. To this end, each SUNAdaptController implementation +should note its type, so that integrators will understand the types of +adaptivity that the controller is designed to perform. These are encoded in the +following set of SUNAdaptController types: + +.. c:enum:: SUNAdaptController_Type + + The enumerated type :c:type:`SUNAdaptController_Type` defines the enumeration + constants for SUNDIALS error controller types + +.. c:enumerator:: SUN_ADAPTCONTROLLER_NONE + + Empty object that performs no control. + +.. c:enumerator:: SUN_ADAPTCONTROLLER_H + + Controls a single-rate step size. + + + +.. _SUNAdaptController.Description.operations: + +SUNAdaptController Operations +----------------------------- + +The base SUNAdaptController class defines and implements all SUNAdaptController functions. Most +of these routines are merely wrappers for the operations defined by a particular +SUNAdaptController implementation, which are accessed through the *ops* field of the +``SUNAdaptController`` structure. The base SUNAdaptController class provides the +constructor + +.. c:function:: SUNAdaptController SUNAdaptController_NewEmpty(SUNContext sunctx) + + This function allocates a new generic ``SUNAdaptController`` object and initializes + its content pointer and the function pointers in the operations structure to + ``NULL``. + + :param sunctx: the :c:type:`SUNContext` object (see :numref:`SUNDIALS.SUNContext`) + + :returns: If successful, a generic :c:type:`SUNAdaptController` object. If + unsuccessful, a ``NULL`` pointer will be returned. + +Each of the following methods are *optional* for any specific SUNAdaptController +implementation, however some may be required based on the implementation's +:c:type:`SUNAdaptController_Type` (see Section :numref:`SUNAdaptController.Description.controllerTypes`). We +note these requirements below. Additionally, we note the behavior of the base SUNAdaptController methods when they perform an action other than only a successful return. + +.. c:function:: SUNAdaptController_Type SUNAdaptController_GetType(SUNAdaptController C) + + Returns the type identifier for the controller *C*. Returned values + are given in Section :numref:`SUNAdaptController.Description.controllerTypes` + + :param C: the :c:type:`SUNAdaptController` object. + :return: :c:type:`SUNAdaptController_Type` type identifier. + + Usage: + + .. code-block:: c + + SUNAdaptController_Type id = SUNAdaptController_GetType(C); + +.. c:function:: int SUNAdaptController_Destroy(SUNAdaptController C) + + Deallocates the controller *C*. If this method is not provided by the + implementation, the base class method will free both the *content* and + *ops* objects -- this should be sufficient unless a controller implementation + performs dynamic memory allocation of its own (note that the + SUNDIALS-provided SUNAdaptController implementations do not need to supply this + routine). + + :param C: the :c:type:`SUNAdaptController` object. + :return: error code indicating success failure + (see :numref:`SUNAdaptController.Description.errorCodes`). + + Usage: + + .. code-block:: c + + retval = SUNAdaptController_Destroy(C); + +.. c:function:: int SUNAdaptController_EstimateStep(SUNAdaptController C, sunrealtype h, int p, sunrealtype dsm, sunrealtype* hnew) + + Estimates a single-rate step size. This routine is required for controllers + of type ``SUN_ADAPTCONTROLLER_H``. If this is not provided by the + implementation, the base class method will set ``*hnew = h`` and return. + + :param C: the :c:type:`SUNAdaptController` object. + :param h: the step size from the previous step attempt. + :param p: the current order of accuracy for the time integration method. + :param dsm: the local temporal estimate from the previous step attempt. + :param hnew: (output) the estimated step size. + :return: error code indicating success failure + (see :numref:`SUNAdaptController.Description.errorCodes`). + + Usage: + + .. code-block:: c + + retval = SUNAdaptController_EstimateStep(C, hcur, p, dsm, &hnew); + +.. c:function:: int SUNAdaptController_Reset(SUNAdaptController C) + + Resets the controller to its initial state, e.g., if it stores a small number + of previous *dsm* or *h* values. + + :param C: the :c:type:`SUNAdaptController` object. + :return: error code indicating success failure + (see :numref:`SUNAdaptController.Description.errorCodes`). + + Usage: + + .. code-block:: c + + retval = SUNAdaptController_Reset(C); + +.. c:function:: int SUNAdaptController_SetDefaults(SUNAdaptController C) + + Sets the controller parameters to their default values. + + :param C: the :c:type:`SUNAdaptController` object. + :return: error code indicating success failure + (see :numref:`SUNAdaptController.Description.errorCodes`). + + Usage: + + .. code-block:: c + + retval = SUNAdaptController_SetDefaults(C); + +.. c:function:: int SUNAdaptController_Write(SUNAdaptController C, FILE* fptr) + + Writes all controller parameters to the indicated file pointer. + + :param C: the :c:type:`SUNAdaptController` object. + :param fptr: the output stream to write the parameters to. + :return: error code indicating success failure + (see :numref:`SUNAdaptController.Description.errorCodes`). + + Usage: + + .. code-block:: c + + retval = SUNAdaptController_Write(C, stdout); + +.. c:function:: int SUNAdaptController_SetErrorBias(SUNAdaptController C, sunrealtype bias) + + Sets an error bias factor for scaling the local error factors. This is + typically used to slightly exaggerate the temporal error during the + estimation process, leading to a more conservative estimated step size. + + :param C: the :c:type:`SUNAdaptController` object. + :param bias: the error bias factor -- an input :math:`\leq 0` indicates to use + the default value for the controller. + :return: error code indicating success failure + (see :numref:`SUNAdaptController.Description.errorCodes`). + + Usage: + + .. code-block:: c + + retval = SUNAdaptController_SetErrorBias(C, 1.2); + +.. c:function:: int SUNAdaptController_UpdateH(SUNAdaptController C, sunrealtype h, sunrealtype dsm) + + Notifies a controller of type SUN_ADAPTCONTROLLER_H that a successful time step + was taken with stepsize *h* and local error factor *dsm*, indicating that these + can be saved for subsequent controller functions. This is typically relevant for + controllers that store a history of either step sizes or error estimates for + performing the estimation process. + + :param C: the :c:type:`SUNAdaptController` object. + :param h: the successful step size. + :param dsm: the successful temporal error estimate. + :return: error code indicating success failure + (see :numref:`SUNAdaptController.Description.errorCodes`). + + Usage: + + .. code-block:: c + + retval = SUNAdaptController_UpdateH(C, h, dsm); + +.. c:function:: int SUNAdaptController_Space(SUNAdaptController C, long int *lenrw, long int *leniw) + + Informative routine that returns the memory requirements of the + :c:type:`SUNAdaptController` object. + + :param C: the :c:type:`SUNAdaptController` object.. + :param lenrw: (output) number of ``sunsunrealtype`` words stored in the + controller. + :param leniw: (output) number of ``sunindextype`` words stored in the + controller. This may also include pointers, `int` and + `long int` words. + :return: error code indicating success failure + (see :numref:`SUNAdaptController.Description.errorCodes`). + + Usage: + + .. code-block:: c + + retval = SUNAdaptController_Space(C, &lenrw, &leniw); + + + +.. _SUNAdaptController.Description.errorCodes: + +SUNAdaptController Error Codes +------------------------------ + +SUNAdaptController functions return one of the following set of error codes: + +* ``SUNADAPTCONTROLLER_SUCCESS`` (0) -- successful call. + +* ``SUNADAPTCONTROLLER_ILL_INPUT`` (-1001) -- an illegal input has been provided to the function. + +* ``SUNADAPTCONTROLLER_MEM_FAIL`` (-1002) -- a memory access or allocation failed. + +* ``SUNADAPTCONTROLLER_USER_FCN_FAIL`` (-1003) -- a user-supplied function returned a nonzero [error] value. + +* ``SUNADAPTCONTROLLER_OPERATION_FAIL`` (-1004) -- catch-all for errors not in the above list. + +.. note:: + The SUNDIALS time integrators do not rely on these specific return values and only + on whether the returned values are 0 (successful) or non-zero (failure). Thus, + user-defined implementations are not required to use these specific error codes, + so long as the zero/non-zero convention is followed. + + +C/C++ API Usage +--------------- + +Specific SUNDIALS adaptivity controller modules can be used in C and C++ programs by including +the corresponding header file for that module, e.g. ``sunadaptcontroller/sunadaptcontroller_XYZ.h``. + +Example usage (here ``SUNAdaptController_XYZ`` is a placeholder for an actual SUNAdaptController +constructor): + +.. code-block:: c + + #include + #include + #include + #include + #include + + int main() + { + /* Create a SUNContext object */ + SUNContext sunctx = ...; + + /* Create a SUNAdaptController object */ + SUNAdaptController C = SUNAdaptController_XYZ(sunctx); + + /* Use the control object */ + + /* Destroy the control object */ + retval = SUNAdaptController_Destroy(C); + + return 0; + } diff --git a/doc/shared/sunadaptcontroller/SUNAdaptController_ImExGus.rst b/doc/shared/sunadaptcontroller/SUNAdaptController_ImExGus.rst new file mode 100644 index 0000000000..c0a54fddf8 --- /dev/null +++ b/doc/shared/sunadaptcontroller/SUNAdaptController_ImExGus.rst @@ -0,0 +1,128 @@ +.. + Programmer(s): Daniel R. Reynolds @ SMU + ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2023, Lawrence Livermore National Security + and Southern Methodist University. + All rights reserved. + + See the top-level LICENSE and NOTICE files for details. + + SPDX-License-Identifier: BSD-3-Clause + SUNDIALS Copyright End + ---------------------------------------------------------------- + +.. _SUNAdaptController.ImExGus: + +The SUNAdaptController_ImExGus Module +====================================== + +The ImEx Gustafsson implementation of the SUNAdaptController class, SUNAdaptController_ImExGus, +implements a combination of two adaptivity controllers proposed +by K. Gustafsson. His "explicit" controller was proposed in :cite:p:`Gust:91`, +is primarily useful with explicit Runge--Kutta methods, and has the form + +.. math:: + h' \;=\; \begin{cases} + h_1\; \varepsilon_1^{-1/(p+1)}, &\quad\text{on the first step}, \\ + h_n\; \varepsilon_n^{-k_1^E/(p+1)}\; + \left(\dfrac{\varepsilon_n}{\varepsilon_{n-1}}\right)^{k_2^E/(p+1)}, & + \quad\text{on subsequent steps}. + \end{cases} + :label: expGusController + +Similarly, Gustafsson's "implicit" controller was proposed in :cite:p:`Gust:94` +with the form + +.. math:: + h' = \begin{cases} + h_1 \varepsilon_1^{-1/(p+1)}, &\quad\text{on the first step}, \\ + h_n \left(\dfrac{h_n}{h_{n-1}}\right) \varepsilon_n^{-k_1^I/(p+1)} + \left(\dfrac{\varepsilon_n}{\varepsilon_{n-1}}\right)^{-k_2^I/(p+1)}, & + \quad\text{on subsequent steps}. + \end{cases} + :label: impGusController + +In the above formulas, the default values of :math:`k_1^E`, :math:`k_2^E`, +:math:`k_1^I`, and :math:`k_2^I` are 0.367, 0.268, 0.98, and 0.95, respectively, +and :math:`p` is the global order of the time integration method. In these +estimates, a floor of :math:`\varepsilon_* > 10^{-10}` is enforced to avoid +division-by-zero errors. + +The SUNAdaptController_ImExGus controller implements both formulas +:eq:`expGusController` and :eq:`impGusController`, and sets its recommended step +size as the minimum of these two. It is implemented as a derived SUNAdaptController +class, and defines its *content* field as: + +.. code-block:: c + + struct _SUNAdaptControllerContent_ImExGus { + sunrealtype k1e; + sunrealtype k2e; + sunrealtype k1i; + sunrealtype k2i; + sunrealtype bias; + sunrealtype ep; + sunrealtype hp; + sunbooleantype firststep; + }; + +These entries of the *content* field contain the following information: + +* ``k1e, k2e`` - explicit controller parameters used in :eq:`expGusController`. + +* ``k1i, k2i`` - implicit controller parameters used in :eq:`impGusController`. + +* ``bias`` - error bias factor, that converts from an input temporal error + estimate via :math:`\varepsilon = \text{bias}*\text{dsm}`. + +* ``ep`` - storage for the previous error estimate, :math:`\varepsilon_{n-1}`. + +* ``hp`` - storage for the previous step size, :math:`h_{n-1}`. + +* ``firststep`` - flag indicating whether a step has completed successfully, allowing + the formulas above to transition between :math:`h_1` and :math:`h_n`. + +The header file to be included when using this module is +``sunadaptcontroller/sunadaptcontroller_imexgus.h``. + + +The SUNAdaptController_ImExGus class provides implementations of all operations +relevant to a ``SUN_ADAPTCONTROLLER_H`` controller listed in +:numref:`SUNAdaptController.Description.operations`. The +SUNAdaptController_ImExGus class also provides the following additional user-callable +routines: + + +.. c:function:: SUNAdaptController SUNAdaptController_ImExGus(SUNContext sunctx) + + This constructor creates and allocates memory for a SUNAdaptController_ImExGus + object, and inserts its default parameters. + + :param sunctx: the current :c:type:`SUNContext` object. + :return: if successful, a usable :c:type:`SUNAdaptController` object; otherwise it will return ``NULL``. + + Usage: + + .. code-block:: c + + SUNAdaptController C = SUNAdaptController_ImExGus(sunctx); + +.. c:function:: int SUNAdaptController_SetParams_ImExGus(SUNAdaptController C, sunrealtype k1e, sunrealtype k2e, sunrealtype k1i, sunrealtype k2i) + + This user-callable function provides control over the relevant parameters + above. This should be called *before* the time integrator is called to evolve + the problem. + + :param C: the SUNAdaptController_ImExGus object. + :param k1e: parameter used within the controller time step estimate. + :param k2e: parameter used within the controller time step estimate. + :param k1i: parameter used within the controller time step estimate. + :param k2i: parameter used within the controller time step estimate. + :return: error code indication success or failure (see :numref:`SUNAdaptController.Description.errorCodes`). + + Usage: + + .. code-block:: c + + retval = SUNAdaptController_SetParams_ImExGus(C, 0.4, 0.3, -1.0, 1.0); diff --git a/doc/shared/sunadaptcontroller/SUNAdaptController_Soderlind.rst b/doc/shared/sunadaptcontroller/SUNAdaptController_Soderlind.rst new file mode 100644 index 0000000000..e7bf4867f2 --- /dev/null +++ b/doc/shared/sunadaptcontroller/SUNAdaptController_Soderlind.rst @@ -0,0 +1,315 @@ +.. + Programmer(s): Daniel R. Reynolds @ SMU + ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2023, Lawrence Livermore National Security + and Southern Methodist University. + All rights reserved. + + See the top-level LICENSE and NOTICE files for details. + + SPDX-License-Identifier: BSD-3-Clause + SUNDIALS Copyright End + ---------------------------------------------------------------- + +.. _SUNAdaptController.Soderlind: + +The SUNAdaptController_Soderlind Module +======================================= + +The Soderlind implementation of the SUNAdaptController class, +SUNAdaptController_Soderlind, implements a general structure for temporal +control proposed by G. Soderlind in :cite:p:`Sod:98`, :cite:p:`Sod:03`, +and :cite:p:`Sod:06`. This controller has the form + +.. math:: + h' = h_n \varepsilon_n^{-k_1/(p+1)} \varepsilon_{n-1}^{-k_2/(p+1)} \varepsilon_{n-2}^{-k_3/(p+1)} \left(\dfrac{h_n}{h_{n-1}}\right)^{k_4} \left(\dfrac{h_{n-1}}{h_{n-2}}\right)^{k_5} + +with default parameter values :math:`k_1 = 1.25`, :math:`k_2 = 0.5`, +:math:`k_3 = -0.75`, :math:`k_4 = 0.25`, and :math:`k_5 = 0.75`, where +:math:`p` is the global order of the time integration method. In this estimate, +a floor of :math:`\varepsilon_* > 10^{-10}` is enforced to avoid division-by-zero +errors. During the first two steps (when :math:`\varepsilon_{n-2}`, +:math:`\varepsilon_{n-1}`, :math:`h_{n-2}`, and :math:`h_{n-2}` may be unavailable), +the corresponding terms are merely omitted during estimation of :math:`h'`. + +The SUNAdaptController_Soderlind controller is implemented as a derived +SUNAdaptController class, and defines its *content* field as: + +.. code-block:: c + + struct _SUNAdaptControllerContent_Soderlind { + sunrealtype k1; + sunrealtype k2; + sunrealtype k3; + sunrealtype k4; + sunrealtype k5; + sunrealtype bias; + sunrealtype ep; + sunrealtype epp; + sunrealtype hp; + sunrealtype hpp; + int firststeps; + }; + +These entries of the *content* field contain the following information: + +* ``k1, k2, k3, k4, k5`` - controller parameters above. + +* ``bias`` - error bias factor, that converts from an input temporal error + estimate via :math:`\varepsilon = \text{bias}*\text{dsm}`. + +* ``ep, epp`` - storage for the two previous error estimates, + :math:`\varepsilon_{n-1}` and :math:`\varepsilon_{n-2}`. + +* ``hp, hpp`` - storage for the previous two step sizes, :math:`h_{n-1}` + and :math:`h_{n-2}`. + +* ``firststeps`` - counter to handle first two steps (where previous + step sizes and errors are unavailable). + +The header file to be included when using this module is +``sunadaptcontroller/sunadaptcontroller_soderlind.h``. + +We note that through appropriate selection of the parameters :math:`k_*`, +this controller may create a wide range of proposed temporal adaptivity controllers, +including the PID, PI, I, as well as Gustafsson's explicit and implicit controllers, +:cite:p:`Gust:91` and :cite:p:`Gust:94`. As a convenience, utility routines to +create these controllers and set their parameters (as special cases of the +SUNAdaptController_Soderlind) are provided. + +The SUNAdaptController_Soderlind class provides implementations of all operations +relevant to a ``SUN_ADAPTCONTROLLER_H`` controller listed in +:numref:`SUNAdaptController.Description.operations`. This class +also provides the following additional user-callable routines: + + +.. c:function:: SUNAdaptController SUNAdaptController_Soderlind(SUNContext sunctx) + + This constructor creates and allocates memory for a SUNAdaptController_Soderlind + object, and inserts its default parameters. + + :param sunctx: the current :c:type:`SUNContext` object. + :return: if successful, a usable :c:type:`SUNAdaptController` object; + otherwise it will return ``NULL``. + + Usage: + + .. code-block:: c + + SUNAdaptController C = SUNAdaptController_Soderlind(sunctx); + +.. c:function:: int SUNAdaptController_SetParams_Soderlind(SUNAdaptController C, sunrealtype k1, sunrealtype k2, sunrealtype k3, sunrealtype k4, sunrealtype k5) + + This user-callable function provides control over the relevant parameters + above. This should be called *before* the time integrator is called to evolve + the problem. + + :param C: the SUNAdaptController_Soderlind object. + :param k1: parameter used within the controller time step estimate. + :param k2: parameter used within the controller time step estimate. + :param k3: parameter used within the controller time step estimate. + :param k4: parameter used within the controller time step estimate. + :param k5: parameter used within the controller time step estimate. + :return: error code indication success or failure (see :numref:`SUNAdaptController.Description.errorCodes`). + + Usage: + + .. code-block:: c + + /* Specify parameters for Soderlind's H_{0}312 controller */ + retval = SUNAdaptController_SetParams_Soderlind(C, 0.25, 0.5, 0.25, -0.75, -0.25); + + +.. c:function:: SUNAdaptController SUNAdaptController_PID(SUNContext sunctx) + + This constructor creates and allocates memory for a SUNAdaptController_Soderlind + object, set up to replicate a PID controller, and inserts its default parameters + :math:`k_1=0.58`, :math:`k_2=-0.21`, :math:`k_3=0.1`, and :math:`k_4=k_5=0`. + + :param sunctx: the current :c:type:`SUNContext` object. + :return: if successful, a usable :c:type:`SUNAdaptController` object; + otherwise it will return ``NULL``. + + Usage: + + .. code-block:: c + + SUNAdaptController C = SUNAdaptController_PID(sunctx); + +.. c:function:: int SUNAdaptController_SetParams_PID(SUNAdaptController C, sunrealtype k1, sunrealtype k2, sunrealtype k3) + + This user-callable function provides control over the relevant parameters + above for a PID controller, setting :math:`k_4 = k_5 = 0`. This should be + called *before* the time integrator is called to evolve the problem. + + :param C: the SUNAdaptController_Soderlind object. + :param k1: parameter used within the controller time step estimate. + :param k2: parameter used within the controller time step estimate. + :param k3: parameter used within the controller time step estimate. + :return: error code indication success or failure (see :numref:`SUNAdaptController.Description.errorCodes`). + + Usage: + + .. code-block:: c + + retval = SUNAdaptController_SetParams_PID(C, 0.58, -0.21, 0.1); + + +.. c:function:: SUNAdaptController SUNAdaptController_PI(SUNContext sunctx) + + This constructor creates and allocates memory for a SUNAdaptController_Soderlind + object, set up to replicate a PI controller, and inserts its default parameters + :math:`k_1=0.8`, :math:`k_2=-0.31`, and :math:`k_3=k_4=k_5=0`. + + :param sunctx: the current :c:type:`SUNContext` object. + :return: if successful, a usable :c:type:`SUNAdaptController` object; + otherwise it will return ``NULL``. + + Usage: + + .. code-block:: c + + SUNAdaptController C = SUNAdaptController_PI(sunctx); + +.. c:function:: int SUNAdaptController_SetParams_PI(SUNAdaptController C, sunrealtype k1, sunrealtype k2) + + This user-callable function provides control over the relevant parameters + above for a PI controller, setting :math:`k_3 = k_4 = k_5 = 0`. This should + be called *before* the time integrator is called to evolve the problem. + + :param C: the SUNAdaptController_Soderlind object. + :param k1: parameter used within the controller time step estimate. + :param k2: parameter used within the controller time step estimate. + :return: error code indication success or failure (see :numref:`SUNAdaptController.Description.errorCodes`). + + Usage: + + .. code-block:: c + + retval = SUNAdaptController_SetParams_PI(C, 0.8, -0.31); + + +.. c:function:: SUNAdaptController SUNAdaptController_I(SUNContext sunctx) + + This constructor creates and allocates memory for a SUNAdaptController_Soderlind + object, set up to replicate an I controller, and inserts its default parameters + :math:`k_1=1.0` and :math:`k_2=k_3=k_4=k_5=0`. + + :param sunctx: the current :c:type:`SUNContext` object. + :return: if successful, a usable :c:type:`SUNAdaptController` object; + otherwise it will return ``NULL``. + + Usage: + + .. code-block:: c + + SUNAdaptController C = SUNAdaptController_I(sunctx); + +.. c:function:: int SUNAdaptController_SetParams_I(SUNAdaptController C, sunrealtype k1) + + This user-callable function provides control over the relevant parameters + above for an I controller, setting :math:`k_2 = k_3 = k_4 = k_5 = 0`. This + should be called *before* the time integrator is called to evolve the problem. + + :param C: the SUNAdaptController_Soderlind object. + :param k1: parameter used within the controller time step estimate. + :return: error code indication success or failure (see :numref:`SUNAdaptController.Description.errorCodes`). + + Usage: + + .. code-block:: c + + retval = SUNAdaptController_SetParams_I(C, 1.0); + + +.. c:function:: SUNAdaptController SUNAdaptController_ExpGus(SUNContext sunctx) + + This constructor creates and allocates memory for a SUNAdaptController_Soderlind + object, set up to replicate Gustafsson's explicit controller :cite:p:`Gust:91`, and + inserts its default parameters :math:`k_1=0.635`, :math:`k_2=-0.268`, and + :math:`k_3=k_4=k_5=0`. + + :param sunctx: the current :c:type:`SUNContext` object. + :return: if successful, a usable :c:type:`SUNAdaptController` object; + otherwise it will return ``NULL``. + + Usage: + + .. code-block:: c + + SUNAdaptController C = SUNAdaptController_ExpGus(sunctx); + +.. c:function:: int SUNAdaptController_SetParams_ExpGus(SUNAdaptController C, sunrealtype k1_hat, sunrealtype k2_hat) + + This user-callable function provides control over the relevant parameters + above for the explicit Gustafsson controller, setting :math:`k_3 = k_4 = k_5 = 0`. + This should be called *before* the time integrator is called to evolve the problem. + + .. note:: + + Gustafsson's explicit controller has the form + + .. math:: + h' = h_n \varepsilon_n^{-\hat{k}_1/(p+1)} \left(\frac{\varepsilon_n}{\varepsilon_{n-1}}\right)^{-\hat{k}_2/(p+1)}. + + The inputs to this function correspond to the values of :math:`\hat{k}_1` and :math:`\hat{k}_2`, + which are internally transformed into the Soderlind coeficients :math:`k_1 = \hat{k}_1+\hat{k}_2` + and :math:`k_2 = -\hat{k}_2`. + + :param C: the SUNAdaptController_Soderlind object. + :param k1_hat: parameter used within the explicit Gustafsson controller time step estimate. + :param k2_hat: parameter used within the explicit Gustafsson controller time step estimate. + :return: error code indication success or failure (see :numref:`SUNAdaptController.Description.errorCodes`). + + Usage: + + .. code-block:: c + + retval = SUNAdaptController_SetParams_ExpGus(C, 0.367, 0.268); + + +.. c:function:: SUNAdaptController SUNAdaptController_ImpGus(SUNContext sunctx) + + This constructor creates and allocates memory for a SUNAdaptController_Soderlind + object, set up to replicate Gustafsson's implicit controller :cite:p:`Gust:94`, and + inserts its default parameters :math:`k_1=1.93`, :math:`k_2=-0.95`, :math:`k_4=1`, and + :math:`k_3=k_5=0`. + + :param sunctx: the current :c:type:`SUNContext` object. + :return: if successful, a usable :c:type:`SUNAdaptController` object; + otherwise it will return ``NULL``. + + Usage: + + .. code-block:: c + + SUNAdaptController C = SUNAdaptController_ImpGus(sunctx); + +.. c:function:: int SUNAdaptController_SetParams_ImpGus(SUNAdaptController C, sunrealtype k1_hat, sunrealtype k2_hat) + + This user-callable function provides control over the relevant parameters + above for the implicit Gustafsson controller, setting :math:`k_3 = k_4 = k_5 = 0`. + This should be called *before* the time integrator is called to evolve the problem. + + .. note:: + + Gustafsson's implicit controller has the form + + .. math:: + h' = h_n \varepsilon_n^{-\hat{k}_1/(p+1)} \left(\frac{\varepsilon_n}{\varepsilon_{n-1}}\right)^{-\hat{k}_2/(p+1)} \left(\frac{h_n}{h_{n-1}}\right). + + The inputs to this function correspond to the values of :math:`\hat{k}_1` and :math:`\hat{k}_2`, + which are internally transformed into the Soderlind coeficients :math:`k_1 = \hat{k}_1+\hat{k}_2`, + :math:`k_2 = -\hat{k}_2`, and :math:`k_4=1`. + + :param C: the SUNAdaptController_Soderlind object. + :param k1_hat: parameter used within the implicit Gustafsson controller time step estimate. + :param k2_hat: parameter used within the implicit Gustafsson controller time step estimate. + :return: error code indication success or failure (see :numref:`SUNAdaptController.Description.errorCodes`). + + Usage: + + .. code-block:: c + + retval = SUNAdaptController_SetParams_ImpGus(C, 0.98, 0.95); diff --git a/doc/superbuild/source/arkode/index.rst b/doc/superbuild/source/arkode/index.rst index 5d09b7044c..972153c5a4 100644 --- a/doc/superbuild/source/arkode/index.rst +++ b/doc/superbuild/source/arkode/index.rst @@ -14,6 +14,8 @@ ARKODE Documentation ******************** +.. include:: ../../../arkode/guide/source/Landing.rst + **Table of Contents**: .. toctree:: diff --git a/doc/superbuild/source/index.rst b/doc/superbuild/source/index.rst index 571e8f9c2d..a0a56ed96e 100644 --- a/doc/superbuild/source/index.rst +++ b/doc/superbuild/source/index.rst @@ -39,6 +39,7 @@ SUNDIALS is developed on `GitHub `_. sunmatrix/index.rst sunlinsol/index.rst sunnonlinsol/index.rst + sunadaptcontroller/index.rst sunmemory/index.rst Install_link.rst History_link.rst diff --git a/doc/superbuild/source/sunadaptcontroller/SUNAdaptController_links.rst b/doc/superbuild/source/sunadaptcontroller/SUNAdaptController_links.rst new file mode 100644 index 0000000000..ee94a630b1 --- /dev/null +++ b/doc/superbuild/source/sunadaptcontroller/SUNAdaptController_links.rst @@ -0,0 +1,15 @@ +.. ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2023, Lawrence Livermore National Security + and Southern Methodist University. + All rights reserved. + + See the top-level LICENSE and NOTICE files for details. + + SPDX-License-Identifier: BSD-3-Clause + SUNDIALS Copyright End + ---------------------------------------------------------------- + +.. include:: ../../../shared/sunadaptcontroller/SUNAdaptController_Description.rst +.. include:: ../../../shared/sunadaptcontroller/SUNAdaptController_Soderlind.rst +.. include:: ../../../shared/sunadaptcontroller/SUNAdaptController_ImExGus.rst diff --git a/doc/superbuild/source/sunadaptcontroller/index.rst b/doc/superbuild/source/sunadaptcontroller/index.rst new file mode 100644 index 0000000000..6ba75858a6 --- /dev/null +++ b/doc/superbuild/source/sunadaptcontroller/index.rst @@ -0,0 +1,31 @@ +.. + Daniel R. Reynolds @ SMU + ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2023, Lawrence Livermore National Security + and Southern Methodist University. + All rights reserved. + + See the top-level LICENSE and NOTICE files for details. + + SPDX-License-Identifier: BSD-3-Clause + SUNDIALS Copyright End + ---------------------------------------------------------------- + +.. _SUNAdaptController: + +##################################### +Time Step Adaptivity Controllers +##################################### + +The SUNDIALS library comes packaged with a variety of :c:type:`SUNAdaptController` +implementations, designed to support various forms of error-based time step +adaptivity within SUNDIALS time integrators. To support applications that may +want to adjust the controller parameters or provide their own implementations, +SUNDIALS defines the :c:type:`SUNAdaptController` base class, along with a +variety of default implementations. + +.. toctree:: + :maxdepth: 1 + + SUNAdaptController_links.rst diff --git a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp index 1a5c98eeab..ad98ede688 100644 --- a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp +++ b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp @@ -67,7 +67,7 @@ // Include MPI #include "mpi.h" -// Include desired integrators, vectors, linear solvers, and nonlinear sovlers +// Include desired integrators, vectors, linear solvers, and nonlinear solvers #include "arkode/arkode_arkstep.h" #include "arkode/arkode_mristep.h" #include "cvode/cvode.h" @@ -393,10 +393,11 @@ static int SetupDecomp(UserData *udata); // Integrator setup functions static int SetupARK(SUNContext ctx, UserData *udata, N_Vector u, - SUNLinearSolver LS, void **arkode_mem); + SUNLinearSolver LS, SUNAdaptController *Ctrl, + void **arkode_mem); static int SetupMRI(SUNContext ctx, UserData *udata, N_Vector u, - SUNLinearSolver LS, void **arkode_mem, - MRIStepInnerStepper *stepper); + SUNLinearSolver LS, SUNAdaptController *Ctrl, + void **arkode_mem, MRIStepInnerStepper *stepper); static int SetupMRICVODE(SUNContext ctx, UserData *udata, N_Vector u, SUNLinearSolver LS, SUNNonlinearSolver *NLS, void **arkode_mem, MRIStepInnerStepper *stepper); @@ -588,15 +589,18 @@ int main(int argc, char* argv[]) // Inner stepper nonlinear solver (CVODE) SUNNonlinearSolver NLS = NULL; + // Timestep adaptivity controller + SUNAdaptController Ctrl = NULL; + // Create integrator switch(udata.integrator) { case(0): - flag = SetupARK(ctx, &udata, u, LS, &arkode_mem); + flag = SetupARK(ctx, &udata, u, LS, &Ctrl, &arkode_mem); if (check_flag((void *) arkode_mem, "SetupARK", 0)) return 1; break; case(1): - flag = SetupMRI(ctx, &udata, u, LS, &arkode_mem, &stepper); + flag = SetupMRI(ctx, &udata, u, LS, &Ctrl, &arkode_mem, &stepper); if (check_flag((void *) arkode_mem, "SetupMRI", 0)) return 1; break; case(2): @@ -746,6 +750,7 @@ int main(int argc, char* argv[]) N_VDestroy(N_VGetLocalVector_MPIPlusX(u)); N_VDestroy(u); FreeUserData(&udata); + (void) SUNAdaptController_Destroy(Ctrl); SUNContext_Free(&ctx); flag = MPI_Finalize(); return 0; @@ -955,7 +960,8 @@ static int SetupDecomp(UserData *udata) static int SetupARK(SUNContext ctx, UserData* udata, N_Vector u, - SUNLinearSolver LS, void** arkode_mem) + SUNLinearSolver LS, SUNAdaptController *Ctrl, + void** arkode_mem) { int flag; @@ -1016,9 +1022,16 @@ static int SetupARK(SUNContext ctx, UserData* udata, N_Vector u, } else { - flag = ARKStepSetAdaptivityMethod(*arkode_mem, udata->controller, SUNTRUE, - SUNFALSE, NULL); - if (check_flag(&flag, "ARKStepSetAdaptivityMethod", 1)) return 1; + switch (udata->controller) { + case (ARK_ADAPT_PID): *Ctrl = SUNAdaptController_PID(ctx); break; + case (ARK_ADAPT_PI): *Ctrl = SUNAdaptController_PI(ctx); break; + case (ARK_ADAPT_I): *Ctrl = SUNAdaptController_I(ctx); break; + case (ARK_ADAPT_EXP_GUS): *Ctrl = SUNAdaptController_ExpGus(ctx); break; + case (ARK_ADAPT_IMP_GUS): *Ctrl = SUNAdaptController_ImpGus(ctx); break; + case (ARK_ADAPT_IMEX_GUS): *Ctrl = SUNAdaptController_ImExGus(ctx); break; + } + flag = ARKStepSetAdaptController(*arkode_mem, *Ctrl); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) return 1; } // Set max steps between outputs @@ -1041,8 +1054,8 @@ static int SetupARK(SUNContext ctx, UserData* udata, N_Vector u, static int SetupMRI(SUNContext ctx, UserData* udata, N_Vector y, - SUNLinearSolver LS, void** arkode_mem, - MRIStepInnerStepper* stepper) + SUNLinearSolver LS, SUNAdaptController *Ctrl, + void** arkode_mem, MRIStepInnerStepper* stepper) { int flag; @@ -1075,9 +1088,16 @@ static int SetupMRI(SUNContext ctx, UserData* udata, N_Vector y, } else { - flag = ARKStepSetAdaptivityMethod(inner_arkode_mem, udata->controller, - SUNTRUE, SUNFALSE, NULL); - if (check_flag(&flag, "ARKStepSetAdaptivityMethod", 1)) return 1; + switch (udata->controller) { + case (ARK_ADAPT_PID): *Ctrl = SUNAdaptController_PID(ctx); break; + case (ARK_ADAPT_PI): *Ctrl = SUNAdaptController_PI(ctx); break; + case (ARK_ADAPT_I): *Ctrl = SUNAdaptController_I(ctx); break; + case (ARK_ADAPT_EXP_GUS): *Ctrl = SUNAdaptController_ExpGus(ctx); break; + case (ARK_ADAPT_IMP_GUS): *Ctrl = SUNAdaptController_ImpGus(ctx); break; + case (ARK_ADAPT_IMEX_GUS): *Ctrl = SUNAdaptController_ImExGus(ctx); break; + } + flag = ARKStepSetAdaptController(inner_arkode_mem, *Ctrl); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) return 1; } // Set max steps between outputs diff --git a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp index 485c1115ff..0e096b71b9 100644 --- a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp +++ b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp @@ -279,6 +279,7 @@ int main(int argc, char* argv[]) SUNLinearSolver LS = NULL; // linear solver memory structure void *arkode_mem = NULL; // ARKODE memory structure FILE *diagfp = NULL; // diagnostics output file + SUNAdaptController C = NULL; // timestep adaptivity controller // Timing variables double t1 = 0.0; @@ -463,9 +464,16 @@ int main(int argc, char* argv[]) } else { - flag = ARKStepSetAdaptivityMethod(arkode_mem, udata->controller, SUNTRUE, - SUNFALSE, NULL); - if (check_flag(&flag, "ARKStepSetAdaptivityMethod", 1)) return 1; + switch (udata->controller) { + case (ARK_ADAPT_PID): C = SUNAdaptController_PID(ctx); break; + case (ARK_ADAPT_PI): C = SUNAdaptController_PI(ctx); break; + case (ARK_ADAPT_I): C = SUNAdaptController_I(ctx); break; + case (ARK_ADAPT_EXP_GUS): C = SUNAdaptController_ExpGus(ctx); break; + case (ARK_ADAPT_IMP_GUS): C = SUNAdaptController_ImpGus(ctx); break; + case (ARK_ADAPT_IMEX_GUS): C = SUNAdaptController_ImExGus(ctx); break; + } + flag = ARKStepSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) return 1; } // Specify linearly implicit non-time-dependent RHS @@ -579,6 +587,7 @@ int main(int argc, char* argv[]) N_VDestroy(u); // Free vectors FreeUserData(udata); // Free user data delete udata; + (void) SUNAdaptController_Destroy(C); // Free timestep adaptivity controller SUNContext_Free(&ctx); // Free context flag = MPI_Finalize(); // Finalize MPI return 0; diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp index f4b27d9bf8..b38e7ded64 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp @@ -363,6 +363,7 @@ int main(int argc, char* argv[]) SUNLinearSolver LS = NULL; // linear solver memory structure void *arkode_mem = NULL; // ARKODE memory structure FILE *diagfp = NULL; // diagnostics output file + SUNAdaptController C = NULL; // timestep adaptivity controller // Timing variables double t1 = 0.0; @@ -513,9 +514,16 @@ int main(int argc, char* argv[]) } else { - flag = ARKStepSetAdaptivityMethod(arkode_mem, udata->controller, SUNTRUE, - SUNFALSE, NULL); - if (check_flag(&flag, "ARKStepSetAdaptivityMethod", 1)) return 1; + switch (udata->controller) { + case (ARK_ADAPT_PID): C = SUNAdaptController_PID(ctx); break; + case (ARK_ADAPT_PI): C = SUNAdaptController_PI(ctx); break; + case (ARK_ADAPT_I): C = SUNAdaptController_I(ctx); break; + case (ARK_ADAPT_EXP_GUS): C = SUNAdaptController_ExpGus(ctx); break; + case (ARK_ADAPT_IMP_GUS): C = SUNAdaptController_ImpGus(ctx); break; + case (ARK_ADAPT_IMEX_GUS): C = SUNAdaptController_ImExGus(ctx); break; + } + flag = ARKStepSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) return 1; } // Specify linearly implicit non-time-dependent RHS @@ -630,6 +638,7 @@ int main(int argc, char* argv[]) N_VDestroy(u); // Free vectors FreeUserData(udata); // Free user data delete udata; + (void) SUNAdaptController_Destroy(C); // Free time adaptivity controller SUNContext_Free(&ctx); // Free context flag = MPI_Finalize(); // Finalize MPI return 0; diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp index b9468dfc3f..29c9a4d0ee 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp @@ -322,6 +322,7 @@ int main(int argc, char* argv[]) SUNLinearSolver LS = NULL; // linear solver memory structure void *arkode_mem = NULL; // ARKODE memory structure FILE *diagfp = NULL; // diagnostics output file + SUNAdaptController C = NULL; // timestep adaptivity controller // Timing variables double t1 = 0.0; @@ -516,9 +517,16 @@ int main(int argc, char* argv[]) } else { - flag = ARKStepSetAdaptivityMethod(arkode_mem, udata->controller, SUNTRUE, - SUNFALSE, NULL); - if (check_flag(&flag, "ARKStepSetAdaptivityMethod", 1)) return 1; + switch (udata->controller) { + case (ARK_ADAPT_PID): C = SUNAdaptController_PID(ctx); break; + case (ARK_ADAPT_PI): C = SUNAdaptController_PI(ctx); break; + case (ARK_ADAPT_I): C = SUNAdaptController_I(ctx); break; + case (ARK_ADAPT_EXP_GUS): C = SUNAdaptController_ExpGus(ctx); break; + case (ARK_ADAPT_IMP_GUS): C = SUNAdaptController_ImpGus(ctx); break; + case (ARK_ADAPT_IMEX_GUS): C = SUNAdaptController_ImExGus(ctx); break; + } + flag = ARKStepSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) return 1; } // Specify linearly implicit non-time-dependent RHS @@ -632,6 +640,7 @@ int main(int argc, char* argv[]) N_VDestroy(u); // Free vectors FreeUserData(udata); // Free user data delete udata; + (void) SUNAdaptController_Destroy(C); // Free timestep adaptivity controller SUNContext_Free(&ctx); // Free context flag = MPI_Finalize(); // Finalize MPI return 0; diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp index ecbd9b44c1..b550f9e607 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp @@ -318,6 +318,7 @@ int main(int argc, char* argv[]) N_Vector u = NULL; // vector for storing solution SUNLinearSolver LS = NULL; // linear solver memory structure void *arkode_mem = NULL; // ARKode memory structure + SUNAdaptController C = NULL; // Time adaptivity controller // Timing variables double t1 = 0.0; @@ -444,9 +445,16 @@ int main(int argc, char* argv[]) } else { - flag = ARKStepSetAdaptivityMethod(arkode_mem, udata.controller, SUNTRUE, - SUNFALSE, NULL); - if (check_flag(&flag, "ARKStepSetAdaptivityMethod", 1)) return 1; + switch (udata.controller) { + case (ARK_ADAPT_PID): C = SUNAdaptController_PID(sunctx); break; + case (ARK_ADAPT_PI): C = SUNAdaptController_PI(sunctx); break; + case (ARK_ADAPT_I): C = SUNAdaptController_I(sunctx); break; + case (ARK_ADAPT_EXP_GUS): C = SUNAdaptController_ExpGus(sunctx); break; + case (ARK_ADAPT_IMP_GUS): C = SUNAdaptController_ImpGus(sunctx); break; + case (ARK_ADAPT_IMEX_GUS): C = SUNAdaptController_ImExGus(sunctx); break; + } + flag = ARKStepSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) return 1; } // Specify linearly implicit non-time-dependent RHS @@ -538,6 +546,7 @@ int main(int argc, char* argv[]) SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors FreeUserData(&udata); // Free user data + (void) SUNAdaptController_Destroy(C); // Free time adaptivity controller } // Finalize MPI diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp index 8b1d75c513..7445479282 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp @@ -325,6 +325,7 @@ int main(int argc, char* argv[]) void *inner_arkode_mem = NULL; // ARKode memory structure MRIStepInnerStepper inner_stepper = NULL; // inner stepper MRIStepCoupling C = NULL; // slow coupling coefficients + SUNAdaptController Ctrl = NULL; // timestep adaptivity controller // Timing variables double t1 = 0.0; @@ -439,9 +440,16 @@ int main(int argc, char* argv[]) } else { - flag = ARKStepSetAdaptivityMethod(inner_arkode_mem, udata.controller, SUNTRUE, - SUNFALSE, NULL); - if (check_flag(&flag, "ARKStepSetAdaptivityMethod", 1)) return 1; + switch (udata.controller) { + case (ARK_ADAPT_PID): Ctrl = SUNAdaptController_PID(sunctx); break; + case (ARK_ADAPT_PI): Ctrl = SUNAdaptController_PI(sunctx); break; + case (ARK_ADAPT_I): Ctrl = SUNAdaptController_I(sunctx); break; + case (ARK_ADAPT_EXP_GUS): Ctrl = SUNAdaptController_ExpGus(sunctx); break; + case (ARK_ADAPT_IMP_GUS): Ctrl = SUNAdaptController_ImpGus(sunctx); break; + case (ARK_ADAPT_IMEX_GUS): Ctrl = SUNAdaptController_ImExGus(sunctx); break; + } + flag = ARKStepSetAdaptController(inner_arkode_mem, Ctrl); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) return 1; } // Attach user data @@ -606,6 +614,7 @@ int main(int argc, char* argv[]) SUNLinSolFree(LSf); // Free linear solver N_VDestroy(u); // Free vectors FreeUserData(&udata); // Free user data + (void) SUNAdaptController_Destroy(Ctrl); // Free timestep adaptivity controller } // Finalize MPI diff --git a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp index dfb312466b..cde3f49b41 100644 --- a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp +++ b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp @@ -185,6 +185,9 @@ int main(int argc, char* argv[]) SUNMatrix A = nullptr; SUNLinearSolver LS = nullptr; + // Adaptivity controller for DIRK, IMEX or MRI fast integrators + SUNAdaptController C = nullptr; + // Matrix and linear solver for MRI fast integrator SUNMatrix A_fast = nullptr; SUNLinearSolver LS_fast = nullptr; @@ -196,13 +199,13 @@ int main(int argc, char* argv[]) switch(uopts.integrator) { case(0): - flag = SetupERK(ctx, udata, uopts, y, &arkode_mem); + flag = SetupERK(ctx, udata, uopts, y, &C, &arkode_mem); break; case(1): - flag = SetupARK(ctx, udata, uopts, y, &A, &LS, &arkode_mem); + flag = SetupARK(ctx, udata, uopts, y, &A, &LS, &C, &arkode_mem); break; case(2): - flag = SetupMRIARK(ctx, udata, uopts, y, &A, &LS, &A_fast, &LS_fast, + flag = SetupMRIARK(ctx, udata, uopts, y, &A, &LS, &A_fast, &LS_fast, &C, &fast_mem, &arkode_mem); break; case(3): @@ -365,6 +368,7 @@ int main(int argc, char* argv[]) SUNLinSolFree(LS); SUNMatDestroy(A_fast); SUNLinSolFree(LS_fast); + (void) SUNAdaptController_Destroy(C); return 0; } @@ -376,7 +380,7 @@ int main(int argc, char* argv[]) int SetupERK(SUNContext ctx, UserData &udata, UserOptions &uopts, N_Vector y, - void** arkode_mem) + SUNAdaptController* C, void** arkode_mem) { // Problem configuration ARKRhsFn f_RHS; // explicit RHS function @@ -426,9 +430,16 @@ int SetupERK(SUNContext ctx, UserData &udata, UserOptions &uopts, N_Vector y, } else if (uopts.controller >= 0) { - flag = ERKStepSetAdaptivityMethod(*arkode_mem, uopts.controller, SUNTRUE, - SUNFALSE, nullptr); - if (check_flag(flag, "ERKStepSetAdaptivityMethod")) return 1; + switch (uopts.controller) { + case (ARK_ADAPT_PID): *C = SUNAdaptController_PID(ctx); break; + case (ARK_ADAPT_PI): *C = SUNAdaptController_PI(ctx); break; + case (ARK_ADAPT_I): *C = SUNAdaptController_I(ctx); break; + case (ARK_ADAPT_EXP_GUS): *C = SUNAdaptController_ExpGus(ctx); break; + case (ARK_ADAPT_IMP_GUS): *C = SUNAdaptController_ImpGus(ctx); break; + case (ARK_ADAPT_IMEX_GUS): *C = SUNAdaptController_ImExGus(ctx); break; + } + flag = ERKStepSetAdaptController(*arkode_mem, *C); + if (check_flag(flag, "ERKStepSetAdaptController")) return 1; } // Set max steps between outputs @@ -444,7 +455,7 @@ int SetupERK(SUNContext ctx, UserData &udata, UserOptions &uopts, N_Vector y, int SetupARK(SUNContext ctx, UserData &udata, UserOptions &uopts, N_Vector y, - SUNMatrix* A, SUNLinearSolver* LS, void** arkode_mem) + SUNMatrix* A, SUNLinearSolver* LS, SUNAdaptController* C, void** arkode_mem) { // Problem configuration ARKRhsFn fe_RHS; // explicit RHS function @@ -673,9 +684,16 @@ int SetupARK(SUNContext ctx, UserData &udata, UserOptions &uopts, N_Vector y, } else if (uopts.controller >= 0) { - flag = ARKStepSetAdaptivityMethod(*arkode_mem, uopts.controller, SUNTRUE, - SUNFALSE, nullptr); - if (check_flag(flag, "ARKStepSetAdaptivityMethod")) return 1; + switch (uopts.controller) { + case (ARK_ADAPT_PID): *C = SUNAdaptController_PID(ctx); break; + case (ARK_ADAPT_PI): *C = SUNAdaptController_PI(ctx); break; + case (ARK_ADAPT_I): *C = SUNAdaptController_I(ctx); break; + case (ARK_ADAPT_EXP_GUS): *C = SUNAdaptController_ExpGus(ctx); break; + case (ARK_ADAPT_IMP_GUS): *C = SUNAdaptController_ImpGus(ctx); break; + case (ARK_ADAPT_IMEX_GUS): *C = SUNAdaptController_ImExGus(ctx); break; + } + flag = ARKStepSetAdaptController(*arkode_mem, *C); + if (check_flag(flag, "ARKStepSetAdaptController")) return 1; } // Set max steps between outputs @@ -693,7 +711,8 @@ int SetupARK(SUNContext ctx, UserData &udata, UserOptions &uopts, N_Vector y, int SetupMRIARK(SUNContext ctx, UserData &udata, UserOptions &uopts, N_Vector y, SUNMatrix* A, SUNLinearSolver* LS, SUNMatrix* A_fast, SUNLinearSolver* LS_fast, - MRIStepInnerStepper* fast_mem, void** arkode_mem) + SUNAdaptController* C, MRIStepInnerStepper* fast_mem, + void** arkode_mem) { // Problem configuration ARKRhsFn fse_RHS; // slow explicit RHS function @@ -805,9 +824,16 @@ int SetupMRIARK(SUNContext ctx, UserData &udata, UserOptions &uopts, } else if (uopts.controller_fast >= 0) { - flag = ARKStepSetAdaptivityMethod(fast_arkode_mem, uopts.controller_fast, - SUNTRUE, SUNFALSE, nullptr); - if (check_flag(flag, "ARKStepSetAdaptivityMethod")) return 1; + switch (uopts.controller_fast) { + case (ARK_ADAPT_PID): *C = SUNAdaptController_PID(ctx); break; + case (ARK_ADAPT_PI): *C = SUNAdaptController_PI(ctx); break; + case (ARK_ADAPT_I): *C = SUNAdaptController_I(ctx); break; + case (ARK_ADAPT_EXP_GUS): *C = SUNAdaptController_ExpGus(ctx); break; + case (ARK_ADAPT_IMP_GUS): *C = SUNAdaptController_ImpGus(ctx); break; + case (ARK_ADAPT_IMEX_GUS): *C = SUNAdaptController_ImExGus(ctx); break; + } + flag = ARKStepSetAdaptController(fast_arkode_mem, *C); + if (check_flag(flag, "ARKStepSetAdaptController")) return 1; } // Set max steps between outputs diff --git a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp index f4c2a56146..f72f53b066 100644 --- a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp +++ b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp @@ -248,14 +248,14 @@ int J_adv_diff_react(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, // Integrator setup functions int SetupERK(SUNContext ctx, UserData &udata, UserOptions &uopts, N_Vector y, - void** arkode_mem); + SUNAdaptController* C, void** arkode_mem); int SetupARK(SUNContext ctx, UserData &udata, UserOptions &uopts, N_Vector y, - SUNMatrix* A, SUNLinearSolver* LS, void** arkode_mem); + SUNMatrix* A, SUNLinearSolver* LS, SUNAdaptController* C, void** arkode_mem); int SetupMRIARK(SUNContext ctx, UserData &udata, UserOptions &uopts, N_Vector y, SUNMatrix* A, SUNLinearSolver* LS, - SUNMatrix* A_fast, SUNLinearSolver* LS_fast, + SUNMatrix* A_fast, SUNLinearSolver* LS_fast, SUNAdaptController* C_fast, MRIStepInnerStepper* fast_mem, void** arkode_mem); int SetupMRICVODE(SUNContext ctx, UserData &udata, UserOptions &uopts, diff --git a/examples/arkode/CXX_serial/ark_heat2D.cpp b/examples/arkode/CXX_serial/ark_heat2D.cpp index ae654ff5d0..60c5748b82 100644 --- a/examples/arkode/CXX_serial/ark_heat2D.cpp +++ b/examples/arkode/CXX_serial/ark_heat2D.cpp @@ -207,6 +207,7 @@ int main(int argc, char* argv[]) N_Vector u = NULL; // vector for storing solution SUNLinearSolver LS = NULL; // linear solver memory structure void *arkode_mem = NULL; // ARKODE memory structure + SUNAdaptController C = NULL; // Adaptivity controller FILE *diagfp = NULL; // diagnostics output file // Timing variables @@ -371,9 +372,16 @@ int main(int argc, char* argv[]) } else { - flag = ARKStepSetAdaptivityMethod(arkode_mem, udata->controller, SUNTRUE, - SUNFALSE, NULL); - if (check_flag(&flag, "ARKStepSetAdaptivityMethod", 1)) return 1; + switch (udata->controller) { + case (ARK_ADAPT_PID): C = SUNAdaptController_PID(ctx); break; + case (ARK_ADAPT_PI): C = SUNAdaptController_PI(ctx); break; + case (ARK_ADAPT_I): C = SUNAdaptController_I(ctx); break; + case (ARK_ADAPT_EXP_GUS): C = SUNAdaptController_ExpGus(ctx); break; + case (ARK_ADAPT_IMP_GUS): C = SUNAdaptController_ImpGus(ctx); break; + case (ARK_ADAPT_IMEX_GUS): C = SUNAdaptController_ImExGus(ctx); break; + } + flag = ARKStepSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) return 1; } // Specify linearly implicit non-time-dependent RHS @@ -484,6 +492,7 @@ int main(int argc, char* argv[]) N_VDestroy(u); // Free vectors FreeUserData(udata); // Free user data delete udata; + (void) SUNAdaptController_Destroy(C); // Free time adaptivity controller SUNContext_Free(&ctx); // Free context return 0; diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp index 9aae281556..f20e4c97e0 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp @@ -358,6 +358,7 @@ int main(int argc, char* argv[]) FILE *diagfp = NULL; // diagnostics output file braid_Core core = NULL; // XBraid memory structure braid_App app = NULL; // ARKode + XBraid interface structure + SUNAdaptController C = NULL; // time step adaptivity controller // Timing variables double t1 = 0.0; @@ -559,9 +560,11 @@ int main(int argc, char* argv[]) // Set adaptive stepping (XBraid with temporal refinement) options if (udata->x_refine) { - // Use I controller - flag = ARKStepSetAdaptivityMethod(arkode_mem, ARK_ADAPT_I, 1, 0, NULL); - if (check_flag(&flag, "ARKStepSetAdaptivityMethod", 1)) return 1; + // Use I controller with default parameters + C = SUNAdaptController_I(ctx); + if (check_flag((void*) C, "SUNAdaptController_I", 0)) return 1; + flag = ARKStepSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) return 1; // Set the step size reduction factor limit (1 / refinement factor limit) flag = ARKStepSetMinReduction(arkode_mem, ONE / udata->x_rfactor_limit); @@ -741,15 +744,16 @@ int main(int argc, char* argv[]) if ((udata->diagnostics || udata->lsinfo) && udata->myid_c == 0) fclose(diagfp); - ARKStepFree(&arkode_mem); // Free integrator memory - SUNLinSolFree(LS); // Free linear solver - N_VDestroy(u); // Free vectors - FreeUserData(udata); // Free user data + ARKStepFree(&arkode_mem); // Free integrator memory + SUNLinSolFree(LS); // Free linear solver + N_VDestroy(u); // Free vectors + FreeUserData(udata); // Free user data delete udata; - braid_Destroy(core); // Free braid memory - ARKBraid_Free(&app); // Free interface memory - SUNContext_Free(&ctx); // Free context - flag = MPI_Finalize(); // Finalize MPI + braid_Destroy(core); // Free braid memory + ARKBraid_Free(&app); // Free interface memory + (void) SUNAdaptController_Destroy(C); // Free time adaptivity controller + SUNContext_Free(&ctx); // Free context + flag = MPI_Finalize(); // Finalize MPI return 0; } diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp index 938562ce40..a9d90df9bd 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp @@ -315,6 +315,7 @@ int main(int argc, char* argv[]) FILE *diagfp = NULL; // diagnostics output file braid_Core core = NULL; // XBraid memory structure braid_App app = NULL; // ARKode + XBraid interface structure + SUNAdaptController C = NULL; // time step adaptivity controller // Timing variables double t1 = 0.0; @@ -506,9 +507,11 @@ int main(int argc, char* argv[]) // Set adaptive stepping (XBraid with temporal refinement) options if (udata->x_refine) { - // Use I controller - flag = ARKStepSetAdaptivityMethod(arkode_mem, ARK_ADAPT_I, 1, 0, NULL); - if (check_flag(&flag, "ARKStepSetAdaptivityMethod", 1)) return 1; + // Use I controller with default parameters + C = SUNAdaptController_I(ctx); + if (check_flag((void*) C, "SUNAdaptController_I", 0)) return 1; + flag = ARKStepSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) return 1; // Set the step size reduction factor limit (1 / refinement factor limit) flag = ARKStepSetMinReduction(arkode_mem, ONE / udata->x_rfactor_limit); @@ -688,15 +691,16 @@ int main(int argc, char* argv[]) if ((udata->diagnostics || udata->lsinfo) && udata->myid_c == 0) fclose(diagfp); - ARKStepFree(&arkode_mem); // Free integrator memory - SUNLinSolFree(LS); // Free linear solver - N_VDestroy(u); // Free vectors - FreeUserData(udata); // Free user data + ARKStepFree(&arkode_mem); // Free integrator memory + SUNLinSolFree(LS); // Free linear solver + N_VDestroy(u); // Free vectors + FreeUserData(udata); // Free user data delete udata; - braid_Destroy(core); // Free braid memory - ARKBraid_Free(&app); // Free interface memory - SUNContext_Free(&ctx); // Free context - flag = MPI_Finalize(); // Finalize MPI + braid_Destroy(core); // Free braid memory + ARKBraid_Free(&app); // Free interface memory + (void) SUNAdaptController_Destroy(C); // Free time adaptivity controller + SUNContext_Free(&ctx); // Free context + flag = MPI_Finalize(); // Finalize MPI return 0; } diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp index 5e4a0b9104..1b146d8a80 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp @@ -239,14 +239,15 @@ static int check_flag(void *flagvalue, const string funcname, int opt); int main(int argc, char* argv[]) { - int flag; // reusable error-checking flag - UserData *udata = NULL; // user data structure - N_Vector u = NULL; // vector for storing solution - SUNLinearSolver LS = NULL; // linear solver memory structure - void *arkode_mem = NULL; // ARKODE memory structure - FILE *diagfp = NULL; // diagnostics output file - braid_Core core = NULL; // XBraid memory structure - braid_App app = NULL; // ARKode + XBraid interface structure + int flag; // reusable error-checking flag + UserData *udata = NULL; // user data structure + N_Vector u = NULL; // vector for storing solution + SUNLinearSolver LS = NULL; // linear solver memory structure + void *arkode_mem = NULL; // ARKODE memory structure + FILE *diagfp = NULL; // diagnostics output file + braid_Core core = NULL; // XBraid memory structure + braid_App app = NULL; // ARKode + XBraid interface structure + SUNAdaptController C = NULL; // time adaptivity controller // Timing variables chrono::time_point t1; @@ -444,9 +445,11 @@ int main(int argc, char* argv[]) // Set adaptive stepping (XBraid with temporal refinement) options if (udata->x_refine) { - // Use I controller - flag = ARKStepSetAdaptivityMethod(arkode_mem, ARK_ADAPT_I, 1, 0, NULL); - if (check_flag(&flag, "ARKStepSetAdaptivityMethod", 1)) return 1; + // Use I controller with default parameters + C = SUNAdaptController_I(ctx); + if (check_flag((void*) C, "SUNAdaptController_I", 0)) return 1; + flag = ARKStepSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) return 1; // Set the step size reduction factor limit (1 / refinement factor limit) flag = ARKStepSetMinReduction(arkode_mem, ONE / udata->x_rfactor_limit); @@ -626,15 +629,16 @@ int main(int argc, char* argv[]) if (udata->diagnostics || udata->lsinfo) fclose(diagfp); - ARKStepFree(&arkode_mem); // Free integrator memory - SUNLinSolFree(LS); // Free linear solver - N_VDestroy(u); // Free vectors - FreeUserData(udata); // Free user data + ARKStepFree(&arkode_mem); // Free integrator memory + SUNLinSolFree(LS); // Free linear solver + N_VDestroy(u); // Free vectors + FreeUserData(udata); // Free user data delete udata; - braid_Destroy(core); // Free braid memory - ARKBraid_Free(&app); // Free interface memory - SUNContext_Free(&ctx); // Free context - flag = MPI_Finalize(); // Finalize MPI + braid_Destroy(core); // Free braid memory + ARKBraid_Free(&app); // Free interface memory + (void) SUNAdaptController_Destroy(C); // Free time adaptivity controller + SUNContext_Free(&ctx); // Free context + flag = MPI_Finalize(); // Finalize MPI return 0; } diff --git a/examples/arkode/C_openmpdev/ark_heat1D_adapt_ompdev.c b/examples/arkode/C_openmpdev/ark_heat1D_adapt_ompdev.c index 82b50d1a4d..bdadafc89b 100644 --- a/examples/arkode/C_openmpdev/ark_heat1D_adapt_ompdev.c +++ b/examples/arkode/C_openmpdev/ark_heat1D_adapt_ompdev.c @@ -121,6 +121,7 @@ int main() { N_Vector yt = NULL; /* empty vector for swapping */ SUNLinearSolver LS = NULL; /* empty linear solver object */ void *arkode_mem = NULL; /* empty ARKode memory structure */ + SUNAdaptController C = NULL; /* empty controller object */ FILE *XFID, *UFID; realtype t, olddt, newdt; realtype *xnew_host = NULL; @@ -189,6 +190,12 @@ int main() { flag = ARKStepSetPredictorMethod(arkode_mem, 0); /* Set predictor method */ if (check_flag(&flag, "ARKStepSetPredictorMethod", 1)) return 1; + /* Specify I-controller with default parameters */ + C = SUNAdaptController_I(ctx); + if (check_flag((void *)C, "SUNAdaptController_I", 0)) return 1; + flag = ARKStepSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) return 1; + /* Specify linearly implicit RHS, with time-dependent Jacobian */ flag = ARKStepSetLinear(arkode_mem, 1); if (check_flag(&flag, "ARKStepSetLinear", 1)) return 1; @@ -315,6 +322,7 @@ int main() { free(udata); ARKStepFree(&arkode_mem); /* Free integrator memory */ SUNLinSolFree(LS); /* Free linear solver */ + (void) SUNAdaptController_Destroy(C); /* Free time adaptivity controller */ SUNContext_Free(&ctx); /* Free context */ return 0; diff --git a/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.out b/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.out index 280069d4a3..df7478fcae 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.out +++ b/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.out @@ -58,7 +58,7 @@ At top right: c1, c2 = -2.537e-27 4.163e+11 Final Statistics: -lenrw = 3901 leniw = 267 +lenrw = 3902 leniw = 267 lenrwls = 2455 leniwls = 126 nst = 7252 nfe = 0 nfe = 76929 nfels = 102816 @@ -127,7 +127,7 @@ At top right: c1, c2 = -5.134e-07 4.163e+11 Final Statistics: -lenrw = 3901 leniw = 272 +lenrw = 3902 leniw = 272 lenrwls = 2455 leniwls = 126 nst = 7427 nfe = 0 nfe = 78794 nfels = 111450 diff --git a/examples/arkode/C_parallel/ark_diurnal_kry_p.out b/examples/arkode/C_parallel/ark_diurnal_kry_p.out index 3e509d403e..a2db3d9006 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_p.out +++ b/examples/arkode/C_parallel/ark_diurnal_kry_p.out @@ -10,8 +10,8 @@ At bottom left: c1, c2 = 6.659e+06 2.582e+11 At top right: c1, c2 = 7.301e+06 2.833e+11 t = 2.16e+04 no. steps = 3533 stepsize = 1.04e+01 -At bottom left: c1, c2 = 2.665e+07 2.993e+11 -At top right: c1, c2 = 2.931e+07 3.313e+11 +At bottom left: c1, c2 = 2.665e+07 2.993e+11 +At top right: c1, c2 = 2.931e+07 3.313e+11 t = 2.88e+04 no. steps = 4695 stepsize = 3.50e+00 At bottom left: c1, c2 = 8.702e+06 3.380e+11 @@ -50,9 +50,9 @@ At bottom left: c1, c2 = -2.334e-27 3.352e+11 At top right: c1, c2 = -8.983e-26 4.163e+11 -Final Statistics: +Final Statistics: -lenrw = 3301 leniw = 243 +lenrw = 3302 leniw = 243 lenrwls = 2455 leniwls = 126 nst = 7447 nfe = 0 nfi = 79041 nfels = 108536 diff --git a/examples/arkode/C_parhyp/ark_diurnal_kry_ph.out b/examples/arkode/C_parhyp/ark_diurnal_kry_ph.out index 2d806c7252..ffb0e71104 100644 --- a/examples/arkode/C_parhyp/ark_diurnal_kry_ph.out +++ b/examples/arkode/C_parhyp/ark_diurnal_kry_ph.out @@ -2,8 +2,8 @@ 2-species diurnal advection-diffusion problem t = 7.20e+03 no. steps = 979 stepsize = 3.07e+00 -At bottom left: c1, c2 = 1.047e+04 2.527e+11 -At top right: c1, c2 = 1.119e+04 2.700e+11 +At bottom left: c1, c2 = 1.047e+04 2.527e+11 +At top right: c1, c2 = 1.119e+04 2.700e+11 t = 1.44e+04 no. steps = 2733 stepsize = 6.93e+00 At bottom left: c1, c2 = 6.659e+06 2.582e+11 @@ -50,9 +50,9 @@ At bottom left: c1, c2 = -5.225e-26 3.352e+11 At top right: c1, c2 = -5.452e-25 4.163e+11 -Final Statistics: +Final Statistics: -lenrw = 3301 leniw = 243 +lenrw = 3302 leniw = 243 lenrwls = 2455 leniwls = 126 nst = 7102 nfe = 0 nfi = 74579 nfels = 87090 @@ -60,4 +60,3 @@ nni = 38921 nli = 87090 nsetups = 429 netf = 29 npe = 119 nps = 123765 ncfn = 0 ncfl = 0 - diff --git a/examples/arkode/C_petsc/ark_petsc_ex25.c b/examples/arkode/C_petsc/ark_petsc_ex25.c index 9c144a9782..2d88255774 100644 --- a/examples/arkode/C_petsc/ark_petsc_ex25.c +++ b/examples/arkode/C_petsc/ark_petsc_ex25.c @@ -74,6 +74,7 @@ int main(int argc, char **argv) N_Vector nvecx; /* SUNDIALS N_Vector wrapper of X */ SUNNonlinearSolver NLS; /* SUNDIALS nonlinear solver */ SUNContext ctx; /* SUNDIALS context */ + SUNAdaptController C; /* SUNDIALS controller object */ /* PETSc data structures */ SNES snes; /* nonlinear solver */ @@ -205,8 +206,10 @@ int main(int argc, char **argv) ierr = ARKStepSetNonlinearSolver(arkode_mem,NLS); if (check_retval(&ierr,"ARKStepSetNonlinearSolver",1)) return 1; - ierr = ARKStepSetAdaptivityMethod(arkode_mem,2,1,0,NULL); - if (check_retval(&ierr,"ARKStepSetAdaptivity",1)) return 1; + C = SUNAdaptController_I(ctx); + if (check_retval((void *)C, "SUNAdaptController_I", 0)) return 1; + ierr = ARKStepSetAdaptController(arkode_mem, C); + if (check_retval(&ierr, "ARKStepSetAdaptController", 1)) return 1; ierr = ARKStepSetInitStep(arkode_mem,dt); if (check_retval(&ierr,"ARKStepSetInitStep",1)) return 1; @@ -251,6 +254,7 @@ int main(int argc, char **argv) N_VDestroy(nvecx); /* Free x nvector */ SUNNonlinSolFree(NLS); /* Free nonlinear solver */ ARKStepFree(&arkode_mem); /* Free integrator memory */ + (void) SUNAdaptController_Destroy(C); /* Free time adaptivity controller */ /* Free petsc data structures */ ierr = MatDestroy(&J);CHKERRQ(ierr); diff --git a/examples/arkode/C_serial/ark_KrylovDemo_prec.out b/examples/arkode/C_serial/ark_KrylovDemo_prec.out index a3f589f739..79d7c4a86f 100644 --- a/examples/arkode/C_serial/ark_KrylovDemo_prec.out +++ b/examples/arkode/C_serial/ark_KrylovDemo_prec.out @@ -418,7 +418,7 @@ Species 6 Final statistics for this run: - ARKStep real workspace length = 3557 + ARKStep real workspace length = 3558 ARKStep integer workspace length = 131 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 @@ -487,7 +487,7 @@ t = 1.00e+01 nst = 190 nfe = 0 nfi = 3030 nni = 2072 hu = 1.57e+00 Final statistics for this run: - ARKStep real workspace length = 3557 + ARKStep real workspace length = 3558 ARKStep integer workspace length = 136 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 @@ -556,7 +556,7 @@ t = 1.00e+01 nst = 349 nfe = 0 nfi = 5589 nni = 3826 hu = 2.80e-01 Final statistics for this run: - ARKStep real workspace length = 3557 + ARKStep real workspace length = 3558 ARKStep integer workspace length = 141 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 @@ -625,7 +625,7 @@ t = 1.00e+01 nst = 349 nfe = 0 nfi = 5589 nni = 3826 hu = 2.80e-01 Final statistics for this run: - ARKStep real workspace length = 3557 + ARKStep real workspace length = 3558 ARKStep integer workspace length = 146 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 diff --git a/examples/arkode/C_serial/ark_KrylovDemo_prec_1.out b/examples/arkode/C_serial/ark_KrylovDemo_prec_1.out index a3f589f739..79d7c4a86f 100644 --- a/examples/arkode/C_serial/ark_KrylovDemo_prec_1.out +++ b/examples/arkode/C_serial/ark_KrylovDemo_prec_1.out @@ -418,7 +418,7 @@ Species 6 Final statistics for this run: - ARKStep real workspace length = 3557 + ARKStep real workspace length = 3558 ARKStep integer workspace length = 131 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 @@ -487,7 +487,7 @@ t = 1.00e+01 nst = 190 nfe = 0 nfi = 3030 nni = 2072 hu = 1.57e+00 Final statistics for this run: - ARKStep real workspace length = 3557 + ARKStep real workspace length = 3558 ARKStep integer workspace length = 136 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 @@ -556,7 +556,7 @@ t = 1.00e+01 nst = 349 nfe = 0 nfi = 5589 nni = 3826 hu = 2.80e-01 Final statistics for this run: - ARKStep real workspace length = 3557 + ARKStep real workspace length = 3558 ARKStep integer workspace length = 141 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 @@ -625,7 +625,7 @@ t = 1.00e+01 nst = 349 nfe = 0 nfi = 5589 nni = 3826 hu = 2.80e-01 Final statistics for this run: - ARKStep real workspace length = 3557 + ARKStep real workspace length = 3558 ARKStep integer workspace length = 146 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 diff --git a/examples/arkode/C_serial/ark_KrylovDemo_prec_2.out b/examples/arkode/C_serial/ark_KrylovDemo_prec_2.out index a3f589f739..79d7c4a86f 100644 --- a/examples/arkode/C_serial/ark_KrylovDemo_prec_2.out +++ b/examples/arkode/C_serial/ark_KrylovDemo_prec_2.out @@ -418,7 +418,7 @@ Species 6 Final statistics for this run: - ARKStep real workspace length = 3557 + ARKStep real workspace length = 3558 ARKStep integer workspace length = 131 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 @@ -487,7 +487,7 @@ t = 1.00e+01 nst = 190 nfe = 0 nfi = 3030 nni = 2072 hu = 1.57e+00 Final statistics for this run: - ARKStep real workspace length = 3557 + ARKStep real workspace length = 3558 ARKStep integer workspace length = 136 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 @@ -556,7 +556,7 @@ t = 1.00e+01 nst = 349 nfe = 0 nfi = 5589 nni = 3826 hu = 2.80e-01 Final statistics for this run: - ARKStep real workspace length = 3557 + ARKStep real workspace length = 3558 ARKStep integer workspace length = 141 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 @@ -625,7 +625,7 @@ t = 1.00e+01 nst = 349 nfe = 0 nfi = 5589 nni = 3826 hu = 2.80e-01 Final statistics for this run: - ARKStep real workspace length = 3557 + ARKStep real workspace length = 3558 ARKStep integer workspace length = 146 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 diff --git a/examples/arkode/F2003_serial/ark_analytic_f2003.f90 b/examples/arkode/F2003_serial/ark_analytic_f2003.f90 index d8603bb118..1477c35d14 100644 --- a/examples/arkode/F2003_serial/ark_analytic_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_analytic_f2003.f90 @@ -101,6 +101,8 @@ program main use fsunmatrix_dense_mod ! Fortran interface to dense SUNMatrix use fsunlinsol_dense_mod ! Fortran interface to dense SUNLinearSolver use fsundials_context_mod ! Fortran interface to SUNContext + use fsundials_adaptcontroller_mod ! Fortran interface to the generic SUNAdaptController + use fsunadaptcontroller_soderlind_mod ! Fortran interface to Soderlind controller use ode_mod ! ODE functions !======= Declarations ========= @@ -114,17 +116,16 @@ program main real(c_double) :: dtout ! output time interval real(c_double) :: tout ! output time real(c_double) :: tcur(1) ! current time - integer(c_int) :: imethod, idefault, pq ! time step adaptivity parameters - real(c_double) :: adapt_params(3) ! time step adaptivity parameters integer(c_int) :: ierr ! error flag from C functions integer(c_int) :: nout ! number of outputs integer(c_int) :: outstep ! output loop counter - type(N_Vector), pointer :: sunvec_y ! sundials vector - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix - type(SUNLinearSolver), pointer :: sunls ! sundials linear solver - type(c_ptr) :: arkode_mem ! ARKODE memory - real(c_double), pointer :: yvec(:) ! underlying vector + type(N_Vector), pointer :: sunvec_y ! sundials vector + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(SUNLinearSolver), pointer :: sunls ! sundials linear solver + type(SUNAdaptController), pointer :: sunCtrl ! time step controller + type(c_ptr) :: arkode_mem ! ARKODE memory + real(c_double), pointer :: yvec(:) ! underlying vector !======= Internals ============ @@ -183,12 +184,14 @@ program main stop 1 end if - imethod = 4 - idefault = 1 - pq = 0 - ierr = FARKStepSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params) + sunCtrl => FSUNAdaptController_ImpGus(ctx) + if (.not. associated(sunCtrl)) then + print *, 'ERROR: sunCtrl = NULL' + stop 1 + end if + ierr = FARKStepSetAdaptController(arkode_mem, sunCtrl) if (ierr /= 0) then - write(*,*) 'Error in FARKStepSetAdaptivityMethod, ierr = ', ierr, '; halting' + write(*,*) 'Error in FARKStepSetAdaptController, ierr = ', ierr, '; halting' stop 1 end if @@ -228,6 +231,7 @@ program main call FN_VDestroy(sunvec_y) call FSUNMatDestroy(sunmat_A) ierr = FSUNLinSolFree(sunls) + ierr = FSUNAdaptController_Destroy(sunCtrl) ierr = FSUNContext_Free(ctx) end program main diff --git a/examples/arkode/F2003_serial/ark_analytic_f2003.out b/examples/arkode/F2003_serial/ark_analytic_f2003.out index 6bd9ca6971..c5c64ac439 100644 --- a/examples/arkode/F2003_serial/ark_analytic_f2003.out +++ b/examples/arkode/F2003_serial/ark_analytic_f2003.out @@ -16,15 +16,15 @@ 1.00000E+01 1.47113E+00 General Solver Stats: - Total internal steps taken = 413 - Total internal steps attempts = 419 - Total rhs function calls = 4983 + Total internal steps taken = 419 + Total internal steps attempts = 424 + Total rhs function calls = 5090 Num lin solver setup calls = 43 - Num error test failures = 6 + Num error test failures = 5 First internal step size = 6.10352E-12 - Last internal step size = 5.69650E-02 - Next internal step size = 5.69650E-02 - Current internal time = 1.00344E+01 - Num nonlinear solver iters = 2885 + Last internal step size = 6.85164E-02 + Next internal step size = 6.85164E-02 + Current internal time = 1.00642E+01 + Num nonlinear solver iters = 2967 Num nonlinear solver fails = 4 diff --git a/include/arkode/arkode.h b/include/arkode/arkode.h index 3b12589182..a6ed8ebe83 100644 --- a/include/arkode/arkode.h +++ b/include/arkode/arkode.h @@ -137,6 +137,7 @@ extern "C" { #define ARK_RELAX_FUNC_FAIL -45 #define ARK_RELAX_JAC_FAIL -46 +#define ARK_CONTROLLER_ERR -47 #define ARK_UNRECOGNIZED_ERROR -99 diff --git a/include/arkode/arkode_arkstep.h b/include/arkode/arkode_arkstep.h index 361d637e72..666318568c 100644 --- a/include/arkode/arkode_arkstep.h +++ b/include/arkode/arkode_arkstep.h @@ -20,6 +20,8 @@ #include #include #include +#include +#include #include #include #include @@ -182,25 +184,27 @@ SUNDIALS_EXPORT int ARKStepSetTableNum(void *arkode_mem, ARKODE_DIRKTableID itable, ARKODE_ERKTableID etable); SUNDIALS_EXPORT int ARKStepSetTableName(void *arkode_mem, const char *itable, const char *etable); +SUNDIALS_EXPORT int ARKStepSetAdaptController(void *arkode_mem, SUNAdaptController C); +SUNDIALS_EXPORT int ARKStepSetAdaptivityAdjustment(void *arkode_mem, int adjust); SUNDIALS_EXPORT int ARKStepSetCFLFraction(void *arkode_mem, realtype cfl_frac); SUNDIALS_EXPORT int ARKStepSetSafetyFactor(void *arkode_mem, realtype safety); -SUNDIALS_EXPORT int ARKStepSetErrorBias(void *arkode_mem, - realtype bias); +SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") +int ARKStepSetErrorBias(void *arkode_mem, realtype bias); SUNDIALS_EXPORT int ARKStepSetMaxGrowth(void *arkode_mem, realtype mx_growth); SUNDIALS_EXPORT int ARKStepSetMinReduction(void *arkode_mem, realtype eta_min); SUNDIALS_EXPORT int ARKStepSetFixedStepBounds(void *arkode_mem, realtype lb, realtype ub); -SUNDIALS_EXPORT int ARKStepSetAdaptivityMethod(void *arkode_mem, - int imethod, - int idefault, int pq, - realtype adapt_params[3]); -SUNDIALS_EXPORT int ARKStepSetAdaptivityFn(void *arkode_mem, - ARKAdaptFn hfun, - void *h_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") +int ARKStepSetAdaptivityMethod(void *arkode_mem, int imethod, + int idefault, int pq, + realtype adapt_params[3]); +SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") +int ARKStepSetAdaptivityFn(void *arkode_mem, ARKAdaptFn hfun, + void *h_data); SUNDIALS_EXPORT int ARKStepSetMaxFirstGrowth(void *arkode_mem, realtype etamx1); SUNDIALS_EXPORT int ARKStepSetMaxEFailGrowth(void *arkode_mem, diff --git a/include/arkode/arkode_erkstep.h b/include/arkode/arkode_erkstep.h index de656604d1..304c1925c2 100644 --- a/include/arkode/arkode_erkstep.h +++ b/include/arkode/arkode_erkstep.h @@ -18,6 +18,8 @@ #define _ERKSTEP_H #include +#include +#include #include #include @@ -113,25 +115,27 @@ SUNDIALS_EXPORT int ERKStepSetTable(void *arkode_mem, ARKodeButcherTable B); SUNDIALS_EXPORT int ERKStepSetTableNum(void *arkode_mem, ARKODE_ERKTableID etable); SUNDIALS_EXPORT int ERKStepSetTableName(void *arkode_mem, const char *etable); +SUNDIALS_EXPORT int ERKStepSetAdaptController(void *arkode_mem, SUNAdaptController C); +SUNDIALS_EXPORT int ERKStepSetAdaptivityAdjustment(void *arkode_mem, int adjust); SUNDIALS_EXPORT int ERKStepSetCFLFraction(void *arkode_mem, realtype cfl_frac); SUNDIALS_EXPORT int ERKStepSetSafetyFactor(void *arkode_mem, realtype safety); -SUNDIALS_EXPORT int ERKStepSetErrorBias(void *arkode_mem, - realtype bias); +SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") +int ERKStepSetErrorBias(void *arkode_mem, realtype bias); SUNDIALS_EXPORT int ERKStepSetMaxGrowth(void *arkode_mem, realtype mx_growth); SUNDIALS_EXPORT int ERKStepSetMinReduction(void *arkode_mem, realtype eta_min); SUNDIALS_EXPORT int ERKStepSetFixedStepBounds(void *arkode_mem, realtype lb, realtype ub); -SUNDIALS_EXPORT int ERKStepSetAdaptivityMethod(void *arkode_mem, - int imethod, - int idefault, int pq, - realtype adapt_params[3]); -SUNDIALS_EXPORT int ERKStepSetAdaptivityFn(void *arkode_mem, - ARKAdaptFn hfun, - void *h_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") +int ERKStepSetAdaptivityMethod(void *arkode_mem, int imethod, + int idefault, int pq, + realtype adapt_params[3]); +SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") +int ERKStepSetAdaptivityFn(void *arkode_mem, ARKAdaptFn hfun, + void *h_data); SUNDIALS_EXPORT int ERKStepSetMaxFirstGrowth(void *arkode_mem, realtype etamx1); SUNDIALS_EXPORT int ERKStepSetMaxEFailGrowth(void *arkode_mem, diff --git a/include/sunadaptcontroller/sunadaptcontroller_imexgus.h b/include/sunadaptcontroller/sunadaptcontroller_imexgus.h new file mode 100644 index 0000000000..a5d547934b --- /dev/null +++ b/include/sunadaptcontroller/sunadaptcontroller_imexgus.h @@ -0,0 +1,77 @@ +/* ----------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + * ----------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2023, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * ----------------------------------------------------------------- + * This is the header file for the SUNAdaptController_ImExGus module. + * -----------------------------------------------------------------*/ + +#ifndef _SUNADAPTCONTROLLER_IMEXGUS_H +#define _SUNADAPTCONTROLLER_IMEXGUS_H + +#include +#include + +#ifdef __cplusplus /* wrapper to enable C++ usage */ +extern "C" { +#endif + +/* ---------------------------------------------------- + * ImEx Gustafsson implementation of SUNAdaptController + * ---------------------------------------------------- */ + +struct _SUNAdaptControllerContent_ImExGus { + sunrealtype k1i; /* internal controller parameters */ + sunrealtype k2i; + sunrealtype k1e; + sunrealtype k2e; + sunrealtype bias; /* error bias factor */ + sunrealtype ep; /* error from previous step */ + sunrealtype hp; /* previous step size */ + sunbooleantype firststep; /* flag indicating first step */ +}; + +typedef struct _SUNAdaptControllerContent_ImExGus *SUNAdaptControllerContent_ImExGus; + +/* ------------------ + * Exported Functions + * ------------------ */ + +SUNDIALS_EXPORT +SUNAdaptController SUNAdaptController_ImExGus(SUNContext sunctx); +SUNDIALS_EXPORT +int SUNAdaptController_SetParams_ImExGus(SUNAdaptController C, + sunrealtype k1e, sunrealtype k2e, + sunrealtype k1i, sunrealtype k2i); +SUNDIALS_EXPORT +SUNAdaptController_Type SUNAdaptController_GetType_ImExGus(SUNAdaptController C); +SUNDIALS_EXPORT +int SUNAdaptController_EstimateStep_ImExGus(SUNAdaptController C, sunrealtype h, + int p, sunrealtype dsm, sunrealtype* hnew); +SUNDIALS_EXPORT +int SUNAdaptController_Reset_ImExGus(SUNAdaptController C); +SUNDIALS_EXPORT +int SUNAdaptController_SetDefaults_ImExGus(SUNAdaptController C); +SUNDIALS_EXPORT +int SUNAdaptController_Write_ImExGus(SUNAdaptController C, FILE* fptr); +SUNDIALS_EXPORT +int SUNAdaptController_SetErrorBias_ImExGus(SUNAdaptController C, sunrealtype bias); +SUNDIALS_EXPORT +int SUNAdaptController_UpdateH_ImExGus(SUNAdaptController C, sunrealtype h, sunrealtype dsm); +SUNDIALS_EXPORT +int SUNAdaptController_Space_ImExGus(SUNAdaptController C, long int *lenrw, + long int *leniw); + +#ifdef __cplusplus +} +#endif + +#endif /* _SUNADAPTCONTROLLER_IMEXGUS_H */ diff --git a/include/sunadaptcontroller/sunadaptcontroller_soderlind.h b/include/sunadaptcontroller/sunadaptcontroller_soderlind.h new file mode 100644 index 0000000000..8ab530d1e1 --- /dev/null +++ b/include/sunadaptcontroller/sunadaptcontroller_soderlind.h @@ -0,0 +1,111 @@ +/* ----------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + * ----------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2023, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * ----------------------------------------------------------------- + * This is the header file for the SUNAdaptController_Soderlind + * module. + * -----------------------------------------------------------------*/ + +#ifndef _SUNADAPTCONTROLLER_SODERLIND_H +#define _SUNADAPTCONTROLLER_SODERLIND_H + +#include +#include + +#ifdef __cplusplus /* wrapper to enable C++ usage */ +extern "C" { +#endif + +/* ---------------------------------------------------- + * Soderlind implementation of SUNAdaptController + * ---------------------------------------------------- */ + +struct _SUNAdaptControllerContent_Soderlind { + sunrealtype k1; /* internal controller parameters */ + sunrealtype k2; + sunrealtype k3; + sunrealtype k4; + sunrealtype k5; + sunrealtype bias; /* error bias factor */ + sunrealtype ep; /* error from previous step */ + sunrealtype epp; /* error from 2 steps ago */ + sunrealtype hp; /* previous step size */ + sunrealtype hpp; /* step size from 2 steps ago */ + int firststeps; /* flag to handle first few steps */ +}; + +typedef struct _SUNAdaptControllerContent_Soderlind *SUNAdaptControllerContent_Soderlind; + +/* ------------------ + * Exported Functions + * ------------------ */ + +SUNDIALS_EXPORT +SUNAdaptController SUNAdaptController_Soderlind(SUNContext sunctx); +SUNDIALS_EXPORT +int SUNAdaptController_SetParams_Soderlind(SUNAdaptController C, + sunrealtype k1, sunrealtype k2, + sunrealtype k3, sunrealtype k4, + sunrealtype k5); +SUNDIALS_EXPORT +SUNAdaptController_Type SUNAdaptController_GetType_Soderlind(SUNAdaptController C); +SUNDIALS_EXPORT +int SUNAdaptController_EstimateStep_Soderlind(SUNAdaptController C, sunrealtype h, + int p, sunrealtype dsm, sunrealtype* hnew); +SUNDIALS_EXPORT +int SUNAdaptController_Reset_Soderlind(SUNAdaptController C); +SUNDIALS_EXPORT +int SUNAdaptController_SetDefaults_Soderlind(SUNAdaptController C); +SUNDIALS_EXPORT +int SUNAdaptController_Write_Soderlind(SUNAdaptController C, FILE* fptr); +SUNDIALS_EXPORT +int SUNAdaptController_SetErrorBias_Soderlind(SUNAdaptController C, sunrealtype bias); +SUNDIALS_EXPORT +int SUNAdaptController_UpdateH_Soderlind(SUNAdaptController C, sunrealtype h, sunrealtype dsm); +SUNDIALS_EXPORT +int SUNAdaptController_Space_Soderlind(SUNAdaptController C, long int *lenrw, + long int *leniw); + +/* Convenience routines to construct subsidiary controllers */ +SUNDIALS_EXPORT +SUNAdaptController SUNAdaptController_PID(SUNContext sunctx); +SUNDIALS_EXPORT +int SUNAdaptController_SetParams_PID(SUNAdaptController C, + sunrealtype k1, sunrealtype k2, + sunrealtype k3); +SUNDIALS_EXPORT +SUNAdaptController SUNAdaptController_PI(SUNContext sunctx); +SUNDIALS_EXPORT +int SUNAdaptController_SetParams_PI(SUNAdaptController C, + sunrealtype k1, sunrealtype k2); +SUNDIALS_EXPORT +SUNAdaptController SUNAdaptController_I(SUNContext sunctx); +SUNDIALS_EXPORT +int SUNAdaptController_SetParams_I(SUNAdaptController C, sunrealtype k1); + +SUNDIALS_EXPORT +SUNAdaptController SUNAdaptController_ExpGus(SUNContext sunctx); +SUNDIALS_EXPORT +int SUNAdaptController_SetParams_ExpGus(SUNAdaptController C, + sunrealtype k1, sunrealtype k2); + +SUNDIALS_EXPORT +SUNAdaptController SUNAdaptController_ImpGus(SUNContext sunctx); +SUNDIALS_EXPORT +int SUNAdaptController_SetParams_ImpGus(SUNAdaptController C, + sunrealtype k1, sunrealtype k2); + +#ifdef __cplusplus +} +#endif + +#endif /* _SUNADAPTCONTROLLER_SODERLIND_H */ diff --git a/include/sundials/sundials_adaptcontroller.h b/include/sundials/sundials_adaptcontroller.h new file mode 100644 index 0000000000..55c65eac6c --- /dev/null +++ b/include/sundials/sundials_adaptcontroller.h @@ -0,0 +1,159 @@ +/* ----------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + * ----------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2023, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * ----------------------------------------------------------------- + * SUNDIALS accuracy-based adaptivity controller class. These + * objects estimate step sizes for time integration methods such + * that the next step solution should satisfy a desired temporal + * accuracy. + * ----------------------------------------------------------------*/ + +#ifndef _SUNDIALS_ADAPTCONTROLLER_H +#define _SUNDIALS_ADAPTCONTROLLER_H + +#include +#include +#include +#include "sundials/sundials_types.h" + +#ifdef __cplusplus /* wrapper to enable C++ usage */ +extern "C" { +#endif + +/* ----------------------------------------------------------------- + * SUNAdaptController types (currently, only "H" is implemented; + * others are planned): + * NONE - empty controller (does nothing) + * H - controls a single-rate step size + * ----------------------------------------------------------------- */ + +typedef enum +{ + SUN_ADAPTCONTROLLER_NONE, + SUN_ADAPTCONTROLLER_H +} SUNAdaptController_Type; + +/* ----------------------------------------------------------------- + * Generic definition of SUNAdaptController + * ----------------------------------------------------------------- */ + +/* Forward reference for pointer to SUNAdaptController_Ops object */ +typedef _SUNDIALS_STRUCT_ _generic_SUNAdaptController_Ops* SUNAdaptController_Ops; + +/* Forward reference for pointer to SUNAdaptController object */ +typedef _SUNDIALS_STRUCT_ _generic_SUNAdaptController* SUNAdaptController; + +/* Structure containing function pointers to controller operations */ +struct _generic_SUNAdaptController_Ops +{ + /* REQUIRED of all controller implementations. */ + SUNAdaptController_Type (*gettype)(SUNAdaptController C); + + /* REQUIRED for controllers of SUN_ADAPTCONTROLLER_H type. */ + int (*estimatestep)(SUNAdaptController C, sunrealtype h, int p, + sunrealtype dsm, sunrealtype* hnew); + + /* OPTIONAL for all SUNAdaptController implementations. */ + int (*destroy)(SUNAdaptController C); + int (*reset)(SUNAdaptController C); + int (*setdefaults)(SUNAdaptController C); + int (*write)(SUNAdaptController C, FILE* fptr); + int (*seterrorbias)(SUNAdaptController C, sunrealtype bias); + int (*updateh)(SUNAdaptController C, sunrealtype h, sunrealtype dsm); + int (*space)(SUNAdaptController C, long int *lenrw, long int *leniw); +}; + +/* A SUNAdaptController is a structure with an implementation-dependent + 'content' field, and a pointer to a structure of + operations corresponding to that implementation. */ +struct _generic_SUNAdaptController +{ + void* content; + SUNAdaptController_Ops ops; + SUNContext sunctx; +}; + +/* ----------------------------------------------------------------- + * Functions exported by SUNAdaptController module + * ----------------------------------------------------------------- */ + +/* Function to create an empty SUNAdaptController data structure. */ +SUNDIALS_EXPORT +SUNAdaptController SUNAdaptController_NewEmpty(SUNContext sunctx); + +/* Function to report the type of a SUNAdaptController object. */ +SUNDIALS_EXPORT +SUNAdaptController_Type SUNAdaptController_GetType(SUNAdaptController C); + +/* Function to deallocate a SUNAdaptController object. + + Any return value other than SUNADAPTCONTROLLER_SUCCESS will be treated as + an unrecoverable failure. */ +SUNDIALS_EXPORT +int SUNAdaptController_Destroy(SUNAdaptController C); + +/* Main step size controller function. This is called following + a time step with size 'h' and local error factor 'dsm', and the + controller should estimate 'hnew' so that the ensuing step + will have 'dsm' value JUST BELOW 1. + + Any return value other than SUNADAPTCONTROLLER_SUCCESS will be treated as + an unrecoverable failure. */ +SUNDIALS_EXPORT +int SUNAdaptController_EstimateStep(SUNAdaptController C, sunrealtype h, + int p, sunrealtype dsm, sunrealtype* hnew); + +/* Function to reset the controller to its initial state, e.g., if + it stores a small number of previous dsm or step size values. */ +SUNDIALS_EXPORT +int SUNAdaptController_Reset(SUNAdaptController C); + +/* Function to set the controller parameters to their default values. */ +SUNDIALS_EXPORT +int SUNAdaptController_SetDefaults(SUNAdaptController C); + +/* Function to write all controller parameters to the indicated file + pointer. */ +SUNDIALS_EXPORT +int SUNAdaptController_Write(SUNAdaptController C, FILE* fptr); + +/* Function to set an error bias factor to use for scaling the local error + 'dsm' factors above. */ +SUNDIALS_EXPORT +int SUNAdaptController_SetErrorBias(SUNAdaptController C, sunrealtype bias); + +/* Function to notify a controller of type SUN_ADAPTCONTROLLER_H that + a successful time step was taken with stepsize h and local error factor + dsm, indicating that these can be saved for subsequent controller functions. */ +SUNDIALS_EXPORT +int SUNAdaptController_UpdateH(SUNAdaptController C, sunrealtype h, sunrealtype dsm); + +/* Function to return the memory requirements of the controller object. */ +SUNDIALS_EXPORT +int SUNAdaptController_Space(SUNAdaptController C, long int *lenrw, long int *leniw); + + +/* ----------------------------------------------------------------- + * SUNAdaptController error codes + * ----------------------------------------------------------------- */ + +#define SUNADAPTCONTROLLER_SUCCESS 0 /* function successfull */ +#define SUNADAPTCONTROLLER_ILL_INPUT -1001 /* illegal function input */ +#define SUNADAPTCONTROLLER_MEM_FAIL -1002 /* failed memory access/alloc */ +#define SUNADAPTCONTROLLER_USER_FCN_FAIL -1003 /* user-supplied fcn failure */ +#define SUNADAPTCONTROLLER_OPERATION_FAIL -1004 /* catchall failure code */ + +#ifdef __cplusplus +} +#endif + +#endif /* _SUNDIALS_ADAPTCONTROLLER_H */ diff --git a/scripts/shared b/scripts/shared index 11634ec73f..d0197358ba 100755 --- a/scripts/shared +++ b/scripts/shared @@ -69,6 +69,7 @@ $tar $tarfile $distrobase/include/sunlinsol $tar $tarfile $distrobase/include/sunmatrix $tar $tarfile $distrobase/include/sunmemory $tar $tarfile $distrobase/include/sunnonlinsol +$tar $tarfile $distrobase/include/sunadaptcontroller echo " --- Add scripts to $tarfile" $tar $tarfile $distrobase/scripts/sundials_csv.py @@ -81,6 +82,7 @@ $tar $tarfile $distrobase/src/sunlinsol $tar $tarfile $distrobase/src/sunmatrix $tar $tarfile $distrobase/src/sunmemory $tar $tarfile $distrobase/src/sunnonlinsol +$tar $tarfile $distrobase/src/sunadaptcontroller echo " --- Add examples to $tarfile" $tar $tarfile $distrobase/examples/CMakeLists.txt diff --git a/scripts/tarscript b/scripts/tarscript index be1f8083d2..7f86abc7f7 100755 --- a/scripts/tarscript +++ b/scripts/tarscript @@ -244,6 +244,7 @@ cp -r $sundialsdir/include/sunmatrix $tmpdir/include/ cp -r $sundialsdir/include/sunmemory $tmpdir/include/ cp -r $sundialsdir/include/sunlinsol $tmpdir/include/ cp -r $sundialsdir/include/sunnonlinsol $tmpdir/include/ +cp -r $sundialsdir/include/sunadaptcontroller $tmpdir/include/ cp -r $sundialsdir/scripts $tmpdir/ @@ -254,6 +255,7 @@ cp -r $sundialsdir/src/sunmatrix $tmpdir/src/ cp -r $sundialsdir/src/sunmemory $tmpdir/src/ cp -r $sundialsdir/src/sunlinsol $tmpdir/src/ cp -r $sundialsdir/src/sunnonlinsol $tmpdir/src/ +cp -r $sundialsdir/src/sunadaptcontroller $tmpdir/src/ cp $sundialsdir/test/testRunner $tmpdir/test/ cp -r $sundialsdir/test/unit_tests $tmpdir/test/ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5cc51eb748..a24be3c65a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -22,6 +22,7 @@ add_subdirectory(sunmatrix) add_subdirectory(sunlinsol) add_subdirectory(sunnonlinsol) add_subdirectory(sunmemory) +add_subdirectory(sunadaptcontroller) # ARKODE library if(BUILD_ARKODE) diff --git a/src/arkode/CMakeLists.txt b/src/arkode/CMakeLists.txt index cf0254b3e2..7b50ba325f 100644 --- a/src/arkode/CMakeLists.txt +++ b/src/arkode/CMakeLists.txt @@ -41,6 +41,7 @@ set(arkode_SOURCES arkode_sprkstep_io.c arkode_sprkstep.c arkode_sprk.c + arkode_user_controller.c arkode.c ) @@ -75,6 +76,8 @@ sundials_add_library(sundials_arkode sundials_generic_obj sundials_sunmemsys_obj sundials_nvecserial_obj + sundials_sunadaptcontrollerimexgus_obj + sundials_sunadaptcontrollersoderlind_obj sundials_sunmatrixband_obj sundials_sunmatrixdense_obj sundials_sunmatrixsparse_obj diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index d86cf7021c..c191270ec2 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -31,6 +31,7 @@ #include #include #include +#include /*=============================================================== @@ -49,6 +50,7 @@ ARKodeMem arkCreate(SUNContext sunctx) { int iret; + long int lenrw, leniw; ARKodeMem ark_mem; if (!sunctx) { @@ -133,6 +135,18 @@ ARKodeMem arkCreate(SUNContext sunctx) ark_mem->lrw += ARK_ADAPT_LRW; ark_mem->liw += ARK_ADAPT_LIW; + /* Allocate default step controller (PID) and note storage */ + ark_mem->hadapt_mem->hcontroller = SUNAdaptController_PID(sunctx); + if (ark_mem->hadapt_mem->hcontroller == NULL) { + arkProcessError(NULL, ARK_MEM_FAIL, "ARKODE", "arkCreate", + "Allocation of step controller object failed"); + return(NULL); + } + ark_mem->hadapt_mem->owncontroller = SUNTRUE; + (void) SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, &leniw); + ark_mem->lrw += lenrw; + ark_mem->liw += leniw; + /* Initialize the interpolation structure to NULL */ ark_mem->interp = NULL; ark_mem->interp_type = -1; @@ -890,13 +904,6 @@ int arkEvolve(ARKodeMem ark_mem, realtype tout, N_Vector yout, if (kflag < 0) break; } - /* if we've made it here then no nonrecoverable failures occurred; someone above - has recommended an 'eta' value for the next step -- enforce bounds on that value - and set upcoming step size */ - ark_mem->eta = SUNMIN(ark_mem->eta, ark_mem->hadapt_mem->etamax); - ark_mem->eta = SUNMAX(ark_mem->eta, ark_mem->hmin / SUNRabs(ark_mem->h)); - ark_mem->eta /= SUNMAX(ONE, SUNRabs(ark_mem->h) * ark_mem->hmax_inv*ark_mem->eta); - /* if ignoring temporal error test result (XBraid) force step to pass */ if (ark_mem->force_pass) { ark_mem->last_kflag = kflag; @@ -1127,6 +1134,10 @@ void arkFree(void **arkode_mem) /* free the time step adaptivity module */ if (ark_mem->hadapt_mem != NULL) { + if (ark_mem->hadapt_mem->owncontroller) { + (void) SUNAdaptController_Destroy(ark_mem->hadapt_mem->hcontroller); + ark_mem->hadapt_mem->owncontroller = SUNFALSE; + } free(ark_mem->hadapt_mem); ark_mem->hadapt_mem = NULL; } @@ -1265,6 +1276,7 @@ int arkInit(ARKodeMem ark_mem, realtype t0, N_Vector y0, int init_type) { booleantype stepperOK, nvectorOK, allocOK; + int retval; sunindextype lrw1, liw1; /* Check ark_mem */ @@ -1371,15 +1383,18 @@ int arkInit(ARKodeMem ark_mem, realtype t0, N_Vector y0, /* Tolerance scale factor */ ark_mem->tolsf = ONE; + /* Reset error controller object */ + retval = SUNAdaptController_Reset(ark_mem->hadapt_mem->hcontroller); + if (retval != SUNADAPTCONTROLLER_SUCCESS) { + arkProcessError(ark_mem, ARK_CONTROLLER_ERR, "ARKODE", "arkInit", + "Unable to reset error controller object"); + return(ARK_CONTROLLER_ERR); + } + /* Adaptivity counters */ ark_mem->hadapt_mem->nst_acc = 0; ark_mem->hadapt_mem->nst_exp = 0; - /* Error and step size history */ - ark_mem->hadapt_mem->ehist[0] = ONE; - ark_mem->hadapt_mem->ehist[1] = ONE; - ark_mem->hadapt_mem->hhist[0] = ZERO; - ark_mem->hadapt_mem->hhist[1] = ZERO; /* Indicate that calling the full RHS function is not required, this flag is updated to SUNTRUE by the interpolation module initialization function @@ -2451,10 +2466,10 @@ int arkCompleteStep(ARKodeMem ark_mem, realtype dsm) tstop by roundoff, and in that case, we reset tn (after incrementing by h) to tstop. */ - /* During long-time integration, roundoff can creep into tcur. + /* During long-time integration, roundoff can creep into tcur. Compensated summation fixes this but with increased cost, so it is optional. */ if (ark_mem->use_compensated_sums) { - sunCompensatedSum(ark_mem->tn, ark_mem->h, &ark_mem->tcur, &ark_mem->terr); + sunCompensatedSum(ark_mem->tn, ark_mem->h, &ark_mem->tcur, &ark_mem->terr); } else { ark_mem->tcur = ark_mem->tn + ark_mem->h; } @@ -2494,11 +2509,14 @@ int arkCompleteStep(ARKodeMem ark_mem, realtype dsm) N_VScale(ONE, ark_mem->ycur, ark_mem->yn); ark_mem->fn_is_current = SUNFALSE; - /* Update step size and error history arrays */ - ark_mem->hadapt_mem->ehist[1] = ark_mem->hadapt_mem->ehist[0]; - ark_mem->hadapt_mem->ehist[0] = dsm*ark_mem->hadapt_mem->bias; - ark_mem->hadapt_mem->hhist[1] = ark_mem->hadapt_mem->hhist[0]; - ark_mem->hadapt_mem->hhist[0] = ark_mem->h; + /* Notify time step controller object of successful step */ + retval = SUNAdaptController_UpdateH(ark_mem->hadapt_mem->hcontroller, ark_mem->h, dsm); + if (retval != SUNADAPTCONTROLLER_SUCCESS) { + arkProcessError(ark_mem, ARK_CONTROLLER_ERR, "ARKODE", "arkCompleteStep", + "Failure updating controller object"); + return(ARK_CONTROLLER_ERR); + } + /* update scalar quantities */ ark_mem->nst++; @@ -3089,6 +3107,13 @@ int arkCheckTemporalError(ARKodeMem ark_mem, int *nflagPtr, int *nefPtr, realtyp ark_mem->h, dsm, nsttmp); if (retval != ARK_SUCCESS) return(ARK_ERR_FAILURE); + /* if we've made it here then no nonrecoverable failures occurred; someone above + has recommended an 'eta' value for the next step -- enforce bounds on that value + and set upcoming step size */ + ark_mem->eta = SUNMIN(ark_mem->eta, ark_mem->hadapt_mem->etamax); + ark_mem->eta = SUNMAX(ark_mem->eta, ark_mem->hmin / SUNRabs(ark_mem->h)); + ark_mem->eta /= SUNMAX(ONE, SUNRabs(ark_mem->h) * ark_mem->hmax_inv*ark_mem->eta); + /* If est. local error norm dsm passes test, return ARK_SUCCESS */ if (dsm <= ONE) return(ARK_SUCCESS); @@ -3103,10 +3128,15 @@ int arkCheckTemporalError(ARKodeMem ark_mem, int *nflagPtr, int *nefPtr, realtyp /* Set etamax=1 to prevent step size increase at end of this step */ hadapt_mem->etamax = ONE; - /* Enforce failure bounds on eta, update h, and return for retry of step */ + /* Enforce failure bounds on eta */ if (*nefPtr >= hadapt_mem->small_nef) ark_mem->eta = SUNMIN(ark_mem->eta, hadapt_mem->etamxf); + /* Enforce min/max step bounds once again due to adjustments above */ + ark_mem->eta = SUNMIN(ark_mem->eta, ark_mem->hadapt_mem->etamax); + ark_mem->eta = SUNMAX(ark_mem->eta, ark_mem->hmin / SUNRabs(ark_mem->h)); + ark_mem->eta /= SUNMAX(ONE, SUNRabs(ark_mem->h) * ark_mem->hmax_inv*ark_mem->eta); + return(TRY_AGAIN); } diff --git a/src/arkode/arkode_adapt.c b/src/arkode/arkode_adapt.c index 617681e9f5..afe0dfe61b 100644 --- a/src/arkode/arkode_adapt.c +++ b/src/arkode/arkode_adapt.c @@ -42,10 +42,6 @@ ARKodeHAdaptMem arkAdaptInit() /* initialize values (default parameters are set in arkSetDefaults) */ memset(hadapt_mem, 0, sizeof(struct ARKodeHAdaptMemRec)); - hadapt_mem->ehist[0] = ONE; - hadapt_mem->ehist[1] = ONE; - hadapt_mem->hhist[0] = ZERO; - hadapt_mem->hhist[1] = ZERO; hadapt_mem->nst_acc = 0; hadapt_mem->nst_exp = 0; return(hadapt_mem); @@ -67,27 +63,17 @@ void arkPrintAdaptMem(ARKodeHAdaptMem hadapt_mem, FILE *outfile) fprintf(outfile, "ark_hadapt: etamin = %"RSYM"\n", hadapt_mem->etamin); fprintf(outfile, "ark_hadapt: small_nef = %i\n", hadapt_mem->small_nef); fprintf(outfile, "ark_hadapt: etacf = %"RSYM"\n", hadapt_mem->etacf); - fprintf(outfile, "ark_hadapt: imethod = %i\n", hadapt_mem->imethod); - fprintf(outfile, "ark_hadapt: ehist = %"RSYM" %"RSYM"\n", - hadapt_mem->ehist[0], - hadapt_mem->ehist[1]); - fprintf(outfile, "ark_hadapt: hhist = %"RSYM" %"RSYM"\n", - hadapt_mem->hhist[0], - hadapt_mem->hhist[1]); fprintf(outfile, "ark_hadapt: cfl = %"RSYM"\n", hadapt_mem->cfl); fprintf(outfile, "ark_hadapt: safety = %"RSYM"\n", hadapt_mem->safety); - fprintf(outfile, "ark_hadapt: bias = %"RSYM"\n", hadapt_mem->bias); fprintf(outfile, "ark_hadapt: growth = %"RSYM"\n", hadapt_mem->growth); fprintf(outfile, "ark_hadapt: lbound = %"RSYM"\n", hadapt_mem->lbound); fprintf(outfile, "ark_hadapt: ubound = %"RSYM"\n", hadapt_mem->ubound); - fprintf(outfile, "ark_hadapt: k1 = %"RSYM"\n", hadapt_mem->k1); - fprintf(outfile, "ark_hadapt: k2 = %"RSYM"\n", hadapt_mem->k2); - fprintf(outfile, "ark_hadapt: k3 = %"RSYM"\n", hadapt_mem->k3); - fprintf(outfile, "ark_hadapt: q = %i\n", hadapt_mem->q); - fprintf(outfile, "ark_hadapt: p = %i\n", hadapt_mem->p); - fprintf(outfile, "ark_hadapt: pq = %i\n", hadapt_mem->pq); fprintf(outfile, "ark_hadapt: nst_acc = %li\n", hadapt_mem->nst_acc); fprintf(outfile, "ark_hadapt: nst_exp = %li\n", hadapt_mem->nst_exp); + fprintf(outfile, "ark_hadapt: pq = %i\n", hadapt_mem->pq); + fprintf(outfile, "ark_hadapt: p = %i\n", hadapt_mem->p); + fprintf(outfile, "ark_hadapt: q = %i\n", hadapt_mem->q); + fprintf(outfile, "ark_hadapt: adjust = %i\n", hadapt_mem->adjust); if (hadapt_mem->expstab == arkExpStab) { fprintf(outfile, " ark_hadapt: Default explicit stability function\n"); } else { @@ -95,6 +81,7 @@ void arkPrintAdaptMem(ARKodeHAdaptMem hadapt_mem, FILE *outfile) fprintf(outfile, " ark_hadapt: stability function data pointer = %p\n", hadapt_mem->estab_data); } + (void) SUNAdaptController_Write(hadapt_mem->hcontroller, outfile); } } @@ -110,9 +97,10 @@ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, N_Vector ycur, realtype tcur, realtype hcur, realtype dsm, long int nst) { - int ier, k; - realtype ecur, h_acc, h_cfl, int_dir; + int retval; + realtype h_acc, h_cfl, int_dir; ARKodeMem ark_mem; + int controller_order; if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, "ARKODE", "arkAdapt", MSG_ARK_NO_MEM); @@ -120,80 +108,35 @@ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, } ark_mem = (ARKodeMem) arkode_mem; - /* Current error with bias factor */ - ecur = hadapt_mem->bias * dsm; - - /* Set k as either p or q, based on pq flag */ - k = (hadapt_mem->pq) ? hadapt_mem->q : hadapt_mem->p; - - /* Call algorithm-specific error adaptivity method */ - switch (hadapt_mem->imethod) { - case(ARK_ADAPT_PID): /* PID controller */ - ier = arkAdaptPID(hadapt_mem, k, hcur, ecur, &h_acc); - break; - case(ARK_ADAPT_PI): /* PI controller */ - ier = arkAdaptPI(hadapt_mem, k, hcur, ecur, &h_acc); - break; - case(ARK_ADAPT_I): /* I controller */ - ier = arkAdaptI(hadapt_mem, k, hcur, ecur, &h_acc); - break; - case(ARK_ADAPT_EXP_GUS): /* explicit Gustafsson controller */ - ier = arkAdaptExpGus(hadapt_mem, k, nst, hcur, ecur, &h_acc); - break; - case(ARK_ADAPT_IMP_GUS): /* implicit Gustafsson controller */ - ier = arkAdaptImpGus(hadapt_mem, k, nst, hcur, ecur, &h_acc); - break; - case(ARK_ADAPT_IMEX_GUS): /* imex Gustafsson controller */ - ier = arkAdaptImExGus(hadapt_mem, k, nst, hcur, ecur, &h_acc); - break; - case(ARK_ADAPT_CUSTOM): /* user-supplied controller */ - ier = hadapt_mem->HAdapt(ycur, tcur, hcur, hadapt_mem->hhist[0], - hadapt_mem->hhist[1], ecur, - hadapt_mem->ehist[0], - hadapt_mem->ehist[1], - hadapt_mem->q, hadapt_mem->p, - &h_acc, hadapt_mem->HAdapt_data); - break; - default: - arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE", "arkAdapt", - "Illegal imethod."); - return (ARK_ILL_INPUT); + /* Request error-based step size from adaptivity controller */ + if (hadapt_mem->pq == 0) { + controller_order = hadapt_mem->p + hadapt_mem->adjust; + } else if (hadapt_mem->pq == 1) { + controller_order = hadapt_mem->q + hadapt_mem->adjust; + } else { + controller_order = SUNMIN(hadapt_mem->p, hadapt_mem->q) + hadapt_mem->adjust; } - if (ier != ARK_SUCCESS) { - arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE", "arkAdapt", - "Error in accuracy-based adaptivity function."); - return (ARK_ILL_INPUT); + retval = SUNAdaptController_EstimateStep(hadapt_mem->hcontroller, hcur, + controller_order, dsm, &h_acc); + if (retval != SUNADAPTCONTROLLER_SUCCESS) { + arkProcessError(ark_mem, ARK_CONTROLLER_ERR, "ARKODE", "arkAdapt", + "SUNAdaptController_EstimateStep failure."); + return (ARK_CONTROLLER_ERR); } /* determine direction of integration */ int_dir = hcur / SUNRabs(hcur); /* Call explicit stability function */ - ier = hadapt_mem->expstab(ycur, tcur, &h_cfl, hadapt_mem->estab_data); - if (ier != ARK_SUCCESS) { + retval = hadapt_mem->expstab(ycur, tcur, &h_cfl, hadapt_mem->estab_data); + if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE", "arkAdapt", "Error in explicit stability function."); return (ARK_ILL_INPUT); } if (h_cfl <= ZERO) h_cfl = RCONST(1.0e30) * SUNRabs(hcur); - /* Solver diagnostics reporting */ - if (ark_mem->report) - fprintf(ark_mem->diagfp, "ARKadapt adapt %"RSYM" %"RSYM" %"RSYM" %"RSYM" %"RSYM" %"RSYM" %"RSYM" %"RSYM" ", - ecur, hadapt_mem->ehist[0], hadapt_mem->ehist[1], - hcur, hadapt_mem->hhist[0], hadapt_mem->hhist[1], h_acc, h_cfl); - #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, - "ARKODE::arkAdapt", "error-history", - "ecur = %"RSYM", ehist[0] = %"RSYM", ehist[0] = %"RSYM, - ecur, hadapt_mem->ehist[0], hadapt_mem->ehist[1]); - - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, - "ARKODE::arkAdapt", "step-history", - "hcur = %"RSYM", hhist[0] = %"RSYM", hhist[0] = %"RSYM, - hcur, hadapt_mem->hhist[0], hadapt_mem->hhist[1]); - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, "ARKODE::arkAdapt", "new-step-before-bounds", "h_acc = %"RSYM", h_cfl = %"RSYM, h_acc, h_cfl); @@ -253,178 +196,9 @@ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, "new-step-eta", "eta = %"RSYM, ark_mem->eta); #endif - return(ier); -} - - -/*--------------------------------------------------------------- - arkAdaptPID implements a PID time step control algorithm. - ---------------------------------------------------------------*/ -int arkAdaptPID(ARKodeHAdaptMem hadapt_mem, int k, realtype hcur, - realtype ecur, realtype *hnew) -{ - realtype k1, k2, k3, e1, e2, e3, h_acc; - - /* set usable time-step adaptivity parameters */ - k1 = -hadapt_mem->k1 / k; - k2 = hadapt_mem->k2 / k; - k3 = -hadapt_mem->k3 / k; - e1 = SUNMAX(ecur, TINY); - e2 = SUNMAX(hadapt_mem->ehist[0], TINY); - e3 = SUNMAX(hadapt_mem->ehist[1], TINY); - - /* compute estimated optimal time step size, set into output */ - h_acc = hcur * SUNRpowerR(e1,k1) * SUNRpowerR(e2,k2) * SUNRpowerR(e3,k3); - *hnew = h_acc; - - return(ARK_SUCCESS); -} - - -/*--------------------------------------------------------------- - arkAdaptPI implements a PI time step control algorithm. - ---------------------------------------------------------------*/ -int arkAdaptPI(ARKodeHAdaptMem hadapt_mem, int k, realtype hcur, - realtype ecur, realtype *hnew) -{ - realtype k1, k2, e1, e2, h_acc; - - /* set usable time-step adaptivity parameters */ - k1 = -hadapt_mem->k1 / k; - k2 = hadapt_mem->k2 / k; - e1 = SUNMAX(ecur, TINY); - e2 = SUNMAX(hadapt_mem->ehist[0], TINY); - - /* compute estimated optimal time step size, set into output */ - h_acc = hcur * SUNRpowerR(e1,k1) * SUNRpowerR(e2,k2); - *hnew = h_acc; - - return(ARK_SUCCESS); -} - - -/*--------------------------------------------------------------- - arkAdaptI implements an I time step control algorithm. - ---------------------------------------------------------------*/ -int arkAdaptI(ARKodeHAdaptMem hadapt_mem, int k, realtype hcur, - realtype ecur, realtype *hnew) -{ - realtype k1, e1, h_acc; - - /* set usable time-step adaptivity parameters */ - k1 = -hadapt_mem->k1 / k; - e1 = SUNMAX(ecur, TINY); - - /* compute estimated optimal time step size, set into output */ - h_acc = hcur * SUNRpowerR(e1,k1); - *hnew = h_acc; - - return(ARK_SUCCESS); -} - - -/*--------------------------------------------------------------- - arkAdaptExpGus implements the explicit Gustafsson time step - control algorithm. - ---------------------------------------------------------------*/ -int arkAdaptExpGus(ARKodeHAdaptMem hadapt_mem, int k, long int nst, - realtype hcur, realtype ecur, realtype *hnew) -{ - realtype k1, k2, e1, e2, h_acc; - - /* modified method for first step */ - if (nst < 2) { - - k1 = -ONE / k; - e1 = SUNMAX(ecur, TINY); - h_acc = hcur * SUNRpowerR(e1,k1); - - /* general estimate */ - } else { - - k1 = -hadapt_mem->k1 / k; - k2 = -hadapt_mem->k2 / k; - e1 = SUNMAX(ecur, TINY); - e2 = e1 / SUNMAX(hadapt_mem->ehist[0], TINY); - h_acc = hcur * SUNRpowerR(e1,k1) * SUNRpowerR(e2,k2); - - } - *hnew = h_acc; - - return(ARK_SUCCESS); -} - - -/*--------------------------------------------------------------- - arkAdaptImpGus implements the implicit Gustafsson time step - control algorithm. - ---------------------------------------------------------------*/ -int arkAdaptImpGus(ARKodeHAdaptMem hadapt_mem, int k, long int nst, - realtype hcur, realtype ecur, realtype *hnew) -{ - realtype k1, k2, e1, e2, hrat, h_acc; - - /* modified method for first step */ - if (nst < 2) { - - k1 = -ONE / k; - e1 = SUNMAX(ecur, TINY); - h_acc = hcur * SUNRpowerR(e1,k1); - - /* general estimate */ - } else { - - k1 = -hadapt_mem->k1 / k; - k2 = -hadapt_mem->k2 / k; - e1 = SUNMAX(ecur, TINY); - e2 = e1 / SUNMAX(hadapt_mem->ehist[0], TINY); - hrat = hcur / hadapt_mem->hhist[0]; - h_acc = hcur * hrat * SUNRpowerR(e1,k1) * SUNRpowerR(e2,k2); - - } - *hnew = h_acc; - - return(ARK_SUCCESS); -} - - -/*--------------------------------------------------------------- - arkAdaptImExGus implements a combination implicit/explicit - Gustafsson time step control algorithm. - ---------------------------------------------------------------*/ -int arkAdaptImExGus(ARKodeHAdaptMem hadapt_mem, int k, long int nst, - realtype hcur, realtype ecur, realtype *hnew) -{ - realtype k1, k2, k3, e1, e2, hrat, h_acc; - - /* modified method for first step */ - if (nst < 2) { - - k1 = -ONE / k; - e1 = SUNMAX(ecur, TINY); - h_acc = hcur * SUNRpowerR(e1,k1); - - /* general estimate */ - } else { - - k1 = -hadapt_mem->k1 / k; - k2 = -hadapt_mem->k2 / k; - k3 = -hadapt_mem->k3 / k; - e1 = SUNMAX(ecur, TINY); - e2 = e1 / SUNMAX(hadapt_mem->ehist[0], TINY); - hrat = hcur / hadapt_mem->hhist[0]; - /* implicit estimate */ - h_acc = hcur * hrat * SUNRpowerR(e1,k3) * SUNRpowerR(e2,k3); - /* explicit estimate */ - h_acc = SUNMIN(h_acc, hcur * SUNRpowerR(e1,k1) * SUNRpowerR(e2,k2)); - - } - *hnew = h_acc; - - return(ARK_SUCCESS); + return(retval); } - /*=============================================================== EOF ===============================================================*/ diff --git a/src/arkode/arkode_adapt_impl.h b/src/arkode/arkode_adapt_impl.h index 5cdd3d2e58..53303dcb21 100644 --- a/src/arkode/arkode_adapt_impl.h +++ b/src/arkode/arkode_adapt_impl.h @@ -20,6 +20,7 @@ #include #include +#include #ifdef __cplusplus /* wrapper to enable C++ usage */ extern "C" { @@ -31,29 +32,15 @@ extern "C" { ===============================================================*/ /* size constants for the adaptivity memory structure */ -#define ARK_ADAPT_LRW 19 -#define ARK_ADAPT_LIW 8 /* includes function/data pointers */ +#define ARK_ADAPT_LRW 10 +#define ARK_ADAPT_LIW 7 /* includes function/data pointers */ /* Time step controller default values */ #define CFLFAC RCONST(0.5) #define SAFETY RCONST(0.96) /* CVODE uses 1.0 */ -#define BIAS RCONST(1.5) /* CVODE uses 6.0 */ #define GROWTH RCONST(20.0) /* CVODE uses 10.0 */ #define HFIXED_LB RCONST(1.0) /* CVODE uses 1.0 */ #define HFIXED_UB RCONST(1.5) /* CVODE uses 1.5 */ -#define AD0_K1 RCONST(0.58) /* PID controller constants */ -#define AD0_K2 RCONST(0.21) -#define AD0_K3 RCONST(0.1) -#define AD1_K1 RCONST(0.8) /* PI controller constants */ -#define AD1_K2 RCONST(0.31) -#define AD2_K1 RCONST(1.0) /* I controller constants */ -#define AD3_K1 RCONST(0.367) /* explicit Gustafsson controller */ -#define AD3_K2 RCONST(0.268) -#define AD4_K1 RCONST(0.98) /* implicit Gustafsson controller */ -#define AD4_K2 RCONST(0.95) -#define AD5_K1 RCONST(0.367) /* imex Gustafsson controller */ -#define AD5_K2 RCONST(0.268) -#define AD5_K3 RCONST(0.95) #define ETAMX1 RCONST(10000.0) /* maximum step size change on first step */ #define ETAMXF RCONST(0.3) /* step size reduction factor on multiple error @@ -64,6 +51,11 @@ extern "C" { convergence failure */ #define SMALL_NEF 2 /* if an error failure occurs and SMALL_NEF <= nef, then reset eta = MIN(eta, ETAMXF) */ +#define PQ 0 /* order to use for controller: 0=embedding, + 1=method, otherwise min(method,embedding) + REMOVE AT SAME TIME AS ARKStepSetAdaptivityMethod */ +#define ADJUST -1 /* adjustment to apply within controller to method + order of accuracy */ /*=============================================================== @@ -85,30 +77,18 @@ typedef struct ARKodeHAdaptMemRec { realtype etamin; /* eta >= etamin on error test fail */ int small_nef; /* bound to determine 'multiple' above */ realtype etacf; /* h reduction factor on nonlinear conv fail */ - ARKAdaptFn HAdapt; /* function to set the new time step size */ - void *HAdapt_data; /* user pointer passed to hadapt */ - realtype ehist[2]; /* error history for time adaptivity */ - realtype hhist[2]; /* step history for time adaptivity */ - int imethod; /* step adaptivity method to use: - -1 -> User-specified function above - 0 -> PID controller - 1 -> PI controller - 2 -> I controller - 3 -> explicit Gustafsson controller - 4 -> implicit Gustafsson controller - 5 -> imex Gustafsson controller */ realtype cfl; /* cfl safety factor */ realtype safety; /* accuracy safety factor on h */ - realtype bias; /* accuracy safety factor on LTE */ realtype growth; /* maximum step growth safety factor */ realtype lbound; /* eta lower bound to leave h unchanged */ realtype ubound; /* eta upper bound to leave h unchanged */ - realtype k1; /* method-specific adaptivity parameters */ - realtype k2; - realtype k3; - int q; /* method order */ - int p; /* embedding order */ - booleantype pq; /* choice of using p (0) vs q (1) */ + int p; /* embedding order */ + int q; /* method order */ + int pq; /* decision flag for controller order */ + int adjust; /* controller order adjustment factor */ + + SUNAdaptController hcontroller; /* temporal error controller */ + booleantype owncontroller; /* flag indicating hcontroller ownership */ ARKExpStabFn expstab; /* step stability function */ void *estab_data; /* user pointer passed to expstab */ @@ -128,18 +108,6 @@ void arkPrintAdaptMem(ARKodeHAdaptMem hadapt_mem, FILE *outfile); int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, N_Vector ycur, realtype tcur, realtype hcur, realtype dsm, long int nst); -int arkAdaptPID(ARKodeHAdaptMem hadapt_mem, int k, - realtype hcur, realtype ecur, realtype *hnew); -int arkAdaptPI(ARKodeHAdaptMem hadapt_mem, int k, - realtype hcur, realtype ecur, realtype *hnew); -int arkAdaptI(ARKodeHAdaptMem hadapt_mem, int k, - realtype hcur, realtype ecur, realtype *hnew); -int arkAdaptExpGus(ARKodeHAdaptMem hadapt_mem, int k, long int nst, - realtype hcur, realtype ecur, realtype *hnew); -int arkAdaptImpGus(ARKodeHAdaptMem hadapt_mem, int k, long int nst, - realtype hcur, realtype ecur, realtype *hnew); -int arkAdaptImExGus(ARKodeHAdaptMem hadapt_mem, int k, long int nst, - realtype hcur, realtype ecur, realtype *hnew); #ifdef __cplusplus diff --git a/src/arkode/arkode_arkstep_io.c b/src/arkode/arkode_arkstep_io.c index 1151afd1bc..5925b29582 100644 --- a/src/arkode/arkode_arkstep_io.c +++ b/src/arkode/arkode_arkstep_io.c @@ -77,23 +77,18 @@ int ARKStepSetPostprocessStepFn(void *arkode_mem, int ARKStepSetPostprocessStageFn(void *arkode_mem, ARKPostProcessFn ProcessStage) { return(arkSetPostprocessStageFn(arkode_mem, ProcessStage)); } +int ARKStepSetAdaptivityAdjustment(void *arkode_mem, int adjust) { + return(arkSetAdaptivityAdjustment(arkode_mem, adjust)); } int ARKStepSetCFLFraction(void *arkode_mem, realtype cfl_frac) { return(arkSetCFLFraction(arkode_mem, cfl_frac)); } int ARKStepSetSafetyFactor(void *arkode_mem, realtype safety) { return(arkSetSafetyFactor(arkode_mem, safety)); } -int ARKStepSetErrorBias(void *arkode_mem, realtype bias) { - return(arkSetErrorBias(arkode_mem, bias)); } int ARKStepSetMaxGrowth(void *arkode_mem, realtype mx_growth) { return(arkSetMaxGrowth(arkode_mem, mx_growth)); } int ARKStepSetMinReduction(void *arkode_mem, realtype eta_min) { return(arkSetMinReduction(arkode_mem, eta_min)); } int ARKStepSetFixedStepBounds(void *arkode_mem, realtype lb, realtype ub) { return(arkSetFixedStepBounds(arkode_mem, lb, ub)); } -int ARKStepSetAdaptivityMethod(void *arkode_mem, int imethod, int idefault, - int pq, realtype adapt_params[3]) { - return(arkSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params)); } -int ARKStepSetAdaptivityFn(void *arkode_mem, ARKAdaptFn hfun, void *h_data) { - return(arkSetAdaptivityFn(arkode_mem, hfun, h_data)); } int ARKStepSetMaxFirstGrowth(void *arkode_mem, realtype etamx1) { return(arkSetMaxFirstGrowth(arkode_mem, etamx1)); } int ARKStepSetMaxEFailGrowth(void *arkode_mem, realtype etamxf) { @@ -108,6 +103,8 @@ int ARKStepSetMaxErrTestFails(void *arkode_mem, int maxnef) { return(arkSetMaxErrTestFails(arkode_mem, maxnef)); } int ARKStepSetMaxConvFails(void *arkode_mem, int maxncf) { return(arkSetMaxConvFails(arkode_mem, maxncf)); } +int ARKStepSetAdaptController(void *arkode_mem, SUNAdaptController C) { + return(arkSetAdaptController(arkode_mem, C)); } int ARKStepSetFixedStep(void *arkode_mem, realtype hfixed) { return(arkSetFixedStep(arkode_mem, hfixed)); } @@ -343,6 +340,35 @@ int ARKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters) return arkRelaxGetNumRelaxSolveIters(arkode_mem, iters); } + + +/*=============================================================== + DEPRECATED ARKStep optional input/output functions + ===============================================================*/ + +/*--------------------------------------------------------------- + ARKStepSetAdaptivityMethod: user should create/attach a + specific SUNAdaptController object. + ---------------------------------------------------------------*/ +int ARKStepSetAdaptivityMethod(void *arkode_mem, int imethod, int idefault, + int pq, realtype adapt_params[3]) { + return(arkSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params)); } + +/*--------------------------------------------------------------- + ARKStepSetAdaptivityFn: user should create/attach a custom + SUNAdaptController object. + ---------------------------------------------------------------*/ +int ARKStepSetAdaptivityFn(void *arkode_mem, ARKAdaptFn hfun, void *h_data) { + return(arkSetAdaptivityFn(arkode_mem, hfun, h_data)); } + +/*--------------------------------------------------------------- + ARKStepSetErrorBias: user should set this value directly in the + SUNAdaptController object. + ---------------------------------------------------------------*/ +int ARKStepSetErrorBias(void *arkode_mem, realtype bias) { + return(arkSetErrorBias(arkode_mem, bias)); } + + /*=============================================================== ARKStep optional input functions -- stepper-specific ===============================================================*/ @@ -456,6 +482,7 @@ int ARKStepSetOptimalParams(void *arkode_mem) ARKodeARKStepMem step_mem; ARKodeHAdaptMem hadapt_mem; int retval; + long int lenrw, leniw; /* access ARKodeARKStepMem structure */ retval = arkStep_AccessStepMem(arkode_mem, "ARKStepSetOptimalParams", @@ -471,29 +498,59 @@ int ARKStepSetOptimalParams(void *arkode_mem) } hadapt_mem = ark_mem->hadapt_mem; + /* Remove current SUNAdaptController object */ + retval = SUNAdaptController_Space(hadapt_mem->hcontroller, &lenrw, &leniw); + if (retval == SUNADAPTCONTROLLER_SUCCESS) { + ark_mem->liw -= leniw; + ark_mem->lrw -= lenrw; + } + if (hadapt_mem->owncontroller) { + retval = SUNAdaptController_Destroy(hadapt_mem->hcontroller); + ark_mem->hadapt_mem->owncontroller = SUNFALSE; + if (retval != SUNADAPTCONTROLLER_SUCCESS) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", "ARKStepSetOptimalParams", + "SUNAdaptController_Destroy failure"); + return(ARK_MEM_FAIL); + } + } + hadapt_mem->hcontroller = NULL; + /* Choose values based on method, order */ /* explicit */ if (step_mem->explicit && !step_mem->implicit) { - hadapt_mem->imethod = ARK_ADAPT_PI; - hadapt_mem->safety = RCONST(0.99); - hadapt_mem->bias = RCONST(1.2); - hadapt_mem->growth = RCONST(25.0); - hadapt_mem->k1 = RCONST(0.8); - hadapt_mem->k2 = RCONST(0.31); - hadapt_mem->etamxf = RCONST(0.3); + hadapt_mem->hcontroller = SUNAdaptController_PI(ark_mem->sunctx); + if (hadapt_mem->hcontroller == NULL) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE::ARKStep", + "ARKStepSetOptimalParams", + "SUNAdaptController_PI allocation failure"); + return(ARK_MEM_FAIL); + } + (void) SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, RCONST(1.2)); + (void) SUNAdaptController_SetParams_PI(hadapt_mem->hcontroller, RCONST(0.8), + -RCONST(0.31)); + hadapt_mem->safety = RCONST(0.99); + hadapt_mem->growth = RCONST(25.0); + hadapt_mem->etamxf = RCONST(0.3); + hadapt_mem->pq = PQ; /* implicit */ } else if (step_mem->implicit && !step_mem->explicit) { switch (step_mem->q) { case 2: /* just use standard defaults since better ones unknown */ - hadapt_mem->imethod = ARK_ADAPT_PID; + hadapt_mem->hcontroller = SUNAdaptController_PID(ark_mem->sunctx); + if (hadapt_mem->hcontroller == NULL) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE::ARKStep", + "ARKStepSetOptimalParams", + "SUNAdaptController_PID allocation failure"); + return(ARK_MEM_FAIL); + } hadapt_mem->safety = SAFETY; - hadapt_mem->bias = BIAS; hadapt_mem->growth = GROWTH; hadapt_mem->etamxf = ETAMXF; hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; + hadapt_mem->pq = PQ; step_mem->nlscoef = RCONST(0.001); step_mem->maxcor = 5; step_mem->crdown = CRDOWN; @@ -502,13 +559,20 @@ int ARKStepSetOptimalParams(void *arkode_mem) step_mem->msbp = MSBP; break; case 3: - hadapt_mem->imethod = ARK_ADAPT_I; + hadapt_mem->hcontroller = SUNAdaptController_I(ark_mem->sunctx); + if (hadapt_mem->hcontroller == NULL) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE::ARKStep", + "ARKStepSetOptimalParams", + "SUNAdaptController_I allocation failure"); + return(ARK_MEM_FAIL); + } + (void) SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, RCONST(1.9)); hadapt_mem->safety = RCONST(0.957); - hadapt_mem->bias = RCONST(1.9); hadapt_mem->growth = RCONST(17.6); hadapt_mem->etamxf = RCONST(0.45); hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; + hadapt_mem->pq = PQ; step_mem->nlscoef = RCONST(0.22); step_mem->crdown = RCONST(0.17); step_mem->rdiv = RCONST(2.3); @@ -516,16 +580,22 @@ int ARKStepSetOptimalParams(void *arkode_mem) step_mem->msbp = 60; break; case 4: - hadapt_mem->imethod = ARK_ADAPT_PID; + hadapt_mem->hcontroller = SUNAdaptController_PID(ark_mem->sunctx); + if (hadapt_mem->hcontroller == NULL) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE::ARKStep", + "ARKStepSetOptimalParams", + "SUNAdaptController_PID allocation failure"); + return(ARK_MEM_FAIL); + } + (void) SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, RCONST(1.2)); + (void) SUNAdaptController_SetParams_PID(hadapt_mem->hcontroller, RCONST(0.535), + -RCONST(0.209), RCONST(0.148)); hadapt_mem->safety = RCONST(0.988); - hadapt_mem->bias = RCONST(1.2); hadapt_mem->growth = RCONST(31.5); - hadapt_mem->k1 = RCONST(0.535); - hadapt_mem->k2 = RCONST(0.209); - hadapt_mem->k3 = RCONST(0.148); hadapt_mem->etamxf = RCONST(0.33); hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; + hadapt_mem->pq = PQ; step_mem->nlscoef = RCONST(0.24); step_mem->crdown = RCONST(0.26); step_mem->rdiv = RCONST(2.3); @@ -533,16 +603,22 @@ int ARKStepSetOptimalParams(void *arkode_mem) step_mem->msbp = 31; break; case 5: - hadapt_mem->imethod = ARK_ADAPT_PID; + hadapt_mem->hcontroller = SUNAdaptController_PID(ark_mem->sunctx); + if (hadapt_mem->hcontroller == NULL) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE::ARKStep", + "ARKStepSetOptimalParams", + "SUNAdaptController_PID allocation failure"); + return(ARK_MEM_FAIL); + } + (void) SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, RCONST(3.3)); + (void) SUNAdaptController_SetParams_PID(hadapt_mem->hcontroller, RCONST(0.56), + -RCONST(0.338), RCONST(0.14)); hadapt_mem->safety = RCONST(0.937); - hadapt_mem->bias = RCONST(3.3); hadapt_mem->growth = RCONST(22.0); - hadapt_mem->k1 = RCONST(0.56); - hadapt_mem->k2 = RCONST(0.338); - hadapt_mem->k3 = RCONST(0.14); hadapt_mem->etamxf = RCONST(0.44); hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; + hadapt_mem->pq = PQ; step_mem->nlscoef = RCONST(0.25); step_mem->crdown = RCONST(0.4); step_mem->rdiv = RCONST(2.3); @@ -554,17 +630,44 @@ int ARKStepSetOptimalParams(void *arkode_mem) /* imex */ } else { switch (step_mem->q) { + case 2: /* just use standard defaults since better ones unknown */ + hadapt_mem->hcontroller = SUNAdaptController_PID(ark_mem->sunctx); + if (hadapt_mem->hcontroller == NULL) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE::ARKStep", + "ARKStepSetOptimalParams", + "SUNAdaptController_PID allocation failure"); + return(ARK_MEM_FAIL); + } + hadapt_mem->safety = SAFETY; + hadapt_mem->growth = GROWTH; + hadapt_mem->etamxf = ETAMXF; + hadapt_mem->small_nef = SMALL_NEF; + hadapt_mem->etacf = ETACF; + hadapt_mem->pq = PQ; + step_mem->nlscoef = RCONST(0.001); + step_mem->maxcor = 5; + step_mem->crdown = CRDOWN; + step_mem->rdiv = RDIV; + step_mem->dgmax = DGMAX; + step_mem->msbp = MSBP; + break; case 3: - hadapt_mem->imethod = ARK_ADAPT_PID; + hadapt_mem->hcontroller = SUNAdaptController_PID(ark_mem->sunctx); + if (hadapt_mem->hcontroller == NULL) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE::ARKStep", + "ARKStepSetOptimalParams", + "SUNAdaptController_PID allocation failure"); + return(ARK_MEM_FAIL); + } + (void) SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, RCONST(1.42)); + (void) SUNAdaptController_SetParams_PID(hadapt_mem->hcontroller, RCONST(0.54), + -RCONST(0.36), RCONST(0.14)); hadapt_mem->safety = RCONST(0.965); - hadapt_mem->bias = RCONST(1.42); hadapt_mem->growth = RCONST(28.7); - hadapt_mem->k1 = RCONST(0.54); - hadapt_mem->k2 = RCONST(0.36); - hadapt_mem->k3 = RCONST(0.14); hadapt_mem->etamxf = RCONST(0.46); hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; + hadapt_mem->pq = PQ; step_mem->nlscoef = RCONST(0.22); step_mem->crdown = RCONST(0.17); step_mem->rdiv = RCONST(2.3); @@ -572,16 +675,22 @@ int ARKStepSetOptimalParams(void *arkode_mem) step_mem->msbp = 60; break; case 4: - hadapt_mem->imethod = ARK_ADAPT_PID; + hadapt_mem->hcontroller = SUNAdaptController_PID(ark_mem->sunctx); + if (hadapt_mem->hcontroller == NULL) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE::ARKStep", + "ARKStepSetOptimalParams", + "SUNAdaptController_PID allocation failure"); + return(ARK_MEM_FAIL); + } + (void) SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, RCONST(1.35)); + (void) SUNAdaptController_SetParams_PID(hadapt_mem->hcontroller, RCONST(0.543), + -RCONST(0.297), RCONST(0.14)); hadapt_mem->safety = RCONST(0.97); - hadapt_mem->bias = RCONST(1.35); hadapt_mem->growth = RCONST(25.0); - hadapt_mem->k1 = RCONST(0.543); - hadapt_mem->k2 = RCONST(0.297); - hadapt_mem->k3 = RCONST(0.14); hadapt_mem->etamxf = RCONST(0.47); hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; + hadapt_mem->pq = PQ; step_mem->nlscoef = RCONST(0.24); step_mem->crdown = RCONST(0.26); step_mem->rdiv = RCONST(2.3); @@ -589,15 +698,22 @@ int ARKStepSetOptimalParams(void *arkode_mem) step_mem->msbp = 31; break; case 5: - hadapt_mem->imethod = ARK_ADAPT_PI; + hadapt_mem->hcontroller = SUNAdaptController_PI(ark_mem->sunctx); + if (hadapt_mem->hcontroller == NULL) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE::ARKStep", + "ARKStepSetOptimalParams", + "SUNAdaptController_PI allocation failure"); + return(ARK_MEM_FAIL); + } + (void) SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, RCONST(1.15)); + (void) SUNAdaptController_SetParams_PI(hadapt_mem->hcontroller, RCONST(0.8), + -RCONST(0.35)); hadapt_mem->safety = RCONST(0.993); - hadapt_mem->bias = RCONST(1.15); hadapt_mem->growth = RCONST(28.5); - hadapt_mem->k1 = RCONST(0.8); - hadapt_mem->k2 = RCONST(0.35); hadapt_mem->etamxf = RCONST(0.3); hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; + hadapt_mem->pq = PQ; step_mem->nlscoef = RCONST(0.25); step_mem->crdown = RCONST(0.4); step_mem->rdiv = RCONST(2.3); @@ -605,6 +721,13 @@ int ARKStepSetOptimalParams(void *arkode_mem) step_mem->msbp = 31; break; } + hadapt_mem->owncontroller = SUNTRUE; + + retval = SUNAdaptController_Space(hadapt_mem->hcontroller, &lenrw, &leniw); + if (retval == SUNADAPTCONTROLLER_SUCCESS) { + ark_mem->liw += leniw; + ark_mem->lrw += lenrw; + } } return(ARK_SUCCESS); diff --git a/src/arkode/arkode_erkstep_io.c b/src/arkode/arkode_erkstep_io.c index 15845101cc..bfdf929f3e 100644 --- a/src/arkode/arkode_erkstep_io.c +++ b/src/arkode/arkode_erkstep_io.c @@ -78,23 +78,18 @@ int ERKStepSetPostprocessStepFn(void *arkode_mem, int ERKStepSetPostprocessStageFn(void *arkode_mem, ARKPostProcessFn ProcessStage) { return(arkSetPostprocessStageFn(arkode_mem, ProcessStage)); } +int ERKStepSetAdaptivityAdjustment(void *arkode_mem, int adjust) { + return(arkSetAdaptivityAdjustment(arkode_mem, adjust)); } int ERKStepSetCFLFraction(void *arkode_mem, realtype cfl_frac) { return(arkSetCFLFraction(arkode_mem, cfl_frac)); } int ERKStepSetSafetyFactor(void *arkode_mem, realtype safety) { return(arkSetSafetyFactor(arkode_mem, safety)); } -int ERKStepSetErrorBias(void *arkode_mem, realtype bias) { - return(arkSetErrorBias(arkode_mem, bias)); } int ERKStepSetMaxGrowth(void *arkode_mem, realtype mx_growth) { return(arkSetMaxGrowth(arkode_mem, mx_growth)); } int ERKStepSetMinReduction(void *arkode_mem, realtype eta_min) { return(arkSetMinReduction(arkode_mem, eta_min)); } int ERKStepSetFixedStepBounds(void *arkode_mem, realtype lb, realtype ub) { return(arkSetFixedStepBounds(arkode_mem, lb, ub)); } -int ERKStepSetAdaptivityMethod(void *arkode_mem, int imethod, int idefault, - int pq, realtype adapt_params[3]) { - return(arkSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params)); } -int ERKStepSetAdaptivityFn(void *arkode_mem, ARKAdaptFn hfun, void *h_data) { - return(arkSetAdaptivityFn(arkode_mem, hfun, h_data)); } int ERKStepSetMaxFirstGrowth(void *arkode_mem, realtype etamx1) { return(arkSetMaxFirstGrowth(arkode_mem, etamx1)); } int ERKStepSetMaxEFailGrowth(void *arkode_mem, realtype etamxf) { @@ -107,6 +102,8 @@ int ERKStepSetMaxErrTestFails(void *arkode_mem, int maxnef) { return(arkSetMaxErrTestFails(arkode_mem, maxnef)); } int ERKStepSetFixedStep(void *arkode_mem, realtype hfixed) { return(arkSetFixedStep(arkode_mem, hfixed)); } +int ERKStepSetAdaptController(void *arkode_mem, SUNAdaptController C) { + return(arkSetAdaptController(arkode_mem, C)); } /*=============================================================== @@ -234,6 +231,34 @@ int ERKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters) return arkRelaxGetNumRelaxSolveIters(arkode_mem, iters); } + +/*=============================================================== + DEPRECATED ERKStep optional input/output functions + ===============================================================*/ + +/*--------------------------------------------------------------- + ERKStepSetAdaptivityMethod: user should create/attach a + specific SUNAdaptController object. + ---------------------------------------------------------------*/ +int ERKStepSetAdaptivityMethod(void *arkode_mem, int imethod, int idefault, + int pq, realtype adapt_params[3]) { + return(arkSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params)); } + +/*--------------------------------------------------------------- + ERKStepSetAdaptivityFn: user should create/attach a custom + SUNAdaptController object. + ---------------------------------------------------------------*/ +int ERKStepSetAdaptivityFn(void *arkode_mem, ARKAdaptFn hfun, void *h_data) { + return(arkSetAdaptivityFn(arkode_mem, hfun, h_data)); } + +/*--------------------------------------------------------------- + ERKStepSetErrorBias: user should set this value directly in the + SUNAdaptController object. + ---------------------------------------------------------------*/ +int ERKStepSetErrorBias(void *arkode_mem, realtype bias) { + return(arkSetErrorBias(arkode_mem, bias)); } + + /*=============================================================== ERKStep optional input functions -- stepper-specific ===============================================================*/ @@ -250,6 +275,7 @@ int ERKStepSetDefaults(void* arkode_mem) ARKodeMem ark_mem; ARKodeERKStepMem step_mem; int retval; + long int lenrw, leniw; /* access ARKodeERKStepMem structure */ retval = erkStep_AccessStepMem(arkode_mem, "ERKStepSetDefaults", @@ -265,19 +291,48 @@ int ERKStepSetDefaults(void* arkode_mem) return(retval); } + /* Remove current SUNAdaptController object, and replace with "PI" */ + retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, &leniw); + if (retval == SUNADAPTCONTROLLER_SUCCESS) { + ark_mem->liw -= leniw; + ark_mem->lrw -= lenrw; + } + if (ark_mem->hadapt_mem->owncontroller) { + retval = SUNAdaptController_Destroy(ark_mem->hadapt_mem->hcontroller); + ark_mem->hadapt_mem->owncontroller = SUNFALSE; + if (retval != SUNADAPTCONTROLLER_SUCCESS) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", "ERKStepSetDefaults", + "SUNAdaptController_Destroy failure"); + return(ARK_MEM_FAIL); + } + } + ark_mem->hadapt_mem->hcontroller = NULL; + ark_mem->hadapt_mem->hcontroller = SUNAdaptController_PI(ark_mem->sunctx); + if (ark_mem->hadapt_mem->hcontroller == NULL) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE::ERKStep", + "ERKStepSetDefaults", + "SUNAdaptControllerPI allocation failure"); + return(ARK_MEM_FAIL); + } + ark_mem->hadapt_mem->owncontroller = SUNTRUE; + retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, &leniw); + if (retval == SUNADAPTCONTROLLER_SUCCESS) { + ark_mem->liw += leniw; + ark_mem->lrw += lenrw; + } + /* Set default values for integrator optional inputs (overwrite some adaptivity params for ERKStep use) */ step_mem->q = Q_DEFAULT; /* method order */ step_mem->p = 0; /* embedding order */ + step_mem->stages = 0; /* no stages */ + step_mem->B = NULL; /* no Butcher table */ ark_mem->hadapt_mem->etamxf = RCONST(0.3); /* max change on error-failed step */ - ark_mem->hadapt_mem->imethod = ARK_ADAPT_PI; /* PI controller */ ark_mem->hadapt_mem->safety = RCONST(0.99); /* step adaptivity safety factor */ - ark_mem->hadapt_mem->bias = RCONST(1.2); /* step adaptivity error bias */ ark_mem->hadapt_mem->growth = RCONST(25.0); /* step adaptivity growth factor */ - ark_mem->hadapt_mem->k1 = RCONST(0.8); /* step adaptivity parameter */ - ark_mem->hadapt_mem->k2 = RCONST(0.31); /* step adaptivity parameter */ - step_mem->stages = 0; /* no stages */ - step_mem->B = NULL; /* no Butcher table */ + (void) SUNAdaptController_SetErrorBias(ark_mem->hadapt_mem->hcontroller, RCONST(1.2)); + (void) SUNAdaptController_SetParams_PI(ark_mem->hadapt_mem->hcontroller, + RCONST(0.8), -RCONST(0.31)); return(ARK_SUCCESS); } diff --git a/src/arkode/arkode_impl.h b/src/arkode/arkode_impl.h index e4285b6120..6cd8b85c25 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -25,6 +25,7 @@ #include #include #include +#include #include "arkode_types_impl.h" #include "arkode_adapt_impl.h" @@ -999,6 +1000,7 @@ int arkCheckTemporalError(ARKodeMem ark_mem, int *nflagPtr, int *nefPtr, int arkAccessHAdaptMem(void* arkode_mem, const char *fname, ARKodeMem *ark_mem, ARKodeHAdaptMem *hadapt_mem); +int arkSetAdaptController(void *arkode_mem, SUNAdaptController C); int arkSetDefaults(void *arkode_mem); int arkSetDenseOrder(void *arkode_mem, int dord); int arkSetInterpolantType(void *arkode_mem, int itype); @@ -1026,6 +1028,7 @@ int arkSetPostprocessStageFn(void *arkode_mem, ARKPostProcessFn ProcessStage); int arkSetConstraints(void *arkode_mem, N_Vector constraints); int arkSetMaxNumConstrFails(void *arkode_mem, int maxfails); +int arkSetAdaptivityAdjustment(void *arkode_mem, int adjust); int arkSetCFLFraction(void *arkode_mem, realtype cfl_frac); int arkSetSafetyFactor(void *arkode_mem, realtype safety); int arkSetErrorBias(void *arkode_mem, realtype bias); diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index af230fb8e0..cc45123175 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -23,8 +23,11 @@ #include "arkode_impl.h" #include "arkode_interp_impl.h" +#include "arkode_user_controller.h" #include #include +#include +#include /*=============================================================== @@ -51,7 +54,7 @@ int arkSetDefaults(void *arkode_mem) ark_mem = (ARKodeMem) arkode_mem; /* Set default values for integrator optional inputs */ - ark_mem->use_compensated_sums = SUNFALSE; + ark_mem->use_compensated_sums = SUNFALSE; ark_mem->fixedstep = SUNFALSE; /* default to use adaptive steps */ ark_mem->reltol = RCONST(1.e-4); /* relative tolerance */ ark_mem->itol = ARK_SS; /* scalar-scalar solution tolerances */ @@ -90,21 +93,17 @@ int arkSetDefaults(void *arkode_mem) ark_mem->hadapt_mem->etamin = ETAMIN; /* min bound on time step reduction */ ark_mem->hadapt_mem->small_nef = SMALL_NEF; /* num error fails before ETAMXF enforced */ ark_mem->hadapt_mem->etacf = ETACF; /* max change on convergence failure */ - ark_mem->hadapt_mem->HAdapt = NULL; /* step adaptivity fn */ - ark_mem->hadapt_mem->HAdapt_data = NULL; /* step adaptivity data */ - ark_mem->hadapt_mem->imethod = ARK_ADAPT_PID; /* PID controller */ ark_mem->hadapt_mem->cfl = CFLFAC; /* explicit stability factor */ ark_mem->hadapt_mem->safety = SAFETY; /* step adaptivity safety factor */ - ark_mem->hadapt_mem->bias = BIAS; /* step adaptivity error bias */ ark_mem->hadapt_mem->growth = GROWTH; /* step adaptivity growth factor */ ark_mem->hadapt_mem->lbound = HFIXED_LB; /* step adaptivity no-change lower bound */ ark_mem->hadapt_mem->ubound = HFIXED_UB; /* step adaptivity no-change upper bound */ - ark_mem->hadapt_mem->k1 = AD0_K1; /* step adaptivity parameter */ - ark_mem->hadapt_mem->k2 = AD0_K2; /* step adaptivity parameter */ - ark_mem->hadapt_mem->k3 = AD0_K3; /* step adaptivity parameter */ - ark_mem->hadapt_mem->pq = SUNFALSE; /* use embedding order */ ark_mem->hadapt_mem->expstab = arkExpStab; /* internal explicit stability fn */ ark_mem->hadapt_mem->estab_data = NULL; /* no explicit stability fn data */ + ark_mem->hadapt_mem->pq = PQ; /* embedding order */ + ark_mem->hadapt_mem->p = 0; /* no default embedding order */ + ark_mem->hadapt_mem->q = 0; /* no default method order */ + ark_mem->hadapt_mem->adjust = ADJUST; /* controller order adjustment */ return(ARK_SUCCESS); } @@ -337,6 +336,67 @@ int arkSetDiagnostics(void *arkode_mem, FILE *diagfp) } +/*--------------------------------------------------------------- + arkSetAdaptController: + + Specifies a non-default SUNAdaptController time step controller + object. If a NULL-valued SUNAdaptController is input, the + default will be re-enabled. + ---------------------------------------------------------------*/ +int arkSetAdaptController(void *arkode_mem, SUNAdaptController C) +{ + int retval; + long int lenrw, leniw; + ARKodeMem ark_mem; + if (arkode_mem==NULL) { + arkProcessError(NULL, ARK_MEM_NULL, "ARKODE", + "arkSetAdaptController", MSG_ARK_NO_MEM); + return(ARK_MEM_NULL); + } + ark_mem = (ARKodeMem) arkode_mem; + + /* Remove current SUNAdaptController object + (delete if owned, and then nullify pointer) */ + retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, &leniw); + if (retval == SUNADAPTCONTROLLER_SUCCESS) { + ark_mem->liw -= leniw; + ark_mem->lrw -= lenrw; + } + if (ark_mem->hadapt_mem->owncontroller) { + retval = SUNAdaptController_Destroy(ark_mem->hadapt_mem->hcontroller); + ark_mem->hadapt_mem->owncontroller = SUNFALSE; + if (retval != SUNADAPTCONTROLLER_SUCCESS) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", "arkSetAdaptController", + "SUNAdaptController_Destroy failure"); + return(ARK_MEM_FAIL); + } + } + ark_mem->hadapt_mem->hcontroller = NULL; + + /* On NULL-valued input, create default SUNAdaptController object */ + if (C == NULL) { + C = SUNAdaptController_PID(ark_mem->sunctx); + if (C == NULL) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", "arkSetAdaptController", + "SUNAdaptControllerPID allocation failure"); + return(ARK_MEM_FAIL); + } + ark_mem->hadapt_mem->owncontroller = SUNTRUE; + } else { + ark_mem->hadapt_mem->owncontroller = SUNFALSE; + } + + /* Attach new SUNAdaptController object */ + retval = SUNAdaptController_Space(C, &lenrw, &leniw); + if (retval == SUNADAPTCONTROLLER_SUCCESS) { + ark_mem->liw += leniw; + ark_mem->lrw += lenrw; + } + ark_mem->hadapt_mem->hcontroller = C; + + return(ARK_SUCCESS); +} + /*--------------------------------------------------------------- arkSetMaxNumSteps: @@ -396,6 +456,7 @@ int arkSetMaxHnilWarns(void *arkode_mem, int mxhnil) int arkSetInitStep(void *arkode_mem, realtype hin) { ARKodeMem ark_mem; + int retval; if (arkode_mem==NULL) { arkProcessError(NULL, ARK_MEM_NULL, "ARKODE", "arkSetInitStep", MSG_ARK_NO_MEM); @@ -413,11 +474,9 @@ int arkSetInitStep(void *arkode_mem, realtype hin) /* Clear previous initial step */ ark_mem->h0u = ZERO; - /* Clear error and step size history */ - ark_mem->hadapt_mem->ehist[0] = ONE; - ark_mem->hadapt_mem->ehist[1] = ONE; - ark_mem->hadapt_mem->hhist[0] = ZERO; - ark_mem->hadapt_mem->hhist[1] = ZERO; + /* Reset error controller (e.g., error and step size history) */ + retval = SUNAdaptController_Reset(ark_mem->hadapt_mem->hcontroller); + if (retval != SUNADAPTCONTROLLER_SUCCESS) { return(ARK_CONTROLLER_ERR); } return(ARK_SUCCESS); } @@ -605,7 +664,7 @@ int arkSetFixedStep(void *arkode_mem, realtype hfixed) if (retval != ARK_SUCCESS) return(retval); } - /* set ark_mem entry */ + /* set ark_mem "fixedstep" entry */ if (hfixed != ZERO) { ark_mem->fixedstep = SUNTRUE; ark_mem->hin = hfixed; @@ -613,6 +672,9 @@ int arkSetFixedStep(void *arkode_mem, realtype hfixed) ark_mem->fixedstep = SUNFALSE; } + /* Notify ARKODE to use hfixed as the initial step size, and return */ + retval = arkSetInitStep(arkode_mem, hfixed); + return(ARK_SUCCESS); } @@ -775,16 +837,16 @@ int arkSetConstraints(void *arkode_mem, N_Vector constraints) constraints->ops->nvcompare == NULL || constraints->ops->nvconstrmask == NULL || constraints->ops->nvminquotient == NULL) { - arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE::ARKStep", - "ARKStepSetConstraints", MSG_ARK_BAD_NVECTOR); + arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE", + "arkSetConstraints", MSG_ARK_BAD_NVECTOR); return(ARK_ILL_INPUT); } /* Check the constraints vector */ temptest = N_VMaxNorm(constraints); if ((temptest > RCONST(2.5)) || (temptest < HALF)) { - arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE::ARKStep", - "ARKStepSetConstraints", MSG_ARK_BAD_CONSTR); + arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE", + "arkSetConstraints", MSG_ARK_BAD_CONSTR); return(ARK_ILL_INPUT); } @@ -826,6 +888,264 @@ int arkSetMaxNumConstrFails(void *arkode_mem, int maxfails) } +/*--------------------------------------------------------------- + arkSetAdaptivityMethod: ***DEPRECATED*** + + Specifies the built-in time step adaptivity algorithm (and + optionally, its associated parameters) to use. All parameters + will be checked for validity when used by the solver. + + Users should transition to constructing non-default SUNAdaptController + objects directly, and providing those directly to the integrator + via the time-stepping module *SetController routines. + ---------------------------------------------------------------*/ +int arkSetAdaptivityMethod(void *arkode_mem, int imethod, int idefault, + int pq, realtype adapt_params[3]) +{ + int retval; + long int lenrw, leniw; + realtype k1, k2, k3; + ARKodeMem ark_mem; + SUNAdaptController C; + if (arkode_mem==NULL) { + arkProcessError(NULL, ARK_MEM_NULL, "ARKODE", + "arkSetController", MSG_ARK_NO_MEM); + return(ARK_MEM_NULL); + } + ark_mem = (ARKodeMem) arkode_mem; + + /* Check for illegal inputs */ + if ((idefault != 1) && (adapt_params == NULL)) { + arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE", + "arkSetAdaptivityMethod", + "NULL-valued adapt_params provided"); + return(ARK_ILL_INPUT); + } + + /* Remove current SUNAdaptController object + (delete if owned, and then nullify pointer) */ + retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, &leniw); + if (retval == SUNADAPTCONTROLLER_SUCCESS) { + ark_mem->liw -= leniw; + ark_mem->lrw -= lenrw; + } + if (ark_mem->hadapt_mem->owncontroller) { + retval = SUNAdaptController_Destroy(ark_mem->hadapt_mem->hcontroller); + ark_mem->hadapt_mem->owncontroller = SUNFALSE; + if (retval != SUNADAPTCONTROLLER_SUCCESS) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", "arkSetAdaptivityMethod", + "SUNAdaptController_Destroy failure"); + return(ARK_MEM_FAIL); + } + } + ark_mem->hadapt_mem->hcontroller = NULL; + + /* set adaptivity parameters from inputs */ + k1 = k2 = k3 = ZERO; + if (idefault != 1) { + k1 = adapt_params[0]; + k2 = adapt_params[1]; + k3 = adapt_params[2]; + } + ark_mem->hadapt_mem->pq = pq; + + /* Create new SUNAdaptController object based on "imethod" input, optionally setting + the specified controller parameters */ + C = NULL; + switch (imethod) { + case (ARK_ADAPT_PID): + C = SUNAdaptController_PID(ark_mem->sunctx); + if (C == NULL) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", "arkSetAdaptivityMethod", + "SUNAdaptController_PID allocation failure"); + return(ARK_MEM_FAIL); + } + if (idefault != 1) { + retval = SUNAdaptController_SetParams_PID(C, k1, -k2, k3); + if (retval != SUNADAPTCONTROLLER_SUCCESS) { + (void) SUNAdaptController_Destroy(C); + arkProcessError(ark_mem, ARK_CONTROLLER_ERR, "ARKODE", + "arkSetAdaptivityMethod", "SUNAdaptController_SetParams_PID failure"); + return(ARK_CONTROLLER_ERR); + } + } + break; + case (ARK_ADAPT_PI): + C = SUNAdaptController_PI(ark_mem->sunctx); + if (C == NULL) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", "arkSetAdaptivityMethod", + "SUNAdaptController_PI allocation failure"); + return(ARK_MEM_FAIL); + } + if (idefault != 1) { + retval = SUNAdaptController_SetParams_PI(C, k1, -k2); + if (retval != SUNADAPTCONTROLLER_SUCCESS) { + (void) SUNAdaptController_Destroy(C); + arkProcessError(ark_mem, ARK_CONTROLLER_ERR, "ARKODE", + "arkSetAdaptivityMethod", "SUNAdaptController_SetParams_PI failure"); + return(ARK_CONTROLLER_ERR); + } + } + break; + case (ARK_ADAPT_I): + C = SUNAdaptController_I(ark_mem->sunctx); + if (C == NULL) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", "arkSetAdaptivityMethod", + "SUNAdaptController_I allocation failure"); + return(ARK_MEM_FAIL); + } + if (idefault != 1) { + retval = SUNAdaptController_SetParams_I(C, k1); + if (retval != SUNADAPTCONTROLLER_SUCCESS) { + (void) SUNAdaptController_Destroy(C); + arkProcessError(ark_mem, ARK_CONTROLLER_ERR, "ARKODE", + "arkSetAdaptivityMethod", "SUNAdaptController_SetParams_I failure"); + return(ARK_CONTROLLER_ERR); + } + } + break; + case (ARK_ADAPT_EXP_GUS): + C = SUNAdaptController_ExpGus(ark_mem->sunctx); + if (C == NULL) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", "arkSetAdaptivityMethod", + "SUNAdaptController_ExpGus allocation failure"); + return(ARK_MEM_FAIL); + } + if (idefault != 1) { + retval = SUNAdaptController_SetParams_ExpGus(C, k1, k2); + if (retval != SUNADAPTCONTROLLER_SUCCESS) { + (void) SUNAdaptController_Destroy(C); + arkProcessError(ark_mem, ARK_CONTROLLER_ERR, "ARKODE", + "arkSetAdaptivityMethod", "SUNAdaptController_SetParams_ExpGus failure"); + return(ARK_CONTROLLER_ERR); + } + } + break; + case (ARK_ADAPT_IMP_GUS): + C = SUNAdaptController_ImpGus(ark_mem->sunctx); + if (C == NULL) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", "arkSetAdaptivityMethod", + "SUNAdaptController_ImpGus allocation failure"); + return(ARK_MEM_FAIL); + } + if (idefault != 1) { + retval = SUNAdaptController_SetParams_ImpGus(C, k1, k2); + if (retval != SUNADAPTCONTROLLER_SUCCESS) { + (void) SUNAdaptController_Destroy(C); + arkProcessError(ark_mem, ARK_CONTROLLER_ERR, "ARKODE", + "arkSetAdaptivityMethod", "SUNAdaptController_SetParams_ImpGus failure"); + return(ARK_CONTROLLER_ERR); + } + } + break; + case (ARK_ADAPT_IMEX_GUS): + C = SUNAdaptController_ImExGus(ark_mem->sunctx); + if (C == NULL) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", "arkSetAdaptivityMethod", + "SUNAdaptController_ImExGus allocation failure"); + return(ARK_MEM_FAIL); + } + if (idefault != 1) { + retval = SUNAdaptController_SetParams_ImExGus(C, k1, k2, k3, k3); + if (retval != SUNADAPTCONTROLLER_SUCCESS) { + (void) SUNAdaptController_Destroy(C); + arkProcessError(ark_mem, ARK_CONTROLLER_ERR, "ARKODE", + "arkSetAdaptivityMethod", "SUNAdaptController_SetParams_ImExGus failure"); + return(ARK_CONTROLLER_ERR); + } + } + break; + default: + arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE", + "arkSetAdaptivityMethod", "Illegal imethod"); + return(ARK_ILL_INPUT); + } + + /* Attach new SUNAdaptController object */ + retval = SUNAdaptController_Space(C, &lenrw, &leniw); + if (retval == SUNADAPTCONTROLLER_SUCCESS) { + ark_mem->liw += leniw; + ark_mem->lrw += lenrw; + } + ark_mem->hadapt_mem->hcontroller = C; + ark_mem->hadapt_mem->owncontroller = SUNTRUE; + + return(ARK_SUCCESS); +} + + +/*--------------------------------------------------------------- + arkSetAdaptivityFn: ***DEPRECATED*** + + Specifies the user-provided time step adaptivity function to use. + If 'hfun' is NULL-valued, then the default PID controller will + be used instead. + + Users should transition to constructing a custom SUNAdaptController + object, and providing this directly to the integrator + via the time-stepping module *SetController routines. + ---------------------------------------------------------------*/ +int arkSetAdaptivityFn(void *arkode_mem, ARKAdaptFn hfun, void *h_data) +{ + int retval; + long int lenrw, leniw; + ARKodeMem ark_mem; + SUNAdaptController C; + if (arkode_mem==NULL) { + arkProcessError(NULL, ARK_MEM_NULL, "ARKODE", + "arkSetAdaptivityFn", MSG_ARK_NO_MEM); + return(ARK_MEM_NULL); + } + ark_mem = (ARKodeMem) arkode_mem; + + /* Remove current SUNAdaptController object + (delete if owned, and then nullify pointer) */ + retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, &leniw); + if (retval == SUNADAPTCONTROLLER_SUCCESS) { + ark_mem->liw -= leniw; + ark_mem->lrw -= lenrw; + } + if (ark_mem->hadapt_mem->owncontroller) { + retval = SUNAdaptController_Destroy(ark_mem->hadapt_mem->hcontroller); + ark_mem->hadapt_mem->owncontroller = SUNFALSE; + if (retval != SUNADAPTCONTROLLER_SUCCESS) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", "arkSetAdaptivityFn", + "SUNAdaptController_Destroy failure"); + return(ARK_MEM_FAIL); + } + } + ark_mem->hadapt_mem->hcontroller = NULL; + + /* Create new SUNAdaptController object depending on NULL-ity of 'hfun' */ + C = NULL; + if (hfun == NULL) { + C = SUNAdaptController_PID(ark_mem->sunctx); + if (C == NULL) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", "arkSetAdaptivityFn", + "SUNAdaptController_PID allocation failure"); + return(ARK_MEM_FAIL); + } + } else { + C = ARKUserControl(ark_mem->sunctx, arkode_mem, hfun, h_data); + if (C == NULL) { + arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", "arkSetAdaptivityFn", + "ARKUserControl allocation failure"); + return(ARK_MEM_FAIL); + } + } + + /* Attach new SUNAdaptController object */ + retval = SUNAdaptController_Space(C, &lenrw, &leniw); + if (retval == SUNADAPTCONTROLLER_SUCCESS) { + ark_mem->liw += leniw; + ark_mem->lrw += lenrw; + } + ark_mem->hadapt_mem->hcontroller = C; + ark_mem->hadapt_mem->owncontroller = SUNTRUE; + + return(ARK_SUCCESS); +} + /*--------------------------------------------------------------- arkSetCFLFraction: @@ -861,6 +1181,30 @@ int arkSetCFLFraction(void *arkode_mem, realtype cfl_frac) } +/*--------------------------------------------------------------- + arkSetAdaptivityAdjustment: + + Adjusts the method order supplied to the temporal adaptivity + controller. For example, if the user expects order reduction + due to problem stiffness, they may request that the controller + assume a reduced order of accuracy for the method by specifying + a value adjust < 0. + ---------------------------------------------------------------*/ +int arkSetAdaptivityAdjustment(void *arkode_mem, int adjust) +{ + int retval; + ARKodeHAdaptMem hadapt_mem; + ARKodeMem ark_mem; + retval = arkAccessHAdaptMem(arkode_mem, "arkSetAdaptivityAdjustment", + &ark_mem, &hadapt_mem); + if (retval != ARK_SUCCESS) return(retval); + + /* store requested adjustment */ + hadapt_mem->adjust = adjust; + return(ARK_SUCCESS); +} + + /*--------------------------------------------------------------- arkSetSafetyFactor: @@ -914,11 +1258,15 @@ int arkSetErrorBias(void *arkode_mem, realtype bias) /* set allowed value, otherwise set default */ if (bias < ONE) { - hadapt_mem->bias = BIAS; + retval = SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, -1.0); } else { - hadapt_mem->bias = bias; + retval = SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, bias); + } + if (retval != SUNADAPTCONTROLLER_SUCCESS) { + arkProcessError(ark_mem, ARK_CONTROLLER_ERR, "ARKODE", + "arkSetErrorBias", "SUNAdaptController_SetErrorBias failure"); + return(ARK_CONTROLLER_ERR); } - return(ARK_SUCCESS); } @@ -1008,98 +1356,6 @@ int arkSetFixedStepBounds(void *arkode_mem, realtype lb, realtype ub) } -/*--------------------------------------------------------------- - arkSetAdaptivityMethod: - - Specifies the built-in time step adaptivity algorithm (and - optionally, its associated parameters) to use. All parameters - will be checked for validity when used by the solver. - ---------------------------------------------------------------*/ -int arkSetAdaptivityMethod(void *arkode_mem, int imethod, int idefault, - int pq, realtype adapt_params[3]) -{ - int retval; - ARKodeHAdaptMem hadapt_mem; - ARKodeMem ark_mem; - retval = arkAccessHAdaptMem(arkode_mem, "arkSetAdaptivityMethod", - &ark_mem, &hadapt_mem); - if (retval != ARK_SUCCESS) return(retval); - - /* check for allowable parameters */ - if ((imethod > ARK_ADAPT_IMEX_GUS) || (imethod < ARK_ADAPT_PID)) { - arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE", - "arkSetAdaptivityMethod", "Illegal imethod"); - return(ARK_ILL_INPUT); - } - - /* set adaptivity method */ - hadapt_mem->imethod = imethod; - - /* set flag whether to use p (embedding, 0) or q (method, 1) order */ - hadapt_mem->pq = (pq != 0); - - /* set method parameters */ - if (idefault == 1) { - switch (hadapt_mem->imethod) { - case (ARK_ADAPT_PID): - hadapt_mem->k1 = AD0_K1; - hadapt_mem->k2 = AD0_K2; - hadapt_mem->k3 = AD0_K3; break; - case (ARK_ADAPT_PI): - hadapt_mem->k1 = AD1_K1; - hadapt_mem->k2 = AD1_K2; break; - case (ARK_ADAPT_I): - hadapt_mem->k1 = AD2_K1; break; - case (ARK_ADAPT_EXP_GUS): - hadapt_mem->k1 = AD3_K1; - hadapt_mem->k2 = AD3_K2; break; - case (ARK_ADAPT_IMP_GUS): - hadapt_mem->k1 = AD4_K1; - hadapt_mem->k2 = AD4_K2; break; - case (ARK_ADAPT_IMEX_GUS): - hadapt_mem->k1 = AD5_K1; - hadapt_mem->k2 = AD5_K2; - hadapt_mem->k3 = AD5_K3; break; - } - } else { - hadapt_mem->k1 = adapt_params[0]; - hadapt_mem->k2 = adapt_params[1]; - hadapt_mem->k3 = adapt_params[2]; - } - - return(ARK_SUCCESS); -} - - -/*--------------------------------------------------------------- - arkSetAdaptivityFn: - - Specifies the user-provided time step adaptivity function to use. - ---------------------------------------------------------------*/ -int arkSetAdaptivityFn(void *arkode_mem, ARKAdaptFn hfun, void *h_data) -{ - int retval; - ARKodeHAdaptMem hadapt_mem; - ARKodeMem ark_mem; - retval = arkAccessHAdaptMem(arkode_mem, "arkSetAdaptivityFn", - &ark_mem, &hadapt_mem); - if (retval != ARK_SUCCESS) return(retval); - - /* NULL hfun sets default, otherwise set inputs */ - if (hfun == NULL) { - hadapt_mem->HAdapt = NULL; - hadapt_mem->HAdapt_data = NULL; - hadapt_mem->imethod = ARK_ADAPT_PID; - } else { - hadapt_mem->HAdapt = hfun; - hadapt_mem->HAdapt_data = h_data; - hadapt_mem->imethod = ARK_ADAPT_CUSTOM; - } - - return(ARK_SUCCESS); -} - - /*--------------------------------------------------------------- arkSetMaxFirstGrowth: @@ -1835,6 +2091,9 @@ char *arkGetReturnFlagName(long int flag) case ARK_ROOT_RETURN: sprintf(name,"ARK_ROOT_RETURN"); break; + case ARK_WARNING: + sprintf(name,"ARK_WARNING"); + break; case ARK_TOO_MUCH_WORK: sprintf(name,"ARK_TOO_MUCH_WORK"); break; @@ -1889,6 +2148,9 @@ char *arkGetReturnFlagName(long int flag) case ARK_MASSMULT_FAIL: sprintf(name,"ARK_MASSMULT_FAIL"); break; + case ARK_CONSTR_FAIL: + sprintf(name,"ARK_CONSTR_FAIL"); + break; case ARK_MEM_FAIL: sprintf(name,"ARK_MEM_FAIL"); break; @@ -1913,12 +2175,6 @@ char *arkGetReturnFlagName(long int flag) case ARK_TOO_CLOSE: sprintf(name,"ARK_TOO_CLOSE"); break; - case ARK_POSTPROCESS_STEP_FAIL: - sprintf(name,"ARK_POSTPROCESS_STEP_FAIL"); - break; - case ARK_POSTPROCESS_STAGE_FAIL: - sprintf(name,"ARK_POSTPROCESS_STAGE_FAIL"); - break; case ARK_VECTOROP_ERR: sprintf(name,"ARK_VECTOROP_ERR"); break; @@ -1928,6 +2184,9 @@ char *arkGetReturnFlagName(long int flag) case ARK_NLS_SETUP_FAIL: sprintf(name,"ARK_NLS_SETUP_FAIL"); break; + case ARK_NLS_SETUP_RECVR: + sprintf(name,"ARK_NLS_SETUP_RECVR"); + break; case ARK_NLS_OP_ERR: sprintf(name,"ARK_NLS_OP_ERR"); break; @@ -1937,6 +2196,36 @@ char *arkGetReturnFlagName(long int flag) case ARK_INNERSTEP_FAIL: sprintf(name,"ARK_INNERSTEP_FAIL"); break; + case ARK_OUTERTOINNER_FAIL: + sprintf(name,"ARK_OUTERTOINNER_FAIL"); + break; + case ARK_INNERTOOUTER_FAIL: + sprintf(name,"ARK_INNERTOOUTER_FAIL"); + break; + case ARK_POSTPROCESS_STEP_FAIL: + sprintf(name,"ARK_POSTPROCESS_STEP_FAIL"); + break; + case ARK_POSTPROCESS_STAGE_FAIL: + sprintf(name,"ARK_POSTPROCESS_STAGE_FAIL"); + break; + case ARK_USER_PREDICT_FAIL: + sprintf(name,"ARK_USER_PREDICT_FAIL"); + break; + case ARK_INTERP_FAIL: + sprintf(name,"ARK_INTERP_FAIL"); + break; + case ARK_INVALID_TABLE: + sprintf(name,"ARK_INVALID_TABLE"); + break; + case ARK_CONTEXT_ERR: + sprintf(name,"ARK_CONTEXT_ERR"); + break; + case ARK_CONTROLLER_ERR: + sprintf(name,"ARK_CONTROLLER_ERR"); + break; + case ARK_UNRECOGNIZED_ERROR: + sprintf(name,"ARK_UNRECOGNIZED_ERROR"); + break; default: sprintf(name,"NONE"); } @@ -2005,24 +2294,16 @@ int arkWriteParameters(ARKodeMem ark_mem, FILE *fp) ark_mem->hadapt_mem->etacf); fprintf(fp, " Explicit safety factor = %"RSYM"\n", ark_mem->hadapt_mem->cfl); - if (ark_mem->hadapt_mem->HAdapt == NULL) { - fprintf(fp, " Time step adaptivity method %i\n", ark_mem->hadapt_mem->imethod); - fprintf(fp, " Safety factor = %"RSYM"\n", ark_mem->hadapt_mem->safety); - fprintf(fp, " Bias factor = %"RSYM"\n", ark_mem->hadapt_mem->bias); - fprintf(fp, " Growth factor = %"RSYM"\n", ark_mem->hadapt_mem->growth); - fprintf(fp, " Step growth lower bound = %"RSYM"\n", ark_mem->hadapt_mem->lbound); - fprintf(fp, " Step growth upper bound = %"RSYM"\n", ark_mem->hadapt_mem->ubound); - fprintf(fp, " k1 = %"RSYM"\n", ark_mem->hadapt_mem->k1); - fprintf(fp, " k2 = %"RSYM"\n", ark_mem->hadapt_mem->k2); - fprintf(fp, " k3 = %"RSYM"\n", ark_mem->hadapt_mem->k3); - if (ark_mem->hadapt_mem->expstab == arkExpStab) { - fprintf(fp, " Default explicit stability function\n"); - } else { - fprintf(fp, " User provided explicit stability function\n"); - } - } else { - fprintf(fp, " User provided time step adaptivity function\n"); - } + fprintf(fp, " Safety factor = %"RSYM"\n", ark_mem->hadapt_mem->safety); + fprintf(fp, " Growth factor = %"RSYM"\n", ark_mem->hadapt_mem->growth); + fprintf(fp, " Step growth lower bound = %"RSYM"\n", ark_mem->hadapt_mem->lbound); + fprintf(fp, " Step growth upper bound = %"RSYM"\n", ark_mem->hadapt_mem->ubound); + if (ark_mem->hadapt_mem->expstab == arkExpStab) { + fprintf(fp, " Default explicit stability function\n"); + } else { + fprintf(fp, " User provided explicit stability function\n"); + } + (void) SUNAdaptController_Write(ark_mem->hadapt_mem->hcontroller, fp); fprintf(fp, " Maximum number of error test failures = %i\n",ark_mem->maxnef); fprintf(fp, " Maximum number of convergence test failures = %i\n",ark_mem->maxncf); diff --git a/src/arkode/arkode_user_controller.c b/src/arkode/arkode_user_controller.c new file mode 100644 index 0000000000..ddf3cbd262 --- /dev/null +++ b/src/arkode/arkode_user_controller.c @@ -0,0 +1,155 @@ +/* ----------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + * ----------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2023, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * ----------------------------------------------------------------- + * This is the implementation file for the ARKUserControl + * SUNAdaptController module. + * -----------------------------------------------------------------*/ + +#include +#include +#include "arkode_user_controller.h" + + +/* --------------- + * Macro accessors + * --------------- */ + +#define SC_CONTENT(C) ( (ARKUserControlContent)(C->content) ) +#define SC_HP(C) ( SC_CONTENT(C)->hp ) +#define SC_HPP(C) ( SC_CONTENT(C)->hpp ) +#define SC_EP(C) ( SC_CONTENT(C)->ep ) +#define SC_EPP(C) ( SC_CONTENT(C)->epp ) +#define SC_ARKMEM(C) ( SC_CONTENT(C)->ark_mem ) +#define SC_HADAPT(C) ( SC_CONTENT(C)->hadapt ) +#define SC_DATA(C) ( SC_CONTENT(C)->hadapt_data ) + + +/* ----------------------------------------------------------------- + * exported functions + * ----------------------------------------------------------------- */ + +/* ----------------------------------------------------------------- + * Function to create a new ARKUserControl controller + */ + +SUNAdaptController ARKUserControl(SUNContext sunctx, void* arkode_mem, + ARKAdaptFn hadapt, void* hadapt_data) +{ + SUNAdaptController C; + ARKUserControlContent content; + + /* Return with failure if hadapt, arkode_mem, or context are NULL */ + if ((hadapt == NULL) || (arkode_mem == NULL) || (sunctx == NULL)) { return (NULL); } + + /* Create an empty controller object */ + C = NULL; + C = SUNAdaptController_NewEmpty(sunctx); + if (C == NULL) { return (NULL); } + + /* Attach operations */ + C->ops->gettype = SUNAdaptController_GetType_ARKUserControl; + C->ops->estimatestep = SUNAdaptController_EstimateStep_ARKUserControl; + C->ops->reset = SUNAdaptController_Reset_ARKUserControl; + C->ops->write = SUNAdaptController_Write_ARKUserControl; + C->ops->updateh = SUNAdaptController_UpdateH_ARKUserControl; + C->ops->space = SUNAdaptController_Space_ARKUserControl; + + /* Create content */ + content = NULL; + content = (ARKUserControlContent)malloc(sizeof *content); + if (content == NULL) + { + (void) SUNAdaptController_Destroy(C); + return (NULL); + } + + /* Attach content */ + C->content = content; + + /* Attach ARKODE memory structure */ + content->ark_mem = (ARKodeMem) arkode_mem; + + /* Attach user-provided adaptivity function and data */ + content->hadapt = hadapt; + content->hadapt_data = hadapt_data; + + /* Fill content with default/reset values */ + SUNAdaptController_Reset_ARKUserControl(C); + + return (C); +} + + +/* ----------------------------------------------------------------- + * implementation of controller operations + * ----------------------------------------------------------------- */ + +SUNAdaptController_Type SUNAdaptController_GetType_ARKUserControl(SUNAdaptController C) +{ return SUN_ADAPTCONTROLLER_H; } + +int SUNAdaptController_EstimateStep_ARKUserControl(SUNAdaptController C, realtype h, + int p, realtype dsm, realtype* hnew) +{ + /* call user-provided function to compute new step */ + sunrealtype ttmp = (dsm <= ONE) ? SC_ARKMEM(C)->tn + SC_ARKMEM(C)->h : SC_ARKMEM(C)->tn; + int retval = SC_HADAPT(C)(SC_ARKMEM(C)->ycur, ttmp, h, SC_HP(C), + SC_HPP(C), dsm, SC_EP(C), SC_EPP(C), + SC_ARKMEM(C)->hadapt_mem->q, SC_ARKMEM(C)->hadapt_mem->p, + hnew, SC_DATA(C)); + if (retval != SUNADAPTCONTROLLER_SUCCESS) { return(SUNADAPTCONTROLLER_USER_FCN_FAIL); } + return SUNADAPTCONTROLLER_SUCCESS; +} + +int SUNAdaptController_Reset_ARKUserControl(SUNAdaptController C) +{ + SC_EP(C) = RCONST(1.0); + SC_EPP(C) = RCONST(1.0); + SC_HP(C) = RCONST(0.0); + SC_HPP(C) = RCONST(0.0); + return SUNADAPTCONTROLLER_SUCCESS; +} + +int SUNAdaptController_Write_ARKUserControl(SUNAdaptController C, FILE *fptr) +{ + fprintf(fptr, "ARKUserControl module:\n"); +#if defined(SUNDIALS_EXTENDED_PRECISION) + fprintf(fptr, " hp = %12Lg\n", SC_HP(C)); + fprintf(fptr, " hpp = %12Lg\n", SC_HPP(C)); + fprintf(fptr, " ep = %12Lg\n", SC_EP(C)); + fprintf(fptr, " epp = %12Lg\n", SC_EPP(C)); +#else + fprintf(fptr, " hp = %12g\n", SC_HP(C)); + fprintf(fptr, " hpp = %12g\n", SC_HPP(C)); + fprintf(fptr, " ep = %12g\n", SC_EP(C)); + fprintf(fptr, " epp = %12g\n", SC_EPP(C)); +#endif + fprintf(fptr, " hadapt_data = %p\n", SC_DATA(C)); + return SUNADAPTCONTROLLER_SUCCESS; +} + +int SUNAdaptController_UpdateH_ARKUserControl(SUNAdaptController C, realtype h, realtype dsm) +{ + SC_HPP(C) = SC_HP(C); + SC_HP(C) = h; + SC_EPP(C) = SC_EP(C); + SC_EP(C) = dsm; + return SUNADAPTCONTROLLER_SUCCESS; +} + +int SUNAdaptController_Space_ARKUserControl(SUNAdaptController C, long int* lenrw, + long int* leniw) +{ + *lenrw = 4; + *leniw = 2; + return SUNADAPTCONTROLLER_SUCCESS; +} diff --git a/src/arkode/arkode_user_controller.h b/src/arkode/arkode_user_controller.h new file mode 100644 index 0000000000..201e622b70 --- /dev/null +++ b/src/arkode/arkode_user_controller.h @@ -0,0 +1,72 @@ +/* ----------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + * ----------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2023, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * ----------------------------------------------------------------- + * This is the header file for a user-provided controller function + * SUNAdaptController module implementation. This provides backwards- + * compatibility for ARKODE's previous "ARKAdaptFn" + * -----------------------------------------------------------------*/ + +#ifndef _ARK_USERCONTROL_H +#define _ARK_USERCONTROL_H + +#include +#include +#include "arkode_impl.h" + +#ifdef __cplusplus /* wrapper to enable C++ usage */ +extern "C" { +#endif + +/* --------------------------------------------------- + * ARKUserControl implementation of SUNAdaptController + * --------------------------------------------------- */ + +struct _ARKUserControlContent { + realtype hp; /* h from previous step */ + realtype hpp; /* h from 2 steps ago */ + realtype ep; /* error from previous step */ + realtype epp; /* error from 2 steps ago */ + ARKodeMem ark_mem; /* main ARKODE memory structure */ + ARKAdaptFn hadapt; /* user-provided adaptivity fn */ + void* hadapt_data; /* user-provided data pointer */ +}; + +typedef struct _ARKUserControlContent *ARKUserControlContent; + +/* ------------------ + * Exported Functions + * ------------------ */ + +SUNDIALS_EXPORT +SUNAdaptController ARKUserControl(SUNContext sunctx, void* arkode_mem, + ARKAdaptFn hadapt, void* hadapt_data); +SUNDIALS_EXPORT +SUNAdaptController_Type SUNAdaptController_GetType_ARKUserControl(SUNAdaptController C); +SUNDIALS_EXPORT +int SUNAdaptController_EstimateStep_ARKUserControl(SUNAdaptController C, realtype h, + int p, realtype dsm, realtype* hnew); +SUNDIALS_EXPORT +int SUNAdaptController_Reset_ARKUserControl(SUNAdaptController C); +SUNDIALS_EXPORT +int SUNAdaptController_Write_ARKUserControl(SUNAdaptController C, FILE* fptr); +SUNDIALS_EXPORT +int SUNAdaptController_UpdateH_ARKUserControl(SUNAdaptController C, realtype h, realtype dsm); +SUNDIALS_EXPORT +int SUNAdaptController_Space_ARKUserControl(SUNAdaptController C, long int *lenrw, + long int *leniw); + +#ifdef __cplusplus +} +#endif + +#endif /* _ARK_USERCONTROL_H */ diff --git a/src/arkode/fmod/CMakeLists.txt b/src/arkode/fmod/CMakeLists.txt index 5ac015daf1..840dfb2591 100644 --- a/src/arkode/fmod/CMakeLists.txt +++ b/src/arkode/fmod/CMakeLists.txt @@ -33,6 +33,8 @@ sundials_add_f2003_library(sundials_farkode_mod OBJECT_LIBRARIES sundials_fgeneric_mod_obj sundials_fnvecserial_mod_obj + sundials_fsunadaptcontrollersoderlind_mod_obj + sundials_fsunadaptcontrollerimexgus_mod_obj sundials_fsunmatrixband_mod_obj sundials_fsunmatrixdense_mod_obj sundials_fsunmatrixsparse_mod_obj diff --git a/src/arkode/fmod/farkode_arkstep_mod.c b/src/arkode/fmod/farkode_arkstep_mod.c index 2ae77231a3..311cea273e 100644 --- a/src/arkode/fmod/farkode_arkstep_mod.c +++ b/src/arkode/fmod/farkode_arkstep_mod.c @@ -685,6 +685,34 @@ SWIGEXPORT int _wrap_FARKStepSetTableName(void *farg1, SwigArrayWrapper *farg2, } +SWIGEXPORT int _wrap_FARKStepSetAdaptController(void *farg1, SUNAdaptController farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNAdaptController arg2 = (SUNAdaptController) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNAdaptController)(farg2); + result = (int)ARKStepSetAdaptController(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetAdaptivityAdjustment(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKStepSetAdaptivityAdjustment(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FARKStepSetCFLFraction(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/arkode/fmod/farkode_arkstep_mod.f90 b/src/arkode/fmod/farkode_arkstep_mod.f90 index c52006c929..08ee14cc0a 100644 --- a/src/arkode/fmod/farkode_arkstep_mod.f90 +++ b/src/arkode/fmod/farkode_arkstep_mod.f90 @@ -34,6 +34,7 @@ module farkode_arkstep_mod use fsundials_context_mod use fsundials_types_mod use fsundials_nonlinearsolver_mod + use fsundials_adaptcontroller_mod use fsundials_types_mod implicit none private @@ -44,7 +45,9 @@ module farkode_arkstep_mod integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ERK_4 = ARKODE_ZONNEVELD_5_3_4 integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ERK_5 = ARKODE_CASH_KARP_6_4_5 integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ERK_6 = ARKODE_VERNER_8_5_6 + integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ERK_7 = ARKODE_VERNER_10_6_7 integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ERK_8 = ARKODE_FEHLBERG_13_7_8 + integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ERK_9 = ARKODE_VERNER_16_8_9 integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_DIRK_2 = ARKODE_SDIRK_2_1_2 integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_DIRK_3 = ARKODE_ARK324L2SA_DIRK_4_2_3 integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_DIRK_4 = ARKODE_SDIRK_5_3_4 @@ -91,6 +94,8 @@ module farkode_arkstep_mod integer(C_SIZE_T), public :: size = 0 end type public :: FARKStepSetTableName + public :: FARKStepSetAdaptController + public :: FARKStepSetAdaptivityAdjustment public :: FARKStepSetCFLFraction public :: FARKStepSetSafetyFactor public :: FARKStepSetErrorBias @@ -518,6 +523,24 @@ function swigc_FARKStepSetTableName(farg1, farg2, farg3) & integer(C_INT) :: fresult end function +function swigc_FARKStepSetAdaptController(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetAdaptController") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetAdaptivityAdjustment(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetAdaptivityAdjustment") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + function swigc_FARKStepSetCFLFraction(farg1, farg2) & bind(C, name="_wrap_FARKStepSetCFLFraction") & result(fresult) @@ -2345,6 +2368,38 @@ function FARKStepSetTableName(arkode_mem, itable, etable) & swig_result = fresult end function +function FARKStepSetAdaptController(arkode_mem, c) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(SUNAdaptController), target, intent(inout) :: c +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(c) +fresult = swigc_FARKStepSetAdaptController(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetAdaptivityAdjustment(arkode_mem, adjust) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: adjust +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = adjust +fresult = swigc_FARKStepSetAdaptivityAdjustment(farg1, farg2) +swig_result = fresult +end function + function FARKStepSetCFLFraction(arkode_mem, cfl_frac) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/arkode/fmod/farkode_erkstep_mod.c b/src/arkode/fmod/farkode_erkstep_mod.c index 46836ba780..8a6be0ea0f 100644 --- a/src/arkode/fmod/farkode_erkstep_mod.c +++ b/src/arkode/fmod/farkode_erkstep_mod.c @@ -479,6 +479,34 @@ SWIGEXPORT int _wrap_FERKStepSetTableName(void *farg1, SwigArrayWrapper *farg2) } +SWIGEXPORT int _wrap_FERKStepSetAdaptController(void *farg1, SUNAdaptController farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNAdaptController arg2 = (SUNAdaptController) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNAdaptController)(farg2); + result = (int)ERKStepSetAdaptController(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetAdaptivityAdjustment(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ERKStepSetAdaptivityAdjustment(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FERKStepSetCFLFraction(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/arkode/fmod/farkode_erkstep_mod.f90 b/src/arkode/fmod/farkode_erkstep_mod.f90 index 3857ac1a7d..d7f2b4fa8b 100644 --- a/src/arkode/fmod/farkode_erkstep_mod.f90 +++ b/src/arkode/fmod/farkode_erkstep_mod.f90 @@ -34,6 +34,7 @@ module farkode_erkstep_mod use fsundials_context_mod use fsundials_types_mod use fsundials_nonlinearsolver_mod + use fsundials_adaptcontroller_mod use fsundials_types_mod implicit none private @@ -44,7 +45,9 @@ module farkode_erkstep_mod integer(C_INT), parameter, public :: ERKSTEP_DEFAULT_4 = ARKODE_ZONNEVELD_5_3_4 integer(C_INT), parameter, public :: ERKSTEP_DEFAULT_5 = ARKODE_CASH_KARP_6_4_5 integer(C_INT), parameter, public :: ERKSTEP_DEFAULT_6 = ARKODE_VERNER_8_5_6 + integer(C_INT), parameter, public :: ERKSTEP_DEFAULT_7 = ARKODE_VERNER_10_6_7 integer(C_INT), parameter, public :: ERKSTEP_DEFAULT_8 = ARKODE_FEHLBERG_13_7_8 + integer(C_INT), parameter, public :: ERKSTEP_DEFAULT_9 = ARKODE_VERNER_16_8_9 public :: FERKStepCreate public :: FERKStepResize public :: FERKStepReInit @@ -65,6 +68,8 @@ module farkode_erkstep_mod integer(C_SIZE_T), public :: size = 0 end type public :: FERKStepSetTableName + public :: FERKStepSetAdaptController + public :: FERKStepSetAdaptivityAdjustment public :: FERKStepSetCFLFraction public :: FERKStepSetSafetyFactor public :: FERKStepSetErrorBias @@ -300,6 +305,24 @@ function swigc_FERKStepSetTableName(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FERKStepSetAdaptController(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetAdaptController") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FERKStepSetAdaptivityAdjustment(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetAdaptivityAdjustment") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + function swigc_FERKStepSetCFLFraction(farg1, farg2) & bind(C, name="_wrap_FERKStepSetCFLFraction") & result(fresult) @@ -1319,6 +1342,38 @@ function FERKStepSetTableName(arkode_mem, etable) & swig_result = fresult end function +function FERKStepSetAdaptController(arkode_mem, c) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(SUNAdaptController), target, intent(inout) :: c +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(c) +fresult = swigc_FERKStepSetAdaptController(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetAdaptivityAdjustment(arkode_mem, adjust) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: adjust +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = adjust +fresult = swigc_FERKStepSetAdaptivityAdjustment(farg1, farg2) +swig_result = fresult +end function + function FERKStepSetCFLFraction(arkode_mem, cfl_frac) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/arkode/fmod/farkode_mod.f90 b/src/arkode/fmod/farkode_mod.f90 index 5ca5dcc9f2..31610f9ac4 100644 --- a/src/arkode/fmod/farkode_mod.f90 +++ b/src/arkode/fmod/farkode_mod.f90 @@ -33,6 +33,7 @@ module farkode_mod use fsundials_context_mod use fsundials_types_mod use fsundials_nonlinearsolver_mod + use fsundials_adaptcontroller_mod use fsundials_types_mod implicit none private @@ -104,6 +105,7 @@ module farkode_mod integer(C_INT), parameter, public :: ARK_RELAX_MEM_NULL = -44_C_INT integer(C_INT), parameter, public :: ARK_RELAX_FUNC_FAIL = -45_C_INT integer(C_INT), parameter, public :: ARK_RELAX_JAC_FAIL = -46_C_INT + integer(C_INT), parameter, public :: ARK_CONTROLLER_ERR = -47_C_INT integer(C_INT), parameter, public :: ARK_UNRECOGNIZED_ERROR = -99_C_INT ! typedef enum ARKRelaxSolver enum, bind(c) @@ -236,7 +238,7 @@ module farkode_mod integer(C_INT), parameter, public :: ARK437L2SA_ERK_7_3_4 = 13_C_INT integer(C_INT), parameter, public :: ARK548L2SAb_ERK_8_4_5 = 14_C_INT integer(C_INT), parameter, public :: MIN_ERK_NUM = 0_C_INT - integer(C_INT), parameter, public :: MAX_ERK_NUM = 14_C_INT + integer(C_INT), parameter, public :: MAX_ERK_NUM = 21_C_INT ! typedef enum ARKODE_ERKTableID enum, bind(c) enumerator :: ARKODE_ERK_NONE = -1 @@ -257,14 +259,21 @@ module farkode_mod enumerator :: ARKODE_ARK437L2SA_ERK_7_3_4 enumerator :: ARKODE_ARK548L2SAb_ERK_8_4_5 enumerator :: ARKODE_ARK2_ERK_3_1_2 - enumerator :: ARKODE_MAX_ERK_NUM = ARKODE_ARK2_ERK_3_1_2 + enumerator :: ARKODE_SOFRONIOU_SPALETTA_5_3_4 + enumerator :: ARKODE_SHU_OSHER_3_2_3 + enumerator :: ARKODE_VERNER_9_5_6 + enumerator :: ARKODE_VERNER_10_6_7 + enumerator :: ARKODE_VERNER_13_7_8 + enumerator :: ARKODE_VERNER_16_8_9 + enumerator :: ARKODE_MAX_ERK_NUM = ARKODE_VERNER_16_8_9 end enum integer, parameter, public :: ARKODE_ERKTableID = kind(ARKODE_ERK_NONE) public :: ARKODE_ERK_NONE, ARKODE_MIN_ERK_NUM, ARKODE_HEUN_EULER_2_1_2, ARKODE_BOGACKI_SHAMPINE_4_2_3, & ARKODE_ARK324L2SA_ERK_4_2_3, ARKODE_ZONNEVELD_5_3_4, ARKODE_ARK436L2SA_ERK_6_3_4, ARKODE_SAYFY_ABURUB_6_3_4, & ARKODE_CASH_KARP_6_4_5, ARKODE_FEHLBERG_6_4_5, ARKODE_DORMAND_PRINCE_7_4_5, ARKODE_ARK548L2SA_ERK_8_4_5, & ARKODE_VERNER_8_5_6, ARKODE_FEHLBERG_13_7_8, ARKODE_KNOTH_WOLKE_3_3, ARKODE_ARK437L2SA_ERK_7_3_4, & - ARKODE_ARK548L2SAb_ERK_8_4_5, ARKODE_ARK2_ERK_3_1_2, ARKODE_MAX_ERK_NUM + ARKODE_ARK548L2SAb_ERK_8_4_5, ARKODE_ARK2_ERK_3_1_2, ARKODE_SOFRONIOU_SPALETTA_5_3_4, ARKODE_SHU_OSHER_3_2_3, & + ARKODE_VERNER_9_5_6, ARKODE_VERNER_10_6_7, ARKODE_VERNER_13_7_8, ARKODE_VERNER_16_8_9, ARKODE_MAX_ERK_NUM public :: FARKodeButcherTable_LoadERK public :: FARKodeButcherTable_LoadERKByName ! typedef enum ARKODE_SPRKMethodID diff --git a/src/arkode/fmod/farkode_mristep_mod.f90 b/src/arkode/fmod/farkode_mristep_mod.f90 index b80ca727f8..6db939a4b7 100644 --- a/src/arkode/fmod/farkode_mristep_mod.f90 +++ b/src/arkode/fmod/farkode_mristep_mod.f90 @@ -34,6 +34,7 @@ module farkode_mristep_mod use fsundials_context_mod use fsundials_types_mod use fsundials_nonlinearsolver_mod + use fsundials_adaptcontroller_mod use fsundials_types_mod implicit none private diff --git a/src/arkode/fmod/farkode_sprkstep_mod.f90 b/src/arkode/fmod/farkode_sprkstep_mod.f90 index ad9795aba2..7598cdc481 100644 --- a/src/arkode/fmod/farkode_sprkstep_mod.f90 +++ b/src/arkode/fmod/farkode_sprkstep_mod.f90 @@ -34,6 +34,7 @@ module farkode_sprkstep_mod use fsundials_context_mod use fsundials_types_mod use fsundials_nonlinearsolver_mod + use fsundials_adaptcontroller_mod use fsundials_types_mod implicit none private diff --git a/src/sunadaptcontroller/CMakeLists.txt b/src/sunadaptcontroller/CMakeLists.txt new file mode 100644 index 0000000000..8287f3da3d --- /dev/null +++ b/src/sunadaptcontroller/CMakeLists.txt @@ -0,0 +1,19 @@ +# ------------------------------------------------------------------------------ +# Programmer(s): Daniel R. Reynolds @ SMU +# ------------------------------------------------------------------------------ +# SUNDIALS Copyright Start +# Copyright (c) 2002-2023, Lawrence Livermore National Security +# and Southern Methodist University. +# All rights reserved. +# +# See the top-level LICENSE and NOTICE files for details. +# +# SPDX-License-Identifier: BSD-3-Clause +# SUNDIALS Copyright End +# ------------------------------------------------------------------------------ +# controller level CMakeLists.txt for SUNDIALS +# ------------------------------------------------------------------------------ + +# required native matrices +add_subdirectory(imexgus) +add_subdirectory(soderlind) diff --git a/src/sunadaptcontroller/imexgus/CMakeLists.txt b/src/sunadaptcontroller/imexgus/CMakeLists.txt new file mode 100644 index 0000000000..a98374f2a3 --- /dev/null +++ b/src/sunadaptcontroller/imexgus/CMakeLists.txt @@ -0,0 +1,29 @@ +# --------------------------------------------------------------- +# Programmer(s): Daniel R. Reynolds @ SMU +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2023, Lawrence Livermore National Security +# and Southern Methodist University. +# All rights reserved. +# +# See the top-level LICENSE and NOTICE files for details. +# +# SPDX-License-Identifier: BSD-3-Clause +# SUNDIALS Copyright End +# --------------------------------------------------------------- + +# Create a library out of the generic sundials modules +sundials_add_library(sundials_sunadaptcontrollerimexgus + SOURCES + sunadaptcontroller_imexgus.c + HEADERS + ${SUNDIALS_SOURCE_DIR}/include/sunadaptcontroller/sunadaptcontroller_imexgus.h + INCLUDE_SUBDIR + sunadaptcontroller + OBJECT_LIB_ONLY +) + +# Add F2003 module if the interface is enabled +if(BUILD_FORTRAN_MODULE_INTERFACE) + add_subdirectory(fmod) +endif() diff --git a/src/sunadaptcontroller/imexgus/fmod/CMakeLists.txt b/src/sunadaptcontroller/imexgus/fmod/CMakeLists.txt new file mode 100644 index 0000000000..7c943d4724 --- /dev/null +++ b/src/sunadaptcontroller/imexgus/fmod/CMakeLists.txt @@ -0,0 +1,25 @@ +# --------------------------------------------------------------- +# Programmer(s): Daniel R. Reynolds @ SMU +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2023, Lawrence Livermore National Security +# and Southern Methodist University. +# All rights reserved. +# +# See the top-level LICENSE and NOTICE files for details. +# +# SPDX-License-Identifier: BSD-3-Clause +# SUNDIALS Copyright End +# --------------------------------------------------------------- + +sundials_add_f2003_library(sundials_fsunadaptcontrollerimexgus_mod + SOURCES + fsunadaptcontroller_imexgus_mod.f90 fsunadaptcontroller_imexgus_mod.c + OBJECT_LIBRARIES + sundials_fgeneric_mod_obj + OUTPUT_NAME + sundials_fsunadaptcontrollerimexgus_mod + OBJECT_LIB_ONLY +) + +message(STATUS "Added SUNAdaptController_ImExGus F2003 interface") diff --git a/src/sunadaptcontroller/imexgus/fmod/fsunadaptcontroller_imexgus_mod.c b/src/sunadaptcontroller/imexgus/fmod/fsunadaptcontroller_imexgus_mod.c new file mode 100644 index 0000000000..18ab594868 --- /dev/null +++ b/src/sunadaptcontroller/imexgus/fmod/fsunadaptcontroller_imexgus_mod.c @@ -0,0 +1,359 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 4.0.0 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + +/* --------------------------------------------------------------- + * Programmer(s): Auto-generated by swig. + * --------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2023, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * -------------------------------------------------------------*/ + +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* qualifier for exported *const* global data variables*/ +#ifndef SWIGEXTERN +# ifdef __cplusplus +# define SWIGEXTERN extern +# else +# define SWIGEXTERN +# endif +#endif + +/* exporting methods */ +#if defined(__GNUC__) +# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + +/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ +#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) +# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 +#endif + +/* Intel's compiler complains if a variable which was never initialised is + * cast to void, which is a common idiom which we use to indicate that we + * are aware a variable isn't used. So we just silence that warning. + * See: https://github.com/swig/swig/issues/192 for more discussion. + */ +#ifdef __INTEL_COMPILER +# pragma warning disable 592 +#endif + +/* Errors in SWIG */ +#define SWIG_UnknownError -1 +#define SWIG_IOError -2 +#define SWIG_RuntimeError -3 +#define SWIG_IndexError -4 +#define SWIG_TypeError -5 +#define SWIG_DivisionByZero -6 +#define SWIG_OverflowError -7 +#define SWIG_SyntaxError -8 +#define SWIG_ValueError -9 +#define SWIG_SystemError -10 +#define SWIG_AttributeError -11 +#define SWIG_MemoryError -12 +#define SWIG_NullReferenceError -13 + + + + +#include +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include +#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) +# ifndef snprintf +# define snprintf _snprintf +# endif +#endif + + +/* Support for the `contract` feature. + * + * Note that RETURNNULL is first because it's inserted via a 'Replaceall' in + * the fortran.cxx file. + */ +#define SWIG_contract_assert(RETURNNULL, EXPR, MSG) \ + if (!(EXPR)) { SWIG_exception_impl("$decl", SWIG_ValueError, MSG, RETURNNULL); } + + +#define SWIGVERSION 0x040000 +#define SWIG_VERSION SWIGVERSION + + +#define SWIG_as_voidptr(a) (void *)((const void *)(a)) +#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) + + +#include "sundials/sundials_adaptcontroller.h" + + +#include "sunadaptcontroller/sunadaptcontroller_imexgus.h" + +SWIGEXPORT SUNAdaptController _wrap_FSUNAdaptController_ImExGus(void *farg1) { + SUNAdaptController fresult ; + SUNContext arg1 = (SUNContext) 0 ; + SUNAdaptController result; + + arg1 = (SUNContext)(farg1); + result = (SUNAdaptController)SUNAdaptController_ImExGus(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetParams_ImExGus(SUNAdaptController farg1, double const *farg2, double const *farg3, double const *farg4, double const *farg5) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + sunrealtype arg4 ; + sunrealtype arg5 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (sunrealtype)(*farg5); + result = (int)SUNAdaptController_SetParams_ImExGus(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_GetType_ImExGus(SUNAdaptController farg1) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + SUNAdaptController_Type result; + + arg1 = (SUNAdaptController)(farg1); + result = (SUNAdaptController_Type)SUNAdaptController_GetType_ImExGus(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_EstimateStep_ImExGus(SUNAdaptController farg1, double const *farg2, int const *farg3, double const *farg4, double *farg5) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + int arg3 ; + sunrealtype arg4 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (sunrealtype *)(farg5); + result = (int)SUNAdaptController_EstimateStep_ImExGus(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_Reset_ImExGus(SUNAdaptController farg1) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + result = (int)SUNAdaptController_Reset_ImExGus(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetDefaults_ImExGus(SUNAdaptController farg1) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + result = (int)SUNAdaptController_SetDefaults_ImExGus(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_Write_ImExGus(SUNAdaptController farg1, void *farg2) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + FILE *arg2 = (FILE *) 0 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (FILE *)(farg2); + result = (int)SUNAdaptController_Write_ImExGus(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetErrorBias_ImExGus(SUNAdaptController farg1, double const *farg2) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)SUNAdaptController_SetErrorBias_ImExGus(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_UpdateH_ImExGus(SUNAdaptController farg1, double const *farg2, double const *farg3) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)SUNAdaptController_UpdateH_ImExGus(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_Space_ImExGus(SUNAdaptController farg1, long *farg2, long *farg3) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)SUNAdaptController_Space_ImExGus(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + + diff --git a/src/sunadaptcontroller/imexgus/fmod/fsunadaptcontroller_imexgus_mod.f90 b/src/sunadaptcontroller/imexgus/fmod/fsunadaptcontroller_imexgus_mod.f90 new file mode 100644 index 0000000000..11443858ac --- /dev/null +++ b/src/sunadaptcontroller/imexgus/fmod/fsunadaptcontroller_imexgus_mod.f90 @@ -0,0 +1,315 @@ +! This file was automatically generated by SWIG (http://www.swig.org). +! Version 4.0.0 +! +! Do not make changes to this file unless you know what you are doing--modify +! the SWIG interface file instead. + +! --------------------------------------------------------------- +! Programmer(s): Auto-generated by swig. +! --------------------------------------------------------------- +! SUNDIALS Copyright Start +! Copyright (c) 2002-2023, Lawrence Livermore National Security +! and Southern Methodist University. +! All rights reserved. +! +! See the top-level LICENSE and NOTICE files for details. +! +! SPDX-License-Identifier: BSD-3-Clause +! SUNDIALS Copyright End +! --------------------------------------------------------------- + +module fsunadaptcontroller_imexgus_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_adaptcontroller_mod + use fsundials_types_mod + use fsundials_context_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + public :: FSUNAdaptController_ImExGus + public :: FSUNAdaptController_SetParams_ImExGus + public :: FSUNAdaptController_GetType_ImExGus + public :: FSUNAdaptController_EstimateStep_ImExGus + public :: FSUNAdaptController_Reset_ImExGus + public :: FSUNAdaptController_SetDefaults_ImExGus + public :: FSUNAdaptController_Write_ImExGus + public :: FSUNAdaptController_SetErrorBias_ImExGus + public :: FSUNAdaptController_UpdateH_ImExGus + public :: FSUNAdaptController_Space_ImExGus + +! WRAPPER DECLARATIONS +interface +function swigc_FSUNAdaptController_ImExGus(farg1) & +bind(C, name="_wrap_FSUNAdaptController_ImExGus") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FSUNAdaptController_SetParams_ImExGus(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNAdaptController_SetParams_ImExGus") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +real(C_DOUBLE), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_GetType_ImExGus(farg1) & +bind(C, name="_wrap_FSUNAdaptController_GetType_ImExGus") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_EstimateStep_ImExGus(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNAdaptController_EstimateStep_ImExGus") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_Reset_ImExGus(farg1) & +bind(C, name="_wrap_FSUNAdaptController_Reset_ImExGus") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_SetDefaults_ImExGus(farg1) & +bind(C, name="_wrap_FSUNAdaptController_SetDefaults_ImExGus") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_Write_ImExGus(farg1, farg2) & +bind(C, name="_wrap_FSUNAdaptController_Write_ImExGus") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_SetErrorBias_ImExGus(farg1, farg2) & +bind(C, name="_wrap_FSUNAdaptController_SetErrorBias_ImExGus") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_UpdateH_ImExGus(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNAdaptController_UpdateH_ImExGus") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_Space_ImExGus(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNAdaptController_Space_ImExGus") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FSUNAdaptController_ImExGus(sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNAdaptController), pointer :: swig_result +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = sunctx +fresult = swigc_FSUNAdaptController_ImExGus(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNAdaptController_SetParams_ImExGus(c, k1e, k2e, k1i, k2i) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +real(C_DOUBLE), intent(in) :: k1e +real(C_DOUBLE), intent(in) :: k2e +real(C_DOUBLE), intent(in) :: k1i +real(C_DOUBLE), intent(in) :: k2i +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 +real(C_DOUBLE) :: farg4 +real(C_DOUBLE) :: farg5 + +farg1 = c_loc(c) +farg2 = k1e +farg3 = k2e +farg4 = k1i +farg5 = k2i +fresult = swigc_FSUNAdaptController_SetParams_ImExGus(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNAdaptController_GetType_ImExGus(c) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNAdaptController_Type) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(c) +fresult = swigc_FSUNAdaptController_GetType_ImExGus(farg1) +swig_result = fresult +end function + +function FSUNAdaptController_EstimateStep_ImExGus(c, h, p, dsm, hnew) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +real(C_DOUBLE), intent(in) :: h +integer(C_INT), intent(in) :: p +real(C_DOUBLE), intent(in) :: dsm +real(C_DOUBLE), target, intent(inout) :: hnew +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 + +farg1 = c_loc(c) +farg2 = h +farg3 = p +farg4 = dsm +farg5 = c_loc(hnew) +fresult = swigc_FSUNAdaptController_EstimateStep_ImExGus(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNAdaptController_Reset_ImExGus(c) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(c) +fresult = swigc_FSUNAdaptController_Reset_ImExGus(farg1) +swig_result = fresult +end function + +function FSUNAdaptController_SetDefaults_ImExGus(c) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(c) +fresult = swigc_FSUNAdaptController_SetDefaults_ImExGus(farg1) +swig_result = fresult +end function + +function FSUNAdaptController_Write_ImExGus(c, fptr) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +type(C_PTR) :: fptr +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(c) +farg2 = fptr +fresult = swigc_FSUNAdaptController_Write_ImExGus(farg1, farg2) +swig_result = fresult +end function + +function FSUNAdaptController_SetErrorBias_ImExGus(c, bias) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +real(C_DOUBLE), intent(in) :: bias +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = c_loc(c) +farg2 = bias +fresult = swigc_FSUNAdaptController_SetErrorBias_ImExGus(farg1, farg2) +swig_result = fresult +end function + +function FSUNAdaptController_UpdateH_ImExGus(c, h, dsm) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +real(C_DOUBLE), intent(in) :: h +real(C_DOUBLE), intent(in) :: dsm +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = c_loc(c) +farg2 = h +farg3 = dsm +fresult = swigc_FSUNAdaptController_UpdateH_ImExGus(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNAdaptController_Space_ImExGus(c, lenrw, leniw) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +integer(C_LONG), dimension(*), target, intent(inout) :: lenrw +integer(C_LONG), dimension(*), target, intent(inout) :: leniw +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(c) +farg2 = c_loc(lenrw(1)) +farg3 = c_loc(leniw(1)) +fresult = swigc_FSUNAdaptController_Space_ImExGus(farg1, farg2, farg3) +swig_result = fresult +end function + + +end module diff --git a/src/sunadaptcontroller/imexgus/sunadaptcontroller_imexgus.c b/src/sunadaptcontroller/imexgus/sunadaptcontroller_imexgus.c new file mode 100644 index 0000000000..9f9f1d39ab --- /dev/null +++ b/src/sunadaptcontroller/imexgus/sunadaptcontroller_imexgus.c @@ -0,0 +1,230 @@ +/* ----------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + * ----------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2023, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * ----------------------------------------------------------------- + * This is the implementation file for the SUNAdaptController_ImExGus + * module. + * -----------------------------------------------------------------*/ + +#include +#include +#include +#include + + +/* --------------- + * Macro accessors + * --------------- */ + +#define SACIMEXGUS_CONTENT(C) ( (SUNAdaptControllerContent_ImExGus)(C->content) ) +#define SACIMEXGUS_K1E(C) ( SACIMEXGUS_CONTENT(C)->k1e ) +#define SACIMEXGUS_K2E(C) ( SACIMEXGUS_CONTENT(C)->k2e ) +#define SACIMEXGUS_K1I(C) ( SACIMEXGUS_CONTENT(C)->k1i ) +#define SACIMEXGUS_K2I(C) ( SACIMEXGUS_CONTENT(C)->k2i ) +#define SACIMEXGUS_BIAS(C) ( SACIMEXGUS_CONTENT(C)->bias ) +#define SACIMEXGUS_EP(C) ( SACIMEXGUS_CONTENT(C)->ep ) +#define SACIMEXGUS_HP(C) ( SACIMEXGUS_CONTENT(C)->hp ) +#define SACIMEXGUS_FIRSTSTEP(C) ( SACIMEXGUS_CONTENT(C)->firststep ) + +/* ------------------ + * Default parameters + * ------------------ */ + +#define DEFAULT_K1E RCONST(0.367) +#define DEFAULT_K2E RCONST(0.268) +#define DEFAULT_K1I RCONST(0.95) +#define DEFAULT_K2I RCONST(0.95) +#define DEFAULT_BIAS RCONST(1.5) +#define TINY RCONST(1.0e-10) + + +/* ----------------------------------------------------------------- + * exported functions + * ----------------------------------------------------------------- */ + +/* ----------------------------------------------------------------- + * Function to create a new ImExGus controller + */ + +SUNAdaptController SUNAdaptController_ImExGus(SUNContext sunctx) +{ + SUNAdaptController C; + SUNAdaptControllerContent_ImExGus content; + + if (sunctx == NULL) { return NULL; } + + /* Create an empty controller object */ + C = NULL; + C = SUNAdaptController_NewEmpty(sunctx); + if (C == NULL) { return (NULL); } + + /* Attach operations */ + C->ops->gettype = SUNAdaptController_GetType_ImExGus; + C->ops->estimatestep = SUNAdaptController_EstimateStep_ImExGus; + C->ops->reset = SUNAdaptController_Reset_ImExGus; + C->ops->setdefaults = SUNAdaptController_SetDefaults_ImExGus; + C->ops->write = SUNAdaptController_Write_ImExGus; + C->ops->seterrorbias = SUNAdaptController_SetErrorBias_ImExGus; + C->ops->updateh = SUNAdaptController_UpdateH_ImExGus; + C->ops->space = SUNAdaptController_Space_ImExGus; + + /* Create content */ + content = NULL; + content = (SUNAdaptControllerContent_ImExGus)malloc(sizeof *content); + if (content == NULL) + { + (void) SUNAdaptController_Destroy(C); + return (NULL); + } + + /* Attach content */ + C->content = content; + + /* Fill content with default/reset values */ + SUNAdaptController_SetDefaults_ImExGus(C); + SUNAdaptController_Reset_ImExGus(C); + + return (C); +} + +/* ----------------------------------------------------------------- + * Function to set ImExGus parameters + */ + +int SUNAdaptController_SetParams_ImExGus(SUNAdaptController C, + sunrealtype k1e, sunrealtype k2e, + sunrealtype k1i, sunrealtype k2i) +{ + if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + SACIMEXGUS_K1E(C) = k1e; + SACIMEXGUS_K2E(C) = k2e; + SACIMEXGUS_K1I(C) = k1i; + SACIMEXGUS_K2I(C) = k2i; + return SUNADAPTCONTROLLER_SUCCESS; +} + + + +/* ----------------------------------------------------------------- + * implementation of controller operations + * ----------------------------------------------------------------- */ + +SUNAdaptController_Type SUNAdaptController_GetType_ImExGus(SUNAdaptController C) +{ return SUN_ADAPTCONTROLLER_H; } + +int SUNAdaptController_EstimateStep_ImExGus(SUNAdaptController C, sunrealtype h, + int p, sunrealtype dsm, sunrealtype* hnew) +{ + /* order parameter to use */ + const int ord = p + 1; + + /* set usable time-step adaptivity parameters -- first step */ + const sunrealtype k = -RCONST(1.0) / ord; + const sunrealtype e = SUNMAX(SACIMEXGUS_BIAS(C) * dsm, TINY); + + /* set usable time-step adaptivity parameters -- subsequent steps */ + const sunrealtype k1e = -SACIMEXGUS_K1E(C) / ord; + const sunrealtype k2e = -SACIMEXGUS_K2E(C) / ord; + const sunrealtype k1i = -SACIMEXGUS_K1I(C) / ord; + const sunrealtype k2i = -SACIMEXGUS_K2I(C) / ord; + const sunrealtype e1 = SUNMAX(SACIMEXGUS_BIAS(C) * dsm, TINY); + const sunrealtype e2 = e1 / SUNMAX(SACIMEXGUS_EP(C), TINY); + const sunrealtype hrat = h / SACIMEXGUS_HP(C); + + if (C == NULL || hnew == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + + /* compute estimated time step size, modifying the first step formula */ + if (SACIMEXGUS_FIRSTSTEP(C)) + { + *hnew = h * SUNRpowerR(e,k); + } + else + { + *hnew = h * SUNMIN(hrat * SUNRpowerR(e1,k1i) * SUNRpowerR(e2,k2i), + SUNRpowerR(e1,k1e) * SUNRpowerR(e2,k2e)); + } + + /* return with success */ + return SUNADAPTCONTROLLER_SUCCESS; +} + +int SUNAdaptController_Reset_ImExGus(SUNAdaptController C) +{ + SACIMEXGUS_EP(C) = RCONST(1.0); + SACIMEXGUS_FIRSTSTEP(C) = SUNTRUE; + return SUNADAPTCONTROLLER_SUCCESS; +} + +int SUNAdaptController_SetDefaults_ImExGus(SUNAdaptController C) +{ + if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + SACIMEXGUS_K1E(C) = DEFAULT_K1E; + SACIMEXGUS_K2E(C) = DEFAULT_K2E; + SACIMEXGUS_K1I(C) = DEFAULT_K1I; + SACIMEXGUS_K2I(C) = DEFAULT_K2I; + SACIMEXGUS_BIAS(C) = DEFAULT_BIAS; + return SUNADAPTCONTROLLER_SUCCESS; +} + +int SUNAdaptController_Write_ImExGus(SUNAdaptController C, FILE *fptr) +{ + if (C == NULL || fptr == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + fprintf(fptr, "ImEx Gustafsson SUNAdaptController module:\n"); +#if defined(SUNDIALS_EXTENDED_PRECISION) + fprintf(fptr, " k1e = %32Lg\n", SACIMEXGUS_K1E(C)); + fprintf(fptr, " k2e = %32Lg\n", SACIMEXGUS_K2E(C)); + fprintf(fptr, " k1i = %32Lg\n", SACIMEXGUS_K1I(C)); + fprintf(fptr, " k2i = %32Lg\n", SACIMEXGUS_K2I(C)); + fprintf(fptr, " bias factor = %22Lg\n", SACIMEXGUS_BIAS(C)); + fprintf(fptr, " previous error = %22Lg\n", SACIMEXGUS_EP(C)); + fprintf(fptr, " previous step = %22Lg\n", SACIMEXGUS_HP(C)); +#else + fprintf(fptr, " k1e = %16g\n", SACIMEXGUS_K1E(C)); + fprintf(fptr, " k2e = %16g\n", SACIMEXGUS_K2E(C)); + fprintf(fptr, " k1i = %16g\n", SACIMEXGUS_K1I(C)); + fprintf(fptr, " k2i = %16g\n", SACIMEXGUS_K2I(C)); + fprintf(fptr, " bias factor = %16g\n", SACIMEXGUS_BIAS(C)); + fprintf(fptr, " previous error = %16g\n", SACIMEXGUS_EP(C)); + fprintf(fptr, " previous step = %16g\n", SACIMEXGUS_HP(C)); +#endif + return SUNADAPTCONTROLLER_SUCCESS; +} + +int SUNAdaptController_SetErrorBias_ImExGus(SUNAdaptController C, sunrealtype bias) +{ + if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + /* set allowed value, otherwise set default */ + if (bias <= RCONST(0.0)) { + SACIMEXGUS_BIAS(C) = DEFAULT_BIAS; + } else { + SACIMEXGUS_BIAS(C) = bias; + } + + return SUNADAPTCONTROLLER_SUCCESS; +} + +int SUNAdaptController_UpdateH_ImExGus(SUNAdaptController C, sunrealtype h, sunrealtype dsm) +{ + if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + SACIMEXGUS_EP(C) = SACIMEXGUS_BIAS(C) * dsm; + SACIMEXGUS_HP(C) = h; + SACIMEXGUS_FIRSTSTEP(C) = SUNFALSE; + return SUNADAPTCONTROLLER_SUCCESS; +} + +int SUNAdaptController_Space_ImExGus(SUNAdaptController C, long int* lenrw, long int* leniw) +{ + if (C == NULL || lenrw == NULL || leniw == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + *lenrw = 7; + *leniw = 1; + return SUNADAPTCONTROLLER_SUCCESS; +} diff --git a/src/sunadaptcontroller/soderlind/CMakeLists.txt b/src/sunadaptcontroller/soderlind/CMakeLists.txt new file mode 100644 index 0000000000..ef8ed40df0 --- /dev/null +++ b/src/sunadaptcontroller/soderlind/CMakeLists.txt @@ -0,0 +1,29 @@ +# --------------------------------------------------------------- +# Programmer(s): Daniel R. Reynolds @ SMU +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2023, Lawrence Livermore National Security +# and Southern Methodist University. +# All rights reserved. +# +# See the top-level LICENSE and NOTICE files for details. +# +# SPDX-License-Identifier: BSD-3-Clause +# SUNDIALS Copyright End +# --------------------------------------------------------------- + +# Create a library out of the generic sundials modules +sundials_add_library(sundials_sunadaptcontrollersoderlind + SOURCES + sunadaptcontroller_soderlind.c + HEADERS + ${SUNDIALS_SOURCE_DIR}/include/sunadaptcontroller/sunadaptcontroller_soderlind.h + INCLUDE_SUBDIR + sunadaptcontroller + OBJECT_LIB_ONLY +) + +# Add F2003 module if the interface is enabled +if(BUILD_FORTRAN_MODULE_INTERFACE) + add_subdirectory(fmod) +endif() diff --git a/src/sunadaptcontroller/soderlind/fmod/CMakeLists.txt b/src/sunadaptcontroller/soderlind/fmod/CMakeLists.txt new file mode 100644 index 0000000000..99cfdcbc0f --- /dev/null +++ b/src/sunadaptcontroller/soderlind/fmod/CMakeLists.txt @@ -0,0 +1,25 @@ +# --------------------------------------------------------------- +# Programmer(s): Daniel R. Reynolds @ SMU +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2023, Lawrence Livermore National Security +# and Southern Methodist University. +# All rights reserved. +# +# See the top-level LICENSE and NOTICE files for details. +# +# SPDX-License-Identifier: BSD-3-Clause +# SUNDIALS Copyright End +# --------------------------------------------------------------- + +sundials_add_f2003_library(sundials_fsunadaptcontrollersoderlind_mod + SOURCES + fsunadaptcontroller_soderlind_mod.f90 fsunadaptcontroller_soderlind_mod.c + OBJECT_LIBRARIES + sundials_fgeneric_mod_obj + OUTPUT_NAME + sundials_fsunadaptcontrollersoderlind_mod + OBJECT_LIB_ONLY +) + +message(STATUS "Added SUNAdaptController_Soderlind F2003 interface") diff --git a/src/sunadaptcontroller/soderlind/fmod/fsunadaptcontroller_soderlind_mod.c b/src/sunadaptcontroller/soderlind/fmod/fsunadaptcontroller_soderlind_mod.c new file mode 100644 index 0000000000..394e83cd3e --- /dev/null +++ b/src/sunadaptcontroller/soderlind/fmod/fsunadaptcontroller_soderlind_mod.c @@ -0,0 +1,501 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 4.0.0 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + +/* --------------------------------------------------------------- + * Programmer(s): Auto-generated by swig. + * --------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2023, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * -------------------------------------------------------------*/ + +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* qualifier for exported *const* global data variables*/ +#ifndef SWIGEXTERN +# ifdef __cplusplus +# define SWIGEXTERN extern +# else +# define SWIGEXTERN +# endif +#endif + +/* exporting methods */ +#if defined(__GNUC__) +# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + +/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ +#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) +# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 +#endif + +/* Intel's compiler complains if a variable which was never initialised is + * cast to void, which is a common idiom which we use to indicate that we + * are aware a variable isn't used. So we just silence that warning. + * See: https://github.com/swig/swig/issues/192 for more discussion. + */ +#ifdef __INTEL_COMPILER +# pragma warning disable 592 +#endif + +/* Errors in SWIG */ +#define SWIG_UnknownError -1 +#define SWIG_IOError -2 +#define SWIG_RuntimeError -3 +#define SWIG_IndexError -4 +#define SWIG_TypeError -5 +#define SWIG_DivisionByZero -6 +#define SWIG_OverflowError -7 +#define SWIG_SyntaxError -8 +#define SWIG_ValueError -9 +#define SWIG_SystemError -10 +#define SWIG_AttributeError -11 +#define SWIG_MemoryError -12 +#define SWIG_NullReferenceError -13 + + + + +#include +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include +#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) +# ifndef snprintf +# define snprintf _snprintf +# endif +#endif + + +/* Support for the `contract` feature. + * + * Note that RETURNNULL is first because it's inserted via a 'Replaceall' in + * the fortran.cxx file. + */ +#define SWIG_contract_assert(RETURNNULL, EXPR, MSG) \ + if (!(EXPR)) { SWIG_exception_impl("$decl", SWIG_ValueError, MSG, RETURNNULL); } + + +#define SWIGVERSION 0x040000 +#define SWIG_VERSION SWIGVERSION + + +#define SWIG_as_voidptr(a) (void *)((const void *)(a)) +#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) + + +#include "sundials/sundials_adaptcontroller.h" + + +#include "sunadaptcontroller/sunadaptcontroller_soderlind.h" + +SWIGEXPORT SUNAdaptController _wrap_FSUNAdaptController_Soderlind(void *farg1) { + SUNAdaptController fresult ; + SUNContext arg1 = (SUNContext) 0 ; + SUNAdaptController result; + + arg1 = (SUNContext)(farg1); + result = (SUNAdaptController)SUNAdaptController_Soderlind(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetParams_Soderlind(SUNAdaptController farg1, double const *farg2, double const *farg3, double const *farg4, double const *farg5, double const *farg6) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + sunrealtype arg4 ; + sunrealtype arg5 ; + sunrealtype arg6 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (sunrealtype)(*farg5); + arg6 = (sunrealtype)(*farg6); + result = (int)SUNAdaptController_SetParams_Soderlind(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_GetType_Soderlind(SUNAdaptController farg1) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + SUNAdaptController_Type result; + + arg1 = (SUNAdaptController)(farg1); + result = (SUNAdaptController_Type)SUNAdaptController_GetType_Soderlind(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_EstimateStep_Soderlind(SUNAdaptController farg1, double const *farg2, int const *farg3, double const *farg4, double *farg5) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + int arg3 ; + sunrealtype arg4 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (sunrealtype *)(farg5); + result = (int)SUNAdaptController_EstimateStep_Soderlind(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_Reset_Soderlind(SUNAdaptController farg1) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + result = (int)SUNAdaptController_Reset_Soderlind(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetDefaults_Soderlind(SUNAdaptController farg1) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + result = (int)SUNAdaptController_SetDefaults_Soderlind(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_Write_Soderlind(SUNAdaptController farg1, void *farg2) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + FILE *arg2 = (FILE *) 0 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (FILE *)(farg2); + result = (int)SUNAdaptController_Write_Soderlind(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetErrorBias_Soderlind(SUNAdaptController farg1, double const *farg2) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)SUNAdaptController_SetErrorBias_Soderlind(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_UpdateH_Soderlind(SUNAdaptController farg1, double const *farg2, double const *farg3) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)SUNAdaptController_UpdateH_Soderlind(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_Space_Soderlind(SUNAdaptController farg1, long *farg2, long *farg3) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)SUNAdaptController_Space_Soderlind(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SUNAdaptController _wrap_FSUNAdaptController_PID(void *farg1) { + SUNAdaptController fresult ; + SUNContext arg1 = (SUNContext) 0 ; + SUNAdaptController result; + + arg1 = (SUNContext)(farg1); + result = (SUNAdaptController)SUNAdaptController_PID(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetParams_PID(SUNAdaptController farg1, double const *farg2, double const *farg3, double const *farg4) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + sunrealtype arg4 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); + result = (int)SUNAdaptController_SetParams_PID(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SUNAdaptController _wrap_FSUNAdaptController_PI(void *farg1) { + SUNAdaptController fresult ; + SUNContext arg1 = (SUNContext) 0 ; + SUNAdaptController result; + + arg1 = (SUNContext)(farg1); + result = (SUNAdaptController)SUNAdaptController_PI(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetParams_PI(SUNAdaptController farg1, double const *farg2, double const *farg3) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)SUNAdaptController_SetParams_PI(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SUNAdaptController _wrap_FSUNAdaptController_I(void *farg1) { + SUNAdaptController fresult ; + SUNContext arg1 = (SUNContext) 0 ; + SUNAdaptController result; + + arg1 = (SUNContext)(farg1); + result = (SUNAdaptController)SUNAdaptController_I(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetParams_I(SUNAdaptController farg1, double const *farg2) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)SUNAdaptController_SetParams_I(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SUNAdaptController _wrap_FSUNAdaptController_ExpGus(void *farg1) { + SUNAdaptController fresult ; + SUNContext arg1 = (SUNContext) 0 ; + SUNAdaptController result; + + arg1 = (SUNContext)(farg1); + result = (SUNAdaptController)SUNAdaptController_ExpGus(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetParams_ExpGus(SUNAdaptController farg1, double const *farg2, double const *farg3) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)SUNAdaptController_SetParams_ExpGus(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SUNAdaptController _wrap_FSUNAdaptController_ImpGus(void *farg1) { + SUNAdaptController fresult ; + SUNContext arg1 = (SUNContext) 0 ; + SUNAdaptController result; + + arg1 = (SUNContext)(farg1); + result = (SUNAdaptController)SUNAdaptController_ImpGus(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetParams_ImpGus(SUNAdaptController farg1, double const *farg2, double const *farg3) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)SUNAdaptController_SetParams_ImpGus(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + + diff --git a/src/sunadaptcontroller/soderlind/fmod/fsunadaptcontroller_soderlind_mod.f90 b/src/sunadaptcontroller/soderlind/fmod/fsunadaptcontroller_soderlind_mod.f90 new file mode 100644 index 0000000000..720482cd6f --- /dev/null +++ b/src/sunadaptcontroller/soderlind/fmod/fsunadaptcontroller_soderlind_mod.f90 @@ -0,0 +1,579 @@ +! This file was automatically generated by SWIG (http://www.swig.org). +! Version 4.0.0 +! +! Do not make changes to this file unless you know what you are doing--modify +! the SWIG interface file instead. + +! --------------------------------------------------------------- +! Programmer(s): Auto-generated by swig. +! --------------------------------------------------------------- +! SUNDIALS Copyright Start +! Copyright (c) 2002-2023, Lawrence Livermore National Security +! and Southern Methodist University. +! All rights reserved. +! +! See the top-level LICENSE and NOTICE files for details. +! +! SPDX-License-Identifier: BSD-3-Clause +! SUNDIALS Copyright End +! --------------------------------------------------------------- + +module fsunadaptcontroller_soderlind_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_adaptcontroller_mod + use fsundials_types_mod + use fsundials_context_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + public :: FSUNAdaptController_Soderlind + public :: FSUNAdaptController_SetParams_Soderlind + public :: FSUNAdaptController_GetType_Soderlind + public :: FSUNAdaptController_EstimateStep_Soderlind + public :: FSUNAdaptController_Reset_Soderlind + public :: FSUNAdaptController_SetDefaults_Soderlind + public :: FSUNAdaptController_Write_Soderlind + public :: FSUNAdaptController_SetErrorBias_Soderlind + public :: FSUNAdaptController_UpdateH_Soderlind + public :: FSUNAdaptController_Space_Soderlind + public :: FSUNAdaptController_PID + public :: FSUNAdaptController_SetParams_PID + public :: FSUNAdaptController_PI + public :: FSUNAdaptController_SetParams_PI + public :: FSUNAdaptController_I + public :: FSUNAdaptController_SetParams_I + public :: FSUNAdaptController_ExpGus + public :: FSUNAdaptController_SetParams_ExpGus + public :: FSUNAdaptController_ImpGus + public :: FSUNAdaptController_SetParams_ImpGus + +! WRAPPER DECLARATIONS +interface +function swigc_FSUNAdaptController_Soderlind(farg1) & +bind(C, name="_wrap_FSUNAdaptController_Soderlind") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FSUNAdaptController_SetParams_Soderlind(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FSUNAdaptController_SetParams_Soderlind") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +real(C_DOUBLE), intent(in) :: farg5 +real(C_DOUBLE), intent(in) :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_GetType_Soderlind(farg1) & +bind(C, name="_wrap_FSUNAdaptController_GetType_Soderlind") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_EstimateStep_Soderlind(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNAdaptController_EstimateStep_Soderlind") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_Reset_Soderlind(farg1) & +bind(C, name="_wrap_FSUNAdaptController_Reset_Soderlind") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_SetDefaults_Soderlind(farg1) & +bind(C, name="_wrap_FSUNAdaptController_SetDefaults_Soderlind") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_Write_Soderlind(farg1, farg2) & +bind(C, name="_wrap_FSUNAdaptController_Write_Soderlind") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_SetErrorBias_Soderlind(farg1, farg2) & +bind(C, name="_wrap_FSUNAdaptController_SetErrorBias_Soderlind") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_UpdateH_Soderlind(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNAdaptController_UpdateH_Soderlind") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_Space_Soderlind(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNAdaptController_Space_Soderlind") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_PID(farg1) & +bind(C, name="_wrap_FSUNAdaptController_PID") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FSUNAdaptController_SetParams_PID(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNAdaptController_SetParams_PID") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_PI(farg1) & +bind(C, name="_wrap_FSUNAdaptController_PI") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FSUNAdaptController_SetParams_PI(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNAdaptController_SetParams_PI") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_I(farg1) & +bind(C, name="_wrap_FSUNAdaptController_I") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FSUNAdaptController_SetParams_I(farg1, farg2) & +bind(C, name="_wrap_FSUNAdaptController_SetParams_I") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_ExpGus(farg1) & +bind(C, name="_wrap_FSUNAdaptController_ExpGus") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FSUNAdaptController_SetParams_ExpGus(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNAdaptController_SetParams_ExpGus") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_ImpGus(farg1) & +bind(C, name="_wrap_FSUNAdaptController_ImpGus") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FSUNAdaptController_SetParams_ImpGus(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNAdaptController_SetParams_ImpGus") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FSUNAdaptController_Soderlind(sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNAdaptController), pointer :: swig_result +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = sunctx +fresult = swigc_FSUNAdaptController_Soderlind(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNAdaptController_SetParams_Soderlind(c, k1, k2, k3, k4, k5) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +real(C_DOUBLE), intent(in) :: k1 +real(C_DOUBLE), intent(in) :: k2 +real(C_DOUBLE), intent(in) :: k3 +real(C_DOUBLE), intent(in) :: k4 +real(C_DOUBLE), intent(in) :: k5 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 +real(C_DOUBLE) :: farg4 +real(C_DOUBLE) :: farg5 +real(C_DOUBLE) :: farg6 + +farg1 = c_loc(c) +farg2 = k1 +farg3 = k2 +farg4 = k3 +farg5 = k4 +farg6 = k5 +fresult = swigc_FSUNAdaptController_SetParams_Soderlind(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FSUNAdaptController_GetType_Soderlind(c) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNAdaptController_Type) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(c) +fresult = swigc_FSUNAdaptController_GetType_Soderlind(farg1) +swig_result = fresult +end function + +function FSUNAdaptController_EstimateStep_Soderlind(c, h, p, dsm, hnew) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +real(C_DOUBLE), intent(in) :: h +integer(C_INT), intent(in) :: p +real(C_DOUBLE), intent(in) :: dsm +real(C_DOUBLE), target, intent(inout) :: hnew +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 + +farg1 = c_loc(c) +farg2 = h +farg3 = p +farg4 = dsm +farg5 = c_loc(hnew) +fresult = swigc_FSUNAdaptController_EstimateStep_Soderlind(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNAdaptController_Reset_Soderlind(c) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(c) +fresult = swigc_FSUNAdaptController_Reset_Soderlind(farg1) +swig_result = fresult +end function + +function FSUNAdaptController_SetDefaults_Soderlind(c) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(c) +fresult = swigc_FSUNAdaptController_SetDefaults_Soderlind(farg1) +swig_result = fresult +end function + +function FSUNAdaptController_Write_Soderlind(c, fptr) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +type(C_PTR) :: fptr +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(c) +farg2 = fptr +fresult = swigc_FSUNAdaptController_Write_Soderlind(farg1, farg2) +swig_result = fresult +end function + +function FSUNAdaptController_SetErrorBias_Soderlind(c, bias) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +real(C_DOUBLE), intent(in) :: bias +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = c_loc(c) +farg2 = bias +fresult = swigc_FSUNAdaptController_SetErrorBias_Soderlind(farg1, farg2) +swig_result = fresult +end function + +function FSUNAdaptController_UpdateH_Soderlind(c, h, dsm) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +real(C_DOUBLE), intent(in) :: h +real(C_DOUBLE), intent(in) :: dsm +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = c_loc(c) +farg2 = h +farg3 = dsm +fresult = swigc_FSUNAdaptController_UpdateH_Soderlind(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNAdaptController_Space_Soderlind(c, lenrw, leniw) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +integer(C_LONG), dimension(*), target, intent(inout) :: lenrw +integer(C_LONG), dimension(*), target, intent(inout) :: leniw +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(c) +farg2 = c_loc(lenrw(1)) +farg3 = c_loc(leniw(1)) +fresult = swigc_FSUNAdaptController_Space_Soderlind(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNAdaptController_PID(sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNAdaptController), pointer :: swig_result +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = sunctx +fresult = swigc_FSUNAdaptController_PID(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNAdaptController_SetParams_PID(c, k1, k2, k3) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +real(C_DOUBLE), intent(in) :: k1 +real(C_DOUBLE), intent(in) :: k2 +real(C_DOUBLE), intent(in) :: k3 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 +real(C_DOUBLE) :: farg4 + +farg1 = c_loc(c) +farg2 = k1 +farg3 = k2 +farg4 = k3 +fresult = swigc_FSUNAdaptController_SetParams_PID(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FSUNAdaptController_PI(sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNAdaptController), pointer :: swig_result +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = sunctx +fresult = swigc_FSUNAdaptController_PI(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNAdaptController_SetParams_PI(c, k1, k2) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +real(C_DOUBLE), intent(in) :: k1 +real(C_DOUBLE), intent(in) :: k2 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = c_loc(c) +farg2 = k1 +farg3 = k2 +fresult = swigc_FSUNAdaptController_SetParams_PI(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNAdaptController_I(sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNAdaptController), pointer :: swig_result +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = sunctx +fresult = swigc_FSUNAdaptController_I(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNAdaptController_SetParams_I(c, k1) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +real(C_DOUBLE), intent(in) :: k1 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = c_loc(c) +farg2 = k1 +fresult = swigc_FSUNAdaptController_SetParams_I(farg1, farg2) +swig_result = fresult +end function + +function FSUNAdaptController_ExpGus(sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNAdaptController), pointer :: swig_result +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = sunctx +fresult = swigc_FSUNAdaptController_ExpGus(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNAdaptController_SetParams_ExpGus(c, k1, k2) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +real(C_DOUBLE), intent(in) :: k1 +real(C_DOUBLE), intent(in) :: k2 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = c_loc(c) +farg2 = k1 +farg3 = k2 +fresult = swigc_FSUNAdaptController_SetParams_ExpGus(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNAdaptController_ImpGus(sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNAdaptController), pointer :: swig_result +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = sunctx +fresult = swigc_FSUNAdaptController_ImpGus(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNAdaptController_SetParams_ImpGus(c, k1, k2) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +real(C_DOUBLE), intent(in) :: k1 +real(C_DOUBLE), intent(in) :: k2 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = c_loc(c) +farg2 = k1 +farg3 = k2 +fresult = swigc_FSUNAdaptController_SetParams_ImpGus(farg1, farg2, farg3) +swig_result = fresult +end function + + +end module diff --git a/src/sunadaptcontroller/soderlind/sunadaptcontroller_soderlind.c b/src/sunadaptcontroller/soderlind/sunadaptcontroller_soderlind.c new file mode 100644 index 0000000000..4d16ac8f09 --- /dev/null +++ b/src/sunadaptcontroller/soderlind/sunadaptcontroller_soderlind.c @@ -0,0 +1,444 @@ +/* ----------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + * ----------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2023, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * ----------------------------------------------------------------- + * This is the implementation file for the + * SUNAdaptController_Soderlind module. + * -----------------------------------------------------------------*/ + +#include +#include +#include +#include + + +/* --------------- + * Macro accessors + * --------------- */ + +#define SODERLIND_CONTENT(C) ( (SUNAdaptControllerContent_Soderlind)(C->content) ) +#define SODERLIND_K1(C) ( SODERLIND_CONTENT(C)->k1 ) +#define SODERLIND_K2(C) ( SODERLIND_CONTENT(C)->k2 ) +#define SODERLIND_K3(C) ( SODERLIND_CONTENT(C)->k3 ) +#define SODERLIND_K4(C) ( SODERLIND_CONTENT(C)->k4 ) +#define SODERLIND_K5(C) ( SODERLIND_CONTENT(C)->k5 ) +#define SODERLIND_BIAS(C) ( SODERLIND_CONTENT(C)->bias ) +#define SODERLIND_EP(C) ( SODERLIND_CONTENT(C)->ep ) +#define SODERLIND_EPP(C) ( SODERLIND_CONTENT(C)->epp ) +#define SODERLIND_HP(C) ( SODERLIND_CONTENT(C)->hp ) +#define SODERLIND_HPP(C) ( SODERLIND_CONTENT(C)->hpp ) +#define SODERLIND_FIRSTSTEPS(C) ( SODERLIND_CONTENT(C)->firststeps ) + +/* ------------------ + * Default parameters + * ------------------ */ + +#define DEFAULT_K1 RCONST(1.25) /* H_{0}321 parameters */ +#define DEFAULT_K2 RCONST(0.5) +#define DEFAULT_K3 RCONST(-0.75) +#define DEFAULT_K4 RCONST(0.25) +#define DEFAULT_K5 RCONST(0.75) +#define DEFAULT_PID_K1 RCONST(0.58) /* PID parameters */ +#define DEFAULT_PID_K2 -RCONST(0.21) +#define DEFAULT_PID_K3 RCONST(0.1) +#define DEFAULT_PI_K1 RCONST(0.8) /* PI parameters */ +#define DEFAULT_PI_K2 -RCONST(0.31) +#define DEFAULT_I_K1 RCONST(1.0) /* I parameters */ +#define DEFAULT_EXPGUS_K1 RCONST(0.367) /* Explicit Gustafsson parameters */ +#define DEFAULT_EXPGUS_K2 RCONST(0.268) +#define DEFAULT_IMPGUS_K1 RCONST(0.98) /* Implicit Gustafsson parameters */ +#define DEFAULT_IMPGUS_K2 RCONST(0.95) +#define DEFAULT_BIAS RCONST(1.5) +#define TINY RCONST(1.0e-10) + + +/* ----------------------------------------------------------------- + * exported functions + * ----------------------------------------------------------------- */ + +/* ----------------------------------------------------------------- + * Function to create a new Soderlind controller + */ + +SUNAdaptController SUNAdaptController_Soderlind(SUNContext sunctx) +{ + SUNAdaptController C; + SUNAdaptControllerContent_Soderlind content; + + if (sunctx == NULL) { return NULL; } + + /* Create an empty controller object */ + C = NULL; + C = SUNAdaptController_NewEmpty(sunctx); + if (C == NULL) { return (NULL); } + + /* Attach operations */ + C->ops->gettype = SUNAdaptController_GetType_Soderlind; + C->ops->estimatestep = SUNAdaptController_EstimateStep_Soderlind; + C->ops->reset = SUNAdaptController_Reset_Soderlind; + C->ops->setdefaults = SUNAdaptController_SetDefaults_Soderlind; + C->ops->write = SUNAdaptController_Write_Soderlind; + C->ops->seterrorbias = SUNAdaptController_SetErrorBias_Soderlind; + C->ops->updateh = SUNAdaptController_UpdateH_Soderlind; + C->ops->space = SUNAdaptController_Space_Soderlind; + + /* Create content */ + content = NULL; + content = (SUNAdaptControllerContent_Soderlind)malloc(sizeof *content); + if (content == NULL) + { + (void) SUNAdaptController_Destroy(C); + return (NULL); + } + + /* Attach content */ + C->content = content; + + /* Fill content with default/reset values */ + SUNAdaptController_SetDefaults_Soderlind(C); + SUNAdaptController_Reset_Soderlind(C); + + return (C); +} + +/* ----------------------------------------------------------------- + * Function to set Soderlind parameters + */ + +int SUNAdaptController_SetParams_Soderlind(SUNAdaptController C, + sunrealtype k1, sunrealtype k2, + sunrealtype k3, sunrealtype k4, + sunrealtype k5) +{ + if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + SODERLIND_K1(C) = k1; + SODERLIND_K2(C) = k2; + SODERLIND_K3(C) = k3; + SODERLIND_K4(C) = k4; + SODERLIND_K5(C) = k5; + return SUNADAPTCONTROLLER_SUCCESS; +} + +/* ----------------------------------------------------------------- + * Function to create a PID controller (subset of Soderlind) + */ + +SUNAdaptController SUNAdaptController_PID(SUNContext sunctx) +{ + SUNAdaptController C; + int retval; + if (sunctx == NULL) { return NULL; } + C = SUNAdaptController_Soderlind(sunctx); + if (C == NULL) { return NULL; } + retval = SUNAdaptController_SetParams_PID(C, + DEFAULT_PID_K1, + DEFAULT_PID_K2, + DEFAULT_PID_K3); + if (retval != SUNADAPTCONTROLLER_SUCCESS) { + (void) SUNAdaptController_Destroy(C); + C = NULL; + } + return (C); +} + +/* ----------------------------------------------------------------- + * Function to set PID parameters + */ + +int SUNAdaptController_SetParams_PID(SUNAdaptController C, + sunrealtype k1, sunrealtype k2, + sunrealtype k3) +{ + if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + SODERLIND_K1(C) = k1; + SODERLIND_K2(C) = k2; + SODERLIND_K3(C) = k3; + SODERLIND_K4(C) = RCONST(0.0); + SODERLIND_K5(C) = RCONST(0.0); + return SUNADAPTCONTROLLER_SUCCESS; +} + +/* ----------------------------------------------------------------- + * Function to create a PI controller (subset of Soderlind) + */ + +SUNAdaptController SUNAdaptController_PI(SUNContext sunctx) +{ + SUNAdaptController C; + int retval; + if (sunctx == NULL) { return NULL; } + C = SUNAdaptController_Soderlind(sunctx); + if (C == NULL) { return NULL; } + retval = SUNAdaptController_SetParams_PI(C, + DEFAULT_PI_K1, + DEFAULT_PI_K2); + if (retval != SUNADAPTCONTROLLER_SUCCESS) { + (void) SUNAdaptController_Destroy(C); + C = NULL; + } + return (C); +} + +/* ----------------------------------------------------------------- + * Function to set PI parameters + */ + +int SUNAdaptController_SetParams_PI(SUNAdaptController C, + sunrealtype k1, sunrealtype k2) +{ + if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + SODERLIND_K1(C) = k1; + SODERLIND_K2(C) = k2; + SODERLIND_K3(C) = RCONST(0.0); + SODERLIND_K4(C) = RCONST(0.0); + SODERLIND_K5(C) = RCONST(0.0); + return SUNADAPTCONTROLLER_SUCCESS; +} + +/* ----------------------------------------------------------------- + * Function to create an I controller (subset of Soderlind) + */ + +SUNAdaptController SUNAdaptController_I(SUNContext sunctx) +{ + SUNAdaptController C; + int retval; + if (sunctx == NULL) { return NULL; } + C = SUNAdaptController_Soderlind(sunctx); + if (C == NULL) { return NULL; } + retval = SUNAdaptController_SetParams_I(C, DEFAULT_I_K1); + if (retval != SUNADAPTCONTROLLER_SUCCESS) { + (void) SUNAdaptController_Destroy(C); + C = NULL; + } + return (C); +} + +/* ----------------------------------------------------------------- + * Function to set PI parameters + */ + +int SUNAdaptController_SetParams_I(SUNAdaptController C, sunrealtype k1) +{ + if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + SODERLIND_K1(C) = k1; + SODERLIND_K2(C) = RCONST(0.0); + SODERLIND_K3(C) = RCONST(0.0); + SODERLIND_K4(C) = RCONST(0.0); + SODERLIND_K5(C) = RCONST(0.0); + return SUNADAPTCONTROLLER_SUCCESS; +} + +/* ----------------------------------------------------------------- + * Function to create an explicit Gustafsson controller + */ + +SUNAdaptController SUNAdaptController_ExpGus(SUNContext sunctx) +{ + SUNAdaptController C; + int retval; + if (sunctx == NULL) { return NULL; } + C = SUNAdaptController_Soderlind(sunctx); + if (C == NULL) { return NULL; } + retval = SUNAdaptController_SetParams_ExpGus(C, + DEFAULT_EXPGUS_K1, + DEFAULT_EXPGUS_K2); + if (retval != SUNADAPTCONTROLLER_SUCCESS) { + (void) SUNAdaptController_Destroy(C); + C = NULL; + } + return (C); +} + +/* ----------------------------------------------------------------- + * Function to set explicit Gustafsson parameters + */ + +int SUNAdaptController_SetParams_ExpGus(SUNAdaptController C, + sunrealtype k1, sunrealtype k2) +{ + if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + SODERLIND_K1(C) = k1+k2; + SODERLIND_K2(C) = -k2; + SODERLIND_K3(C) = RCONST(0.0); + SODERLIND_K4(C) = RCONST(0.0); + SODERLIND_K5(C) = RCONST(0.0); + return SUNADAPTCONTROLLER_SUCCESS; +} + +/* ----------------------------------------------------------------- + * Function to create an implicit Gustafsson controller + */ + +SUNAdaptController SUNAdaptController_ImpGus(SUNContext sunctx) +{ + SUNAdaptController C; + int retval; + if (sunctx == NULL) { return NULL; } + C = SUNAdaptController_Soderlind(sunctx); + if (C == NULL) { return NULL; } + retval = SUNAdaptController_SetParams_ImpGus(C, + DEFAULT_IMPGUS_K1, + DEFAULT_IMPGUS_K2); + if (retval != SUNADAPTCONTROLLER_SUCCESS) { + (void) SUNAdaptController_Destroy(C); + C = NULL; + } + return (C); +} + +/* ----------------------------------------------------------------- + * Function to set explicit Gustafsson parameters + */ + +int SUNAdaptController_SetParams_ImpGus(SUNAdaptController C, + sunrealtype k1, sunrealtype k2) +{ + if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + SODERLIND_K1(C) = k1+k2; + SODERLIND_K2(C) = -k2; + SODERLIND_K3(C) = RCONST(0.0); + SODERLIND_K4(C) = RCONST(1.0); + SODERLIND_K5(C) = RCONST(0.0); + return SUNADAPTCONTROLLER_SUCCESS; +} + + + +/* ----------------------------------------------------------------- + * implementation of controller operations + * ----------------------------------------------------------------- */ + +SUNAdaptController_Type SUNAdaptController_GetType_Soderlind(SUNAdaptController C) +{ return SUN_ADAPTCONTROLLER_H; } + +int SUNAdaptController_EstimateStep_Soderlind(SUNAdaptController C, sunrealtype h, + int p, sunrealtype dsm, sunrealtype* hnew) +{ + /* order parameter to use */ + const int ord = p + 1; + + /* set usable time-step adaptivity parameters */ + const sunrealtype k1 = -SODERLIND_K1(C) / ord; + const sunrealtype k2 = -SODERLIND_K2(C) / ord; + const sunrealtype k3 = -SODERLIND_K3(C) / ord; + const sunrealtype k4 = SODERLIND_K4(C); + const sunrealtype k5 = SODERLIND_K5(C); + const sunrealtype e1 = SUNMAX(SODERLIND_BIAS(C) * dsm, TINY); + const sunrealtype e2 = SUNMAX(SODERLIND_EP(C), TINY); + const sunrealtype e3 = SUNMAX(SODERLIND_EPP(C), TINY); + const sunrealtype hrat = h / SODERLIND_HP(C); + const sunrealtype hrat2 = SODERLIND_HP(C) / SODERLIND_HPP(C); + + if (C == NULL || hnew == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + + /* compute estimated optimal time step size */ + if (SODERLIND_FIRSTSTEPS(C) < 1) { + *hnew = h * SUNRpowerR(e1,k1); + } else if (SODERLIND_FIRSTSTEPS(C) < 2) { + *hnew = h * SUNRpowerR(e1,k1) * SUNRpowerR(e2,k2) * SUNRpowerR(hrat,k4); + } else { + *hnew = h * SUNRpowerR(e1,k1) * SUNRpowerR(e2,k2) * SUNRpowerR(e3,k3) + * SUNRpowerR(hrat,k4) * SUNRpowerR(hrat2,k5); + } + + /* return with success */ + return SUNADAPTCONTROLLER_SUCCESS; +} + +int SUNAdaptController_Reset_Soderlind(SUNAdaptController C) +{ + if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + SODERLIND_EP(C) = RCONST(1.0); + SODERLIND_EPP(C) = RCONST(1.0); + SODERLIND_HP(C) = RCONST(1.0); + SODERLIND_HPP(C) = RCONST(1.0); + SODERLIND_FIRSTSTEPS(C) = 0; + return SUNADAPTCONTROLLER_SUCCESS; +} + +int SUNAdaptController_SetDefaults_Soderlind(SUNAdaptController C) +{ + if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + SODERLIND_K1(C) = DEFAULT_K1; + SODERLIND_K2(C) = DEFAULT_K2; + SODERLIND_K3(C) = DEFAULT_K3; + SODERLIND_K4(C) = DEFAULT_K4; + SODERLIND_K5(C) = DEFAULT_K5; + SODERLIND_BIAS(C) = DEFAULT_BIAS; + return SUNADAPTCONTROLLER_SUCCESS; +} + +int SUNAdaptController_Write_Soderlind(SUNAdaptController C, FILE *fptr) +{ + if (C == NULL || fptr == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + fprintf(fptr, "Soderlind SUNAdaptController module:\n"); +#if defined(SUNDIALS_EXTENDED_PRECISION) + fprintf(fptr, " k1 = %32Lg\n", SODERLIND_K1(C)); + fprintf(fptr, " k2 = %32Lg\n", SODERLIND_K2(C)); + fprintf(fptr, " k3 = %32Lg\n", SODERLIND_K3(C)); + fprintf(fptr, " k4 = %32Lg\n", SODERLIND_K4(C)); + fprintf(fptr, " k5 = %32Lg\n", SODERLIND_K5(C)); + fprintf(fptr, " bias factor = %22Lg\n", SODERLIND_BIAS(C)); + fprintf(fptr, " previous error = %22Lg\n", SODERLIND_EP(C)); + fprintf(fptr, " previous-previous error = %22Lg\n", SODERLIND_EPP(C)); + fprintf(fptr, " previous step = %22Lg\n", SODERLIND_HP(C)); + fprintf(fptr, " previous-previous step = %22Lg\n", SODERLIND_HPP(C)); +#else + fprintf(fptr, " k1 = %16g\n", SODERLIND_K1(C)); + fprintf(fptr, " k2 = %16g\n", SODERLIND_K2(C)); + fprintf(fptr, " k3 = %16g\n", SODERLIND_K3(C)); + fprintf(fptr, " k4 = %16g\n", SODERLIND_K4(C)); + fprintf(fptr, " k5 = %16g\n", SODERLIND_K5(C)); + fprintf(fptr, " bias factor = %16g\n", SODERLIND_BIAS(C)); + fprintf(fptr, " previous error = %16g\n", SODERLIND_EP(C)); + fprintf(fptr, " previous-previous error = %16g\n", SODERLIND_EPP(C)); + fprintf(fptr, " previous step = %16g\n", SODERLIND_HP(C)); + fprintf(fptr, " previous-previous step = %16g\n", SODERLIND_HPP(C)); +#endif + fprintf(fptr, " firststeps = %i\n", SODERLIND_FIRSTSTEPS(C)); + return SUNADAPTCONTROLLER_SUCCESS; +} + +int SUNAdaptController_SetErrorBias_Soderlind(SUNAdaptController C, sunrealtype bias) +{ + if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + /* set allowed value, otherwise set default */ + if (bias <= RCONST(0.0)) { + SODERLIND_BIAS(C) = DEFAULT_BIAS; + } else { + SODERLIND_BIAS(C) = bias; + } + + return SUNADAPTCONTROLLER_SUCCESS; +} + +int SUNAdaptController_UpdateH_Soderlind(SUNAdaptController C, sunrealtype h, sunrealtype dsm) +{ + if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + SODERLIND_EPP(C) = SODERLIND_EP(C); + SODERLIND_EP(C) = SODERLIND_BIAS(C) * dsm; + SODERLIND_HPP(C) = SODERLIND_HP(C); + SODERLIND_HP(C) = h; + if (SODERLIND_FIRSTSTEPS(C) < 2) { + SODERLIND_FIRSTSTEPS(C) += 1; + } + return SUNADAPTCONTROLLER_SUCCESS; +} + +int SUNAdaptController_Space_Soderlind(SUNAdaptController C, long int* lenrw, long int* leniw) +{ + if (C == NULL || lenrw == NULL || leniw == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + *lenrw = 10; + *leniw = 1; + return SUNADAPTCONTROLLER_SUCCESS; +} diff --git a/src/sundials/CMakeLists.txt b/src/sundials/CMakeLists.txt index 08afde2570..df5af04cd6 100644 --- a/src/sundials/CMakeLists.txt +++ b/src/sundials/CMakeLists.txt @@ -21,6 +21,7 @@ install(CODE "MESSAGE(\"\nInstall shared components\n\")") # Add variable sundials_HEADERS with the exported SUNDIALS header files set(sundials_HEADERS + sundials_adaptcontroller.h sundials_base.hpp sundials_band.h sundials_context.h @@ -78,6 +79,7 @@ endif() add_prefix(${SUNDIALS_SOURCE_DIR}/include/sundials/ sundials_HEADERS) set(sundials_SOURCES + sundials_adaptcontroller.c sundials_band.c sundials_context.c sundials_dense.c @@ -106,18 +108,12 @@ endif() # Add prefix with complete path to the source files add_prefix(${SUNDIALS_SOURCE_DIR}/src/sundials/ sundials_SOURCES) -if(SUNDIALS_BUILD_WITH_PROFILING OR SUNDIALS_LOGGING_ENABLE_MPI) +if(SUNDIALS_LOGGING_ENABLE_MPI) if(ENABLE_MPI AND MPI_C_FOUND) # Workaround bug in CMake < 3.17.3 when using MPI::MPI_CXX and CUDA set(_include_mpi_if_needed PUBLIC ${MPI_C_INCLUDE_DIRS}) set(_link_mpi_if_needed PUBLIC ${MPI_C_LIBRARIES}) endif() - if(ENABLE_CALIPER) - set(_link_caliper_if_needed PUBLIC caliper) - endif() - if(ENABLE_ADIAK) - set(_link_adiak_if_needed PUBLIC adiak::adiak ${CMAKE_DL_LIBS}) - endif() endif() # Create a library out of the generic sundials modules @@ -132,8 +128,6 @@ sundials_add_library(sundials_generic ${_include_mpi_if_needed} LINK_LIBRARIES ${_link_mpi_if_needed} - ${_link_caliper_if_needed} - ${_link_adiak_if_needed} OUTPUT_NAME sundials_generic VERSION diff --git a/src/sundials/fmod/CMakeLists.txt b/src/sundials/fmod/CMakeLists.txt index e3e05f4cd7..94325ce9d8 100644 --- a/src/sundials/fmod/CMakeLists.txt +++ b/src/sundials/fmod/CMakeLists.txt @@ -30,7 +30,9 @@ set(sundials_SOURCES fsundials_types_mod.f90 fsundials_types_mod.c fsundials_context_mod.f90 - fsundials_context_mod.c) + fsundials_context_mod.c + fsundials_adaptcontroller_mod.f90 + fsundials_adaptcontroller_mod.c) if(SUNDIALS_BUILD_WITH_PROFILING) list(APPEND sundials_SOURCES diff --git a/src/sundials/fmod/fsundials_adaptcontroller_mod.c b/src/sundials/fmod/fsundials_adaptcontroller_mod.c new file mode 100644 index 0000000000..9ece239fdc --- /dev/null +++ b/src/sundials/fmod/fsundials_adaptcontroller_mod.c @@ -0,0 +1,333 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 4.0.0 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* qualifier for exported *const* global data variables*/ +#ifndef SWIGEXTERN +# ifdef __cplusplus +# define SWIGEXTERN extern +# else +# define SWIGEXTERN +# endif +#endif + +/* exporting methods */ +#if defined(__GNUC__) +# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + +/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ +#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) +# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 +#endif + +/* Intel's compiler complains if a variable which was never initialised is + * cast to void, which is a common idiom which we use to indicate that we + * are aware a variable isn't used. So we just silence that warning. + * See: https://github.com/swig/swig/issues/192 for more discussion. + */ +#ifdef __INTEL_COMPILER +# pragma warning disable 592 +#endif + +/* Errors in SWIG */ +#define SWIG_UnknownError -1 +#define SWIG_IOError -2 +#define SWIG_RuntimeError -3 +#define SWIG_IndexError -4 +#define SWIG_TypeError -5 +#define SWIG_DivisionByZero -6 +#define SWIG_OverflowError -7 +#define SWIG_SyntaxError -8 +#define SWIG_ValueError -9 +#define SWIG_SystemError -10 +#define SWIG_AttributeError -11 +#define SWIG_MemoryError -12 +#define SWIG_NullReferenceError -13 + + + + +#include +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include +#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) +# ifndef snprintf +# define snprintf _snprintf +# endif +#endif + + +/* Support for the `contract` feature. + * + * Note that RETURNNULL is first because it's inserted via a 'Replaceall' in + * the fortran.cxx file. + */ +#define SWIG_contract_assert(RETURNNULL, EXPR, MSG) \ + if (!(EXPR)) { SWIG_exception_impl("$decl", SWIG_ValueError, MSG, RETURNNULL); } + + +#define SWIGVERSION 0x040000 +#define SWIG_VERSION SWIGVERSION + + +#define SWIG_as_voidptr(a) (void *)((const void *)(a)) +#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) + + +#include "sundials/sundials_adaptcontroller.h" + +SWIGEXPORT SUNAdaptController _wrap_FSUNAdaptController_NewEmpty(void *farg1) { + SUNAdaptController fresult ; + SUNContext arg1 = (SUNContext) 0 ; + SUNAdaptController result; + + arg1 = (SUNContext)(farg1); + result = (SUNAdaptController)SUNAdaptController_NewEmpty(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_GetType(SUNAdaptController farg1) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + SUNAdaptController_Type result; + + arg1 = (SUNAdaptController)(farg1); + result = (SUNAdaptController_Type)SUNAdaptController_GetType(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_Destroy(SUNAdaptController farg1) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + result = (int)SUNAdaptController_Destroy(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_EstimateStep(SUNAdaptController farg1, double const *farg2, int const *farg3, double const *farg4, double *farg5) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + int arg3 ; + sunrealtype arg4 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (sunrealtype *)(farg5); + result = (int)SUNAdaptController_EstimateStep(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_Reset(SUNAdaptController farg1) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + result = (int)SUNAdaptController_Reset(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetDefaults(SUNAdaptController farg1) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + result = (int)SUNAdaptController_SetDefaults(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_Write(SUNAdaptController farg1, void *farg2) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + FILE *arg2 = (FILE *) 0 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (FILE *)(farg2); + result = (int)SUNAdaptController_Write(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetErrorBias(SUNAdaptController farg1, double const *farg2) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)SUNAdaptController_SetErrorBias(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_UpdateH(SUNAdaptController farg1, double const *farg2, double const *farg3) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)SUNAdaptController_UpdateH(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_Space(SUNAdaptController farg1, long *farg2, long *farg3) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)SUNAdaptController_Space(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + + diff --git a/src/sundials/fmod/fsundials_adaptcontroller_mod.f90 b/src/sundials/fmod/fsundials_adaptcontroller_mod.f90 new file mode 100644 index 0000000000..c804548d50 --- /dev/null +++ b/src/sundials/fmod/fsundials_adaptcontroller_mod.f90 @@ -0,0 +1,313 @@ +! This file was automatically generated by SWIG (http://www.swig.org). +! Version 4.0.0 +! +! Do not make changes to this file unless you know what you are doing--modify +! the SWIG interface file instead. +module fsundials_adaptcontroller_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_types_mod + use fsundials_context_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + ! typedef enum SUNAdaptController_Type + enum, bind(c) + enumerator :: SUN_ADAPTCONTROLLER_NONE + enumerator :: SUN_ADAPTCONTROLLER_H + end enum + integer, parameter, public :: SUNAdaptController_Type = kind(SUN_ADAPTCONTROLLER_NONE) + public :: SUN_ADAPTCONTROLLER_NONE, SUN_ADAPTCONTROLLER_H + ! struct struct _generic_SUNAdaptController_Ops + type, bind(C), public :: SUNAdaptController_Ops + type(C_FUNPTR), public :: gettype + type(C_FUNPTR), public :: estimatestep + type(C_FUNPTR), public :: destroy + type(C_FUNPTR), public :: reset + type(C_FUNPTR), public :: setdefaults + type(C_FUNPTR), public :: write + type(C_FUNPTR), public :: seterrorbias + type(C_FUNPTR), public :: updateh + type(C_FUNPTR), public :: space + end type SUNAdaptController_Ops + ! struct struct _generic_SUNAdaptController + type, bind(C), public :: SUNAdaptController + type(C_PTR), public :: content + type(C_PTR), public :: ops + type(C_PTR), public :: sunctx + end type SUNAdaptController + public :: FSUNAdaptController_NewEmpty + public :: FSUNAdaptController_GetType + public :: FSUNAdaptController_Destroy + public :: FSUNAdaptController_EstimateStep + public :: FSUNAdaptController_Reset + public :: FSUNAdaptController_SetDefaults + public :: FSUNAdaptController_Write + public :: FSUNAdaptController_SetErrorBias + public :: FSUNAdaptController_UpdateH + public :: FSUNAdaptController_Space + integer(C_INT), parameter, public :: SUNADAPTCONTROLLER_SUCCESS = 0_C_INT + integer(C_INT), parameter, public :: SUNADAPTCONTROLLER_ILL_INPUT = -1001_C_INT + integer(C_INT), parameter, public :: SUNADAPTCONTROLLER_MEM_FAIL = -1002_C_INT + integer(C_INT), parameter, public :: SUNADAPTCONTROLLER_USER_FCN_FAIL = -1003_C_INT + integer(C_INT), parameter, public :: SUNADAPTCONTROLLER_OPERATION_FAIL = -1004_C_INT + +! WRAPPER DECLARATIONS +interface +function swigc_FSUNAdaptController_NewEmpty(farg1) & +bind(C, name="_wrap_FSUNAdaptController_NewEmpty") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FSUNAdaptController_GetType(farg1) & +bind(C, name="_wrap_FSUNAdaptController_GetType") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_Destroy(farg1) & +bind(C, name="_wrap_FSUNAdaptController_Destroy") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_EstimateStep(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNAdaptController_EstimateStep") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_Reset(farg1) & +bind(C, name="_wrap_FSUNAdaptController_Reset") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_SetDefaults(farg1) & +bind(C, name="_wrap_FSUNAdaptController_SetDefaults") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_Write(farg1, farg2) & +bind(C, name="_wrap_FSUNAdaptController_Write") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_SetErrorBias(farg1, farg2) & +bind(C, name="_wrap_FSUNAdaptController_SetErrorBias") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_UpdateH(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNAdaptController_UpdateH") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_Space(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNAdaptController_Space") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FSUNAdaptController_NewEmpty(sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNAdaptController), pointer :: swig_result +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = sunctx +fresult = swigc_FSUNAdaptController_NewEmpty(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNAdaptController_GetType(c) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNAdaptController_Type) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(c) +fresult = swigc_FSUNAdaptController_GetType(farg1) +swig_result = fresult +end function + +function FSUNAdaptController_Destroy(c) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(c) +fresult = swigc_FSUNAdaptController_Destroy(farg1) +swig_result = fresult +end function + +function FSUNAdaptController_EstimateStep(c, h, p, dsm, hnew) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +real(C_DOUBLE), intent(in) :: h +integer(C_INT), intent(in) :: p +real(C_DOUBLE), intent(in) :: dsm +real(C_DOUBLE), target, intent(inout) :: hnew +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 + +farg1 = c_loc(c) +farg2 = h +farg3 = p +farg4 = dsm +farg5 = c_loc(hnew) +fresult = swigc_FSUNAdaptController_EstimateStep(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNAdaptController_Reset(c) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(c) +fresult = swigc_FSUNAdaptController_Reset(farg1) +swig_result = fresult +end function + +function FSUNAdaptController_SetDefaults(c) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(c) +fresult = swigc_FSUNAdaptController_SetDefaults(farg1) +swig_result = fresult +end function + +function FSUNAdaptController_Write(c, fptr) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +type(C_PTR) :: fptr +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(c) +farg2 = fptr +fresult = swigc_FSUNAdaptController_Write(farg1, farg2) +swig_result = fresult +end function + +function FSUNAdaptController_SetErrorBias(c, bias) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +real(C_DOUBLE), intent(in) :: bias +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = c_loc(c) +farg2 = bias +fresult = swigc_FSUNAdaptController_SetErrorBias(farg1, farg2) +swig_result = fresult +end function + +function FSUNAdaptController_UpdateH(c, h, dsm) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +real(C_DOUBLE), intent(in) :: h +real(C_DOUBLE), intent(in) :: dsm +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = c_loc(c) +farg2 = h +farg3 = dsm +fresult = swigc_FSUNAdaptController_UpdateH(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNAdaptController_Space(c, lenrw, leniw) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +integer(C_LONG), dimension(*), target, intent(inout) :: lenrw +integer(C_LONG), dimension(*), target, intent(inout) :: leniw +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(c) +farg2 = c_loc(lenrw(1)) +farg3 = c_loc(leniw(1)) +fresult = swigc_FSUNAdaptController_Space(farg1, farg2, farg3) +swig_result = fresult +end function + + +end module diff --git a/src/sundials/fmod/fsundials_profiler_mod.c b/src/sundials/fmod/fsundials_profiler_mod.c index f352495a34..75599fa693 100644 --- a/src/sundials/fmod/fsundials_profiler_mod.c +++ b/src/sundials/fmod/fsundials_profiler_mod.c @@ -273,6 +273,36 @@ SWIGEXPORT int _wrap_FSUNProfiler_End(void *farg1, SwigArrayWrapper *farg2) { } +SWIGEXPORT int _wrap_FSUNProfiler_GetTimerResolution(void *farg1, double *farg2) { + int fresult ; + SUNProfiler arg1 = (SUNProfiler) 0 ; + double *arg2 = (double *) 0 ; + int result; + + arg1 = (SUNProfiler)(farg1); + arg2 = (double *)(farg2); + result = (int)SUNProfiler_GetTimerResolution(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNProfiler_GetElapsedTime(void *farg1, SwigArrayWrapper *farg2, double *farg3) { + int fresult ; + SUNProfiler arg1 = (SUNProfiler) 0 ; + char *arg2 = (char *) 0 ; + double *arg3 = (double *) 0 ; + int result; + + arg1 = (SUNProfiler)(farg1); + arg2 = (char *)(farg2->data); + arg3 = (double *)(farg3); + result = (int)SUNProfiler_GetElapsedTime(arg1,(char const *)arg2,arg3); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FSUNProfiler_Print(void *farg1, void *farg2) { int fresult ; SUNProfiler arg1 = (SUNProfiler) 0 ; diff --git a/src/sundials/fmod/fsundials_profiler_mod.f90 b/src/sundials/fmod/fsundials_profiler_mod.f90 index b1b6c74dc5..328243e3a3 100644 --- a/src/sundials/fmod/fsundials_profiler_mod.f90 +++ b/src/sundials/fmod/fsundials_profiler_mod.f90 @@ -31,6 +31,8 @@ module fsundials_profiler_mod end type public :: FSUNProfiler_Begin public :: FSUNProfiler_End + public :: FSUNProfiler_GetTimerResolution + public :: FSUNProfiler_GetElapsedTime public :: FSUNProfiler_Print public :: FSUNProfiler_Reset @@ -67,6 +69,26 @@ function swigc_FSUNProfiler_End(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FSUNProfiler_GetTimerResolution(farg1, farg2) & +bind(C, name="_wrap_FSUNProfiler_GetTimerResolution") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNProfiler_GetElapsedTime(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNProfiler_GetElapsedTime") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(C_PTR), value :: farg1 +type(SwigArrayWrapper) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + function swigc_FSUNProfiler_Print(farg1, farg2) & bind(C, name="_wrap_FSUNProfiler_Print") & result(fresult) @@ -166,6 +188,42 @@ function FSUNProfiler_End(p, name) & swig_result = fresult end function +function FSUNProfiler_GetTimerResolution(p, resolution) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: p +real(C_DOUBLE), target, intent(inout) :: resolution +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = p +farg2 = c_loc(resolution) +fresult = swigc_FSUNProfiler_GetTimerResolution(farg1, farg2) +swig_result = fresult +end function + +function FSUNProfiler_GetElapsedTime(p, name, time) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: p +character(kind=C_CHAR, len=*), target :: name +character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars +real(C_DOUBLE), target, intent(inout) :: time +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(SwigArrayWrapper) :: farg2 +type(C_PTR) :: farg3 + +farg1 = p +call SWIG_string_to_chararray(name, farg2_chars, farg2) +farg3 = c_loc(time) +fresult = swigc_FSUNProfiler_GetElapsedTime(farg1, farg2, farg3) +swig_result = fresult +end function + function FSUNProfiler_Print(p, fp) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/sundials/sundials_adaptcontroller.c b/src/sundials/sundials_adaptcontroller.c new file mode 100644 index 0000000000..e39a02afec --- /dev/null +++ b/src/sundials/sundials_adaptcontroller.c @@ -0,0 +1,175 @@ +/* ----------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + * ----------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2023, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * ----------------------------------------------------------------- + * This is the implementation file for a generic SUNAdaptController + * package. It contains the implementation of the SUNAdaptController + * operations listed in sundials_adaptcontroller.h + * -----------------------------------------------------------------*/ + +#include + +/* ----------------------------------------------------------------- + * Create a new empty SUNAdaptController object + * ----------------------------------------------------------------- */ + +SUNAdaptController SUNAdaptController_NewEmpty(SUNContext sunctx) +{ + SUNAdaptController C; + SUNAdaptController_Ops ops; + + /* a context is required */ + if (sunctx == NULL) return(NULL); + + /* create controller object */ + C = NULL; + C = (SUNAdaptController) malloc(sizeof *C); + if (C == NULL) return(NULL); + + /* create matrix ops structure */ + ops = NULL; + ops = (SUNAdaptController_Ops) malloc(sizeof *ops); + if (ops == NULL) { free(C); return(NULL); } + + /* initialize operations to NULL */ + ops->gettype = NULL; + ops->destroy = NULL; + ops->reset = NULL; + ops->estimatestep = NULL; + ops->setdefaults = NULL; + ops->write = NULL; + ops->seterrorbias = NULL; + ops->updateh = NULL; + ops->space = NULL; + + /* attach ops and initialize content to NULL */ + C->ops = ops; + C->content = NULL; + C->sunctx = sunctx; + + return(C); +} + + +/* ----------------------------------------------------------------- + * Free a generic SUNAdaptController (assumes content is already empty) + * ----------------------------------------------------------------- */ + +void SUNAdaptController_DestroyEmpty(SUNAdaptController C) +{ + if (C == NULL) return; + + /* free non-NULL ops structure */ + if (C->ops) free(C->ops); + C->ops = NULL; + + /* free overall SUNAdaptController object and return */ + free(C); + return; +} + + +/* ----------------------------------------------------------------- + * Required functions in the 'ops' structure for non-NULL controller + * ----------------------------------------------------------------- */ + +SUNAdaptController_Type SUNAdaptController_GetType(SUNAdaptController C) +{ + if (C == NULL) { return SUN_ADAPTCONTROLLER_NONE; } + if (C->ops->gettype) { return C->ops->gettype(C); } + return SUN_ADAPTCONTROLLER_NONE; +} + +/* ----------------------------------------------------------------- + * Optional functions in the 'ops' structure + * ----------------------------------------------------------------- */ + +int SUNAdaptController_Destroy(SUNAdaptController C) +{ + if (C == NULL) return(SUNADAPTCONTROLLER_SUCCESS); + + /* if the destroy operation exists use it */ + if (C->ops) + if (C->ops->destroy) { return(C->ops->destroy(C)); } + + /* if we reach this point, either ops == NULL or destroy == NULL, + try to cleanup by freeing the content, ops, and matrix */ + if (C->content) { free(C->content); C->content = NULL; } + if (C->ops) { free(C->ops); C->ops = NULL; } + free(C); C = NULL; + + return(SUNADAPTCONTROLLER_SUCCESS); +} + +int SUNAdaptController_EstimateStep(SUNAdaptController C, sunrealtype h, int p, + sunrealtype dsm, sunrealtype* hnew) +{ + int ier = SUNADAPTCONTROLLER_SUCCESS; + *hnew = h; /* initialize output with identity */ + if (C == NULL || hnew == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + if (C->ops->estimatestep) + { + ier = C->ops->estimatestep(C, h, p, dsm, hnew); + } + return(ier); +} + + +int SUNAdaptController_Reset(SUNAdaptController C) +{ + int ier = SUNADAPTCONTROLLER_SUCCESS; + if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + if (C->ops->reset) { ier = C->ops->reset(C); } + return(ier); +} + +int SUNAdaptController_SetDefaults(SUNAdaptController C) +{ + int ier = SUNADAPTCONTROLLER_SUCCESS; + if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + if (C->ops->setdefaults) { ier = C->ops->setdefaults(C); } + return(ier); +} + +int SUNAdaptController_Write(SUNAdaptController C, FILE* fptr) +{ + int ier = SUNADAPTCONTROLLER_SUCCESS; + if (C == NULL || fptr == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + if (C->ops->write) { ier = C->ops->write(C, fptr); } + return(ier); +} + +int SUNAdaptController_SetErrorBias(SUNAdaptController C, sunrealtype bias) +{ + int ier = SUNADAPTCONTROLLER_SUCCESS; + if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + if (C->ops->seterrorbias) { ier = C->ops->seterrorbias(C, bias); } + return(ier); +} + +int SUNAdaptController_UpdateH(SUNAdaptController C, sunrealtype h, sunrealtype dsm) +{ + int ier = SUNADAPTCONTROLLER_SUCCESS; + if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + if (C->ops->updateh) { ier = C->ops->updateh(C, h, dsm); } + return(ier); +} + +int SUNAdaptController_Space(SUNAdaptController C, long int *lenrw, long int *leniw) +{ + int ier = SUNADAPTCONTROLLER_SUCCESS; + if (C == NULL || lenrw == NULL || leniw == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } + *lenrw = 0; /* initialize outputs with identity */ + *leniw = 0; + if (C->ops->space) { ier = C->ops->space(C, lenrw, leniw); } + return(ier); +} diff --git a/swig/Makefile b/swig/Makefile index 4a062e0445..1948ecfd74 100644 --- a/swig/Makefile +++ b/swig/Makefile @@ -20,17 +20,18 @@ CVODES=fcvodes_mod IDA=fida_mod IDAS=fidas_mod KINSOL=fkinsol_mod -GENERIC=fsundials_types_mod fsundials_nvector_mod fsundials_matrix_mod fsundials_linearsolver_mod fsundials_nonlinearsolver_mod fsundials_futils_mod fsundials_context_mod fsundials_profiler_mod fsundials_logger_mod +GENERIC=fsundials_types_mod fsundials_nvector_mod fsundials_matrix_mod fsundials_linearsolver_mod fsundials_nonlinearsolver_mod fsundials_futils_mod fsundials_context_mod fsundials_profiler_mod fsundials_logger_mod fsundials_adaptcontroller_mod NVECTOR=openmp pthreads serial parallel manyvector mpiplusx SUNMATRIX=band dense sparse SUNLINSOL=band dense lapackdense klu spbcgs spfgmr spgmr sptfqmr pcg SUNNONLINSOL=newton fixedpoint +SUNADAPTCONTROLLER=imexgus soderlind INCLUDES=-I../include -.PHONY: generic arkode cvode cvodes ida idas kinsol nvector sunmatrix sunlinsol sunnonlinsol patch +.PHONY: generic arkode cvode cvodes ida idas kinsol nvector sunmatrix sunlinsol sunnonlinsol sunadaptcontroller patch -all: generic arkode cvode cvodes ida idas kinsol nvector sunmatrix sunlinsol sunnonlinsol patch +all: generic arkode cvode cvodes ida idas kinsol nvector sunmatrix sunlinsol sunnonlinsol sunadaptcontroller patch arkode: $(ARKODE:%:arkode/%.i) @for i in ${ARKODE} ; do \ @@ -102,9 +103,15 @@ sunnonlinsol: $(SUNNONLINSOL:%:sunnonlinsol/fsunnonlinsol_%_mod.i) swig -fortran -outdir ../src/sunnonlinsol/$${i}/fmod -o ../src/sunnonlinsol/$${i}/fmod/fsunnonlinsol_$${i}_mod.c ${INCLUDES} sunnonlinsol/fsunnonlinsol_$${i}_mod.i ; \ done +sunadaptcontroller: $(SUNADAPTCONTROLLER:%:sunadaptcontroller/fsunadaptcontroller_%_mod.i) + @for i in ${SUNADAPTCONTROLLER} ; do \ + echo "swig -fortran -outdir ../src/sunadaptcontroller/$${i}/fmod -o ../src/sunadaptcontroller/$${i}/fmod ${INCLUDES} sunadaptcontroller/fsunadaptcontroller_$${i}_mod.i" ; \ + swig -fortran -outdir ../src/sunadaptcontroller/$${i}/fmod -o ../src/sunadaptcontroller/$${i}/fmod/fsunadaptcontroller_$${i}_mod.c ${INCLUDES} sunadaptcontroller/fsunadaptcontroller_$${i}_mod.i ; \ + done + patch: .FORCE - cd ..; - + cd ..; + clean: rm ../src/**/fmod/*.c; rm ../src/**/fmod/*.f90 diff --git a/swig/arkode/farkode_mod.i b/swig/arkode/farkode_mod.i index caaad3f3c1..926f895ab8 100644 --- a/swig/arkode/farkode_mod.i +++ b/swig/arkode/farkode_mod.i @@ -34,6 +34,7 @@ %import "../sundials/fsundials_matrix_mod.i" %import "../sundials/fsundials_linearsolver_mod.i" %import "../sundials/fsundials_nonlinearsolver_mod.i" +%import "../sundials/fsundials_adaptcontroller_mod.i" %import "../sundials/fsundials_types_mod.i" // Treat ARKodeButcherTable as an opaque pointer diff --git a/swig/sunadaptcontroller/fsunadaptcontroller.i b/swig/sunadaptcontroller/fsunadaptcontroller.i new file mode 100644 index 0000000000..3fd2354fa3 --- /dev/null +++ b/swig/sunadaptcontroller/fsunadaptcontroller.i @@ -0,0 +1,30 @@ +// --------------------------------------------------------------- +// Programmer: Daniel R. Reynolds @ SMU +// --------------------------------------------------------------- +// SUNDIALS Copyright Start +// Copyright (c) 2002-2023, Lawrence Livermore National Security +// and Southern Methodist University. +// All rights reserved. +// +// See the top-level LICENSE and NOTICE files for details. +// +// SPDX-License-Identifier: BSD-3-Clause +// SUNDIALS Copyright End +// --------------------------------------------------------------- +// Swig interface file +// --------------------------------------------------------------- + +// Include shared configuration +%include "../sundials/fsundials.i" + +%{ +#include "sundials/sundials_adaptcontroller.h" +%} + +// Load the typedefs and generate "use" statements +%import "../sundials/fsundials_adaptcontroller_mod.i" + +// Macro for creating an interface to a SUNAdaptController +%define %sunadaptcontroller_impl(TYPE) + %ignore _SUNAdaptControllerContent_## TYPE ##; +%enddef diff --git a/swig/sunadaptcontroller/fsunadaptcontroller_imexgus_mod.i b/swig/sunadaptcontroller/fsunadaptcontroller_imexgus_mod.i new file mode 100644 index 0000000000..1b319a8b7c --- /dev/null +++ b/swig/sunadaptcontroller/fsunadaptcontroller_imexgus_mod.i @@ -0,0 +1,29 @@ +// --------------------------------------------------------------- +// Programmer: Daniel R. Reynolds @ SMU +// --------------------------------------------------------------- +// SUNDIALS Copyright Start +// Copyright (c) 2002-2023, Lawrence Livermore National Security +// and Southern Methodist University. +// All rights reserved. +// +// See the top-level LICENSE and NOTICE files for details. +// +// SPDX-License-Identifier: BSD-3-Clause +// SUNDIALS Copyright End +// --------------------------------------------------------------- +// Swig interface file +// --------------------------------------------------------------- + +%module fsunadaptcontroller_imexgus_mod + +// include code common to all implementations +%include "fsunadaptcontroller.i" + +%{ +#include "sunadaptcontroller/sunadaptcontroller_imexgus.h" +%} + +%sunadaptcontroller_impl(ImExGus) + +// Process and wrap functions in the following files +%include "sunadaptcontroller/sunadaptcontroller_imexgus.h" diff --git a/swig/sunadaptcontroller/fsunadaptcontroller_soderlind_mod.i b/swig/sunadaptcontroller/fsunadaptcontroller_soderlind_mod.i new file mode 100644 index 0000000000..cb9ab8ccbf --- /dev/null +++ b/swig/sunadaptcontroller/fsunadaptcontroller_soderlind_mod.i @@ -0,0 +1,29 @@ +// --------------------------------------------------------------- +// Programmer: Daniel R. Reynolds @ SMU +// --------------------------------------------------------------- +// SUNDIALS Copyright Start +// Copyright (c) 2002-2023, Lawrence Livermore National Security +// and Southern Methodist University. +// All rights reserved. +// +// See the top-level LICENSE and NOTICE files for details. +// +// SPDX-License-Identifier: BSD-3-Clause +// SUNDIALS Copyright End +// --------------------------------------------------------------- +// Swig interface file +// --------------------------------------------------------------- + +%module fsunadaptcontroller_soderlind_mod + +// include code common to all implementations +%include "fsunadaptcontroller.i" + +%{ +#include "sunadaptcontroller/sunadaptcontroller_soderlind.h" +%} + +%sunadaptcontroller_impl(Soderlind) + +// Process and wrap functions in the following files +%include "sunadaptcontroller/sunadaptcontroller_soderlind.h" diff --git a/swig/sundials/fsundials.i b/swig/sundials/fsundials.i index dcda29e1c8..bac0f74646 100644 --- a/swig/sundials/fsundials.i +++ b/swig/sundials/fsundials.i @@ -37,6 +37,7 @@ %sundials_generic(SUNLinearSolver) %sundials_generic(SUNNonlinearSolver) %sundials_generic(SUNMatrix) +%sundials_generic(SUNAdaptController) // Treat FILE* as an opaque pointer %apply void* { FILE* }; diff --git a/swig/sundials/fsundials_adaptcontroller_mod.i b/swig/sundials/fsundials_adaptcontroller_mod.i new file mode 100644 index 0000000000..ff88ab8893 --- /dev/null +++ b/swig/sundials/fsundials_adaptcontroller_mod.i @@ -0,0 +1,28 @@ +// --------------------------------------------------------------- +// Programmer: Daniel R. Reynolds @ SMU +// --------------------------------------------------------------- +// SUNDIALS Copyright Start +// Copyright (c) 2002-2023, Lawrence Livermore National Security +// and Southern Methodist University. +// All rights reserved. +// +// See the top-level LICENSE and NOTICE files for details. +// +// SPDX-License-Identifier: BSD-3-Clause +// SUNDIALS Copyright End +// --------------------------------------------------------------- +// Swig interface file +// --------------------------------------------------------------- + +%module fsundials_adaptcontroller_mod + +// Load the typedefs and generate a "use" statement in the module +%import "../sundials/fsundials_types_mod.i" +%import "../sundials/fsundials_context_mod.i" + +%{ +#include "sundials/sundials_adaptcontroller.h" +%} + +// Process and wrap functions in the following files +%include "sundials/sundials_adaptcontroller.h" diff --git a/test/answers b/test/answers index a63bd8022c..1ff407f621 160000 --- a/test/answers +++ b/test/answers @@ -1 +1 @@ -Subproject commit a63bd8022ca4e772744769d7b6d5a371d5fb6429 +Subproject commit 1ff407f621fd49addea544af650362bf190ff9dd diff --git a/test/unit_tests/arkode/CXX_serial/CMakeLists.txt b/test/unit_tests/arkode/CXX_serial/CMakeLists.txt index 6367e502e4..d1c72d7799 100644 --- a/test/unit_tests/arkode/CXX_serial/CMakeLists.txt +++ b/test/unit_tests/arkode/CXX_serial/CMakeLists.txt @@ -60,7 +60,7 @@ foreach(test_tuple ${unit_tests}) # We explicitly choose which object libraries to link to and link in the # arkode objects so that we have access to private functions w/o changing - # their visibility in the installed libraries. + # their visibility in the installed libraries. target_link_libraries(${test_target} $ sundials_sunmemsys_obj @@ -69,6 +69,8 @@ foreach(test_tuple ${unit_tests}) sundials_sunlinsoldense_obj sundials_sunnonlinsolnewton_obj sundials_sunnonlinsolfixedpoint_obj + sundials_sunadaptcontrollerimexgus_obj + sundials_sunadaptcontrollersoderlind_obj ${EXE_EXTRA_LINK_LIBS}) # Tell CMake that we depend on the ARKODE library since it does not pick diff --git a/test/unit_tests/arkode/C_serial/CMakeLists.txt b/test/unit_tests/arkode/C_serial/CMakeLists.txt index 5fc081c930..a59f685fac 100644 --- a/test/unit_tests/arkode/C_serial/CMakeLists.txt +++ b/test/unit_tests/arkode/C_serial/CMakeLists.txt @@ -66,6 +66,8 @@ foreach(test_tuple ${ARKODE_unit_tests}) sundials_sunlinsolband_obj sundials_sunlinsoldense_obj sundials_sunnonlinsolnewton_obj + sundials_sunadaptcontrollerimexgus_obj + sundials_sunadaptcontrollersoderlind_obj ${EXE_EXTRA_LINK_LIBS}) # Tell CMake that we depend on the ARKODE library since it does not pick From 83f2c7cc63dec96df9b71ebe90ae2ca305a580f4 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 9 Nov 2023 00:14:22 -0800 Subject: [PATCH 06/24] remove unused variables --- .../ark_brusselator1D_task_local_nls_f2003.f90 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/examples/arkode/F2003_parallel/ark_brusselator1D_task_local_nls_f2003.f90 b/examples/arkode/F2003_parallel/ark_brusselator1D_task_local_nls_f2003.f90 index 4e338af38a..e3888b5fde 100644 --- a/examples/arkode/F2003_parallel/ark_brusselator1D_task_local_nls_f2003.f90 +++ b/examples/arkode/F2003_parallel/ark_brusselator1D_task_local_nls_f2003.f90 @@ -998,7 +998,7 @@ function TaskLocalNewton(arkode_mem, sunvec_y) result(sunnls) use fsunlinsol_dense_mod use fsunmatrix_dense_mod - use ode_mod, only : sunctx, Nvar, comm, monitor + use ode_mod, only : sunctx, Nvar, comm !======= Declarations ========= implicit none @@ -1011,7 +1011,6 @@ function TaskLocalNewton(arkode_mem, sunvec_y) result(sunnls) type(SUNNonlinearSolver_Ops), pointer :: nlsops ! solver operations integer :: ierr ! MPI error status - integer(c_int) :: retval ! SUNDIALS error status !======= Internals ============ @@ -1252,7 +1251,6 @@ subroutine EvolveProblemIMEX(sunvec_y) integer :: ierr ! MPI error status integer :: iout ! output counter double precision :: tout, dtout ! output time and update - character(len=100) :: outname ! diagnostics ouptput file !======= Internals ============ @@ -1544,7 +1542,6 @@ subroutine EvolveProblemExplicit(sunvec_y) integer :: ierr ! output counter integer :: iout ! output counter double precision :: tout, dtout ! output time and update - character(len=100) :: outname ! diagnostics ouptput file !======= Internals ============ From 6fcb7cb9954ef1f08c83b244867f334c9f713af8 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Thu, 9 Nov 2023 11:51:52 -0800 Subject: [PATCH 07/24] Update examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp Co-authored-by: Daniel R. Reynolds --- examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp index 82d4a7b6f2..4bb96c8ab4 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp @@ -705,7 +705,7 @@ int main(int argc, char* argv[]) ARKStepFree(&arkode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors - FreeUserData(udata); // Free user dat + FreeUserData(udata); // Free user data delete udata; braid_Destroy(core); // Free braid memory ARKBraid_Free(&app); // Free interface memory From 4cff0ae6548d9223a6671ed6d662719e43e124ac Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 13:36:46 -0800 Subject: [PATCH 08/24] remove delted functions from soruce --- doc/shared/nvectors/NVector_OpenMP.rst | 12 +++++------- doc/shared/nvectors/NVector_OpenMPDEV.rst | 12 +++++------- doc/shared/nvectors/NVector_PETSc.rst | 12 +++++------- doc/shared/nvectors/NVector_ParHyp.rst | 12 +++++------- doc/shared/nvectors/NVector_Parallel.rst | 12 +++++------- doc/shared/nvectors/NVector_Pthreads.rst | 12 +++++------- doc/shared/nvectors/NVector_Serial.rst | 12 +++++------- doc/shared/nvectors/NVector_Trilinos.rst | 3 +-- src/nvector/openmp/nvector_openmp.c | 19 ------------------- src/nvector/openmpdev/nvector_openmpdev.c | 19 ------------------- src/nvector/parallel/nvector_parallel.c | 20 -------------------- src/nvector/parhyp/nvector_parhyp.c | 21 --------------------- src/nvector/petsc/nvector_petsc.c | 20 -------------------- src/nvector/pthreads/nvector_pthreads.c | 19 ------------------- src/nvector/serial/nvector_serial.c | 19 ------------------- 15 files changed, 36 insertions(+), 188 deletions(-) diff --git a/doc/shared/nvectors/NVector_OpenMP.rst b/doc/shared/nvectors/NVector_OpenMP.rst index dcd63c0709..09e3311bb9 100644 --- a/doc/shared/nvectors/NVector_OpenMP.rst +++ b/doc/shared/nvectors/NVector_OpenMP.rst @@ -289,13 +289,11 @@ options as the vector they are cloned from while vectors created with ``v_data = NV_DATA_OMP(v)`` and then access ``v_data[i]`` within the loop than it is to use ``NV_Ith_OMP(v,i)`` within the loop. -* :c:func:`N_VNewEmpty_OpenMP`, :c:func:`N_VMake_OpenMP`, and - :c:func:`N_VCloneVectorArrayEmpty_OpenMP()` set the field *own_data* - to ``SUNFALSE``. The functions :c:func:`N_VDestroy_OpenMP()` and - :c:func:`N_VDestroyVectorArray_OpenMP()` will not attempt to free the - pointer data for any ``N_Vector`` with *own_data* set to ``SUNFALSE``. - In such a case, it is the user's responsibility to deallocate the - data pointer. +* :c:func:`N_VNewEmpty_OpenMP` and :c:func:`N_VMake_OpenMP` set the field + *own_data* to ``SUNFALSE``. The function :c:func:`N_VDestroy_OpenMP()` will + not attempt to free the pointer data for any ``N_Vector`` with *own_data* set + to ``SUNFALSE``. In such a case, it is the user's responsibility to deallocate + the data pointer. * To maximize efficiency, vector operations in the NVECTOR_OPENMP implementation that have more than one ``N_Vector`` argument do not diff --git a/doc/shared/nvectors/NVector_OpenMPDEV.rst b/doc/shared/nvectors/NVector_OpenMPDEV.rst index 8415431485..9db8affe63 100644 --- a/doc/shared/nvectors/NVector_OpenMPDEV.rst +++ b/doc/shared/nvectors/NVector_OpenMPDEV.rst @@ -291,13 +291,11 @@ options as the vector they are cloned from while vectors created with back from the device with ``N_VCopyFromDevice_OpenMPDEV(v)`` to ensure the array is up to date. -* :c:func:`N_VNewEmpty_OpenMPDEV`, :c:func:`N_VMake_OpenMPDEV`, and - :c:func:`N_VCloneVectorArrayEmpty_OpenMPDEV()` set the field *own_data* - to ``SUNFALSE``. The functions :c:func:`N_VDestroy_OpenMPDEV()` and - :c:func:`N_VDestroyVectorArray_OpenMPDEV()` will not attempt to free the - pointer data for any ``N_Vector`` with *own_data* set to ``SUNFALSE``. - In such a case, it is the user's responsibility to deallocate the - data pointers. +* :c:func:`N_VNewEmpty_OpenMPDEV` and :c:func:`N_VMake_OpenMPDEV` set the field + *own_data* to ``SUNFALSE``. The function :c:func:`N_VDestroy_OpenMPDEV()` + will not attempt to free the pointer data for any ``N_Vector`` with *own_data* + set to ``SUNFALSE``. In such a case, it is the user's responsibility to + deallocate the data pointers. * To maximize efficiency, vector operations in the NVECTOR_OPENMPDEV implementation that have more than one ``N_Vector`` argument do not diff --git a/doc/shared/nvectors/NVector_PETSc.rst b/doc/shared/nvectors/NVector_PETSc.rst index 6c8549f46c..5857f5d249 100644 --- a/doc/shared/nvectors/NVector_PETSc.rst +++ b/doc/shared/nvectors/NVector_PETSc.rst @@ -179,13 +179,11 @@ options as the vector they are cloned from while vectors created with is recommeded to extract the PETSc vector via ``x_vec = N_VGetVector_Petsc(v);`` and then access components using appropriate PETSc functions. -* The functions :c:func:`N_VNewEmpty_Petsc`, :c:func:`N_VMake_Petsc`, - and :c:func:`N_VCloneVectorArrayEmpty_Petsc()` set the field - *own_data* to ``SUNFALSE``. The routines :c:func:`N_VDestroy_Petsc()` and - :c:func:`N_VDestroyVectorArray_Petsc()` will not attempt to free the - pointer ``pvec`` for any ``N_Vector`` with *own_data* set to - ``SUNFALSE``. In such a case, it is the user's responsibility to - deallocate the ``pvec`` pointer. +* The functions :c:func:`N_VNewEmpty_Petsc` and :c:func:`N_VMake_Petsc`, set the + field *own_data* to ``SUNFALSE``. The routine :c:func:`N_VDestroy_Petsc()` + will not attempt to free the pointer ``pvec`` for any ``N_Vector`` with + *own_data* set to ``SUNFALSE``. In such a case, it is the user's + responsibility to deallocate the ``pvec`` pointer. * To maximize efficiency, vector operations in the NVECTOR_PETSC implementation that have more than one ``N_Vector`` argument do not diff --git a/doc/shared/nvectors/NVector_ParHyp.rst b/doc/shared/nvectors/NVector_ParHyp.rst index 92b881bbd6..6009af0424 100644 --- a/doc/shared/nvectors/NVector_ParHyp.rst +++ b/doc/shared/nvectors/NVector_ParHyp.rst @@ -188,13 +188,11 @@ options as the vector they are cloned from while vectors created with ``x_vec = N_VGetVector_ParHyp(v)`` and then access components using appropriate HYPRE functions. -* :c:func:`N_VNewEmpty_ParHyp`, :c:func:`N_VMake_ParHyp`, and - :c:func:`N_VCloneVectorArrayEmpty_ParHyp()` set the field *own_parvector* - to ``SUNFALSE``. The functions :c:func:`N_VDestroy_ParHyp()` and - :c:func:`N_VDestroyVectorArray_ParHyp()` will not attempt to delete an - underlying HYPRE vector for any ``N_Vector`` with *own_parvector* - set to ``SUNFALSE``. In such a case, it is the user's responsibility - to delete the underlying vector. +* :c:func:`N_VNewEmpty_ParHyp`, and :c:func:`N_VMake_ParHyp` set the field + *own_parvector* to ``SUNFALSE``. The function :c:func:`N_VDestroy_ParHyp()` + will not attempt to delete an underlying HYPRE vector for any ``N_Vector`` + with *own_parvector* set to ``SUNFALSE``. In such a case, it is the + user's responsibility to delete the underlying vector. * To maximize efficiency, vector operations in the NVECTOR_PARHYP implementation that have more than one ``N_Vector`` argument do not diff --git a/doc/shared/nvectors/NVector_Parallel.rst b/doc/shared/nvectors/NVector_Parallel.rst index 0b9b2ae8f7..56721550c1 100644 --- a/doc/shared/nvectors/NVector_Parallel.rst +++ b/doc/shared/nvectors/NVector_Parallel.rst @@ -287,13 +287,11 @@ options as the vector they are cloned from, while vectors created with ``v_data = NV_DATA_P(v)``, and then access ``v_data[i]`` within the loop than it is to use ``NV_Ith_P(v,i)`` within the loop. -* :c:func:`N_VNewEmpty_Parallel`, :c:func:`N_VMake_Parallel`, and - :c:func:`N_VCloneVectorArrayEmpty_Parallel()` set the field *own_data* to - ``SUNFALSE``. The routines :c:func:`N_VDestroy_Parallel()` and - :c:func:`N_VDestroyVectorArray_Parallel()` will not attempt to free the - pointer data for any ``N_Vector`` with *own_data* set to - ``SUNFALSE``. In such a case, it is the user's responsibility to - deallocate the data pointer. +* :c:func:`N_VNewEmpty_Parallel` and :c:func:`N_VMake_Parallel` set the field + *own_data* to ``SUNFALSE``. The routine :c:func:`N_VDestroy_Parallel()` will + not attempt to free the pointer data for any ``N_Vector`` with *own_data* set + to ``SUNFALSE``. In such a case, it is the user's responsibility to deallocate + the data pointer. * To maximize efficiency, vector operations in the NVECTOR_PARALLEL implementation that have more than one ``N_Vector`` argument do not diff --git a/doc/shared/nvectors/NVector_Pthreads.rst b/doc/shared/nvectors/NVector_Pthreads.rst index fc78cfa323..5669210aa5 100644 --- a/doc/shared/nvectors/NVector_Pthreads.rst +++ b/doc/shared/nvectors/NVector_Pthreads.rst @@ -285,13 +285,11 @@ options as the vector they are cloned from while vectors created with NV_DATA_PT(v)`` and then access ``v_data[i]`` within the loop than it is to use ``NV_Ith_S(v,i)`` within the loop. -* :c:func:`N_VNewEmpty_Pthreads`, :c:func:`N_VMake_Pthreads`, and - :c:func:`N_VCloneVectorArrayEmpty_Pthreads()` set the field *own_data* - to ``SUNFALSE``. The functions :c:func:`N_VDestroy_Pthreads()` and - :c:func:`N_VDestroyVectorArray_Pthreads()` will not attempt to free the - pointer data for any ``N_Vector`` with *own_data* set to ``SUNFALSE``. - In such a case, it is the user's responsibility to deallocate the - data pointer. +* :c:func:`N_VNewEmpty_Pthreads` and :c:func:`N_VMake_Pthreads` set the field + *own_data* to ``SUNFALSE``. The function :c:func:`N_VDestroy_Pthreads()` will + not attempt to free the pointer data for any ``N_Vector`` with *own_data* set + to ``SUNFALSE``. In such a case, it is the user's responsibility to deallocate + the data pointer. * To maximize efficiency, vector operations in the NVECTOR_PTHREADS implementation that have more than one ``N_Vector`` argument do not diff --git a/doc/shared/nvectors/NVector_Serial.rst b/doc/shared/nvectors/NVector_Serial.rst index 53194e0569..b7b8bcab24 100644 --- a/doc/shared/nvectors/NVector_Serial.rst +++ b/doc/shared/nvectors/NVector_Serial.rst @@ -263,13 +263,11 @@ options as the vector they are cloned, from while vectors created with and then access ``v_data[i]`` within the loop than it is to use ``NV_Ith_S(v,i)`` within the loop. -* :c:func:`N_VNewEmpty_Serial`, :c:func:`N_VMake_Serial`, and - :c:func:`N_VCloneVectorArrayEmpty_Serial()` set the field *own_data* - to ``SUNFALSE``. The functions :c:func:`N_VDestroy_Serial()` and - :c:func:`N_VDestroyVectorArray_Serial()` will not attempt to free the - pointer data for any ``N_Vector`` with *own_data* set to ``SUNFALSE``. - In such a case, it is the user's responsibility to deallocate the - data pointer. +* :c:func:`N_VNewEmpty_Serial`, :c:func:`N_VMake_Serial` set the field + *own_data* to ``SUNFALSE``. The function :c:func:`N_VDestroy_Serial()` will + not attempt to free the pointer data for any ``N_Vector`` with *own_data* set + to ``SUNFALSE``. In such a case, it is the user's responsibility to deallocate + the data pointer. * To maximize efficiency, vector operations in the NVECTOR_SERIAL implementation that have more than one ``N_Vector`` argument do not diff --git a/doc/shared/nvectors/NVector_Trilinos.rst b/doc/shared/nvectors/NVector_Trilinos.rst index 861ffcacbf..6a47becd0c 100644 --- a/doc/shared/nvectors/NVector_Trilinos.rst +++ b/doc/shared/nvectors/NVector_Trilinos.rst @@ -108,7 +108,6 @@ The module NVECTOR_TRILINOS provides the following additional user-callable rout N_VGetVector_Trilinos(v)`` and then access components using the appropriate Trilinos functions. -* The functions ``N_VDestroy_Trilinos`` and - ``N_VDestroyVectorArray_Trilinos`` only delete the ``N_Vector`` +* The function ``N_VDestroy_Trilinos`` only deletes the ``N_Vector`` wrapper. The underlying Tpetra vector object will exist for as long as there is at least one reference to it. diff --git a/src/nvector/openmp/nvector_openmp.c b/src/nvector/openmp/nvector_openmp.c index d9d3889493..5b8db6e85a 100644 --- a/src/nvector/openmp/nvector_openmp.c +++ b/src/nvector/openmp/nvector_openmp.c @@ -219,25 +219,6 @@ N_Vector* N_VCloneVectorArray_OpenMP(int count, N_Vector w) return(N_VCloneVectorArray(count, w)); } -/* ---------------------------------------------------------------------------- - * Function to create an array of new vectors with NULL data array. - */ - -N_Vector* N_VCloneVectorArrayEmpty_OpenMP(int count, N_Vector w) -{ - return(N_VCloneEmptyVectorArray(count, w)); -} - -/* ---------------------------------------------------------------------------- - * Function to free an array created with N_VCloneVectorArray_OpenMP - */ - -void N_VDestroyVectorArray_OpenMP(N_Vector* vs, int count) -{ - N_VDestroyVectorArray(vs, count); - return; -} - /* ---------------------------------------------------------------------------- * Function to return number of vector elements */ diff --git a/src/nvector/openmpdev/nvector_openmpdev.c b/src/nvector/openmpdev/nvector_openmpdev.c index 7b8d46bf9b..3d4ccd8355 100644 --- a/src/nvector/openmpdev/nvector_openmpdev.c +++ b/src/nvector/openmpdev/nvector_openmpdev.c @@ -230,25 +230,6 @@ N_Vector *N_VCloneVectorArray_OpenMPDEV(int count, N_Vector w) return(N_VCloneVectorArray(count, w)); } -/* ---------------------------------------------------------------------------- - * Function to create an array of new vectors with NULL data array. - */ - -N_Vector *N_VCloneVectorArrayEmpty_OpenMPDEV(int count, N_Vector w) -{ - return(N_VCloneEmptyVectorArray(count, w)); -} - -/* ---------------------------------------------------------------------------- - * Function to free an array created with N_VCloneVectorArray_OpenMPDEV - */ - -void N_VDestroyVectorArray_OpenMPDEV(N_Vector *vs, int count) -{ - N_VDestroyVectorArray(vs, count); - return; -} - /* ---------------------------------------------------------------------------- * Function to return number of vector elements */ diff --git a/src/nvector/parallel/nvector_parallel.c b/src/nvector/parallel/nvector_parallel.c index 88dee009e6..097e2cd1ee 100644 --- a/src/nvector/parallel/nvector_parallel.c +++ b/src/nvector/parallel/nvector_parallel.c @@ -241,26 +241,6 @@ N_Vector* N_VCloneVectorArray_Parallel(int count, N_Vector w) return(N_VCloneVectorArray(count, w)); } -/* ---------------------------------------------------------------- - * Function to create an array of new parallel vectors with empty - * (NULL) data array. - */ - -N_Vector* N_VCloneVectorArrayEmpty_Parallel(int count, N_Vector w) -{ - return(N_VCloneEmptyVectorArray(count, w)); -} - -/* ---------------------------------------------------------------- - * Function to free an array created with N_VCloneVectorArray_Parallel - */ - -void N_VDestroyVectorArray_Parallel(N_Vector* vs, int count) -{ - N_VDestroyVectorArray(vs, count); - return; -} - /* ---------------------------------------------------------------- * Function to return global vector length */ diff --git a/src/nvector/parhyp/nvector_parhyp.c b/src/nvector/parhyp/nvector_parhyp.c index c5a7983c7c..5397f0308b 100644 --- a/src/nvector/parhyp/nvector_parhyp.c +++ b/src/nvector/parhyp/nvector_parhyp.c @@ -266,27 +266,6 @@ N_Vector *N_VCloneVectorArray_ParHyp(int count, N_Vector w) return(N_VCloneVectorArray(count, w)); } -/* ---------------------------------------------------------------- - * Function to create an array of new parhyp vector wrappers - * without uderlying HYPRE vectors. - */ - -N_Vector *N_VCloneVectorArrayEmpty_ParHyp(int count, N_Vector w) -{ - return(N_VCloneEmptyVectorArray(count, w)); -} - -/* ---------------------------------------------------------------- - * Function to free an array created with N_VCloneVectorArray_ParHyp - */ - -void N_VDestroyVectorArray_ParHyp(N_Vector *vs, int count) -{ - N_VDestroyVectorArray(vs, count); - return; -} - - /* ---------------------------------------------------------------- * Extract HYPRE vector */ diff --git a/src/nvector/petsc/nvector_petsc.c b/src/nvector/petsc/nvector_petsc.c index 0cd81a84c8..3dbff29050 100644 --- a/src/nvector/petsc/nvector_petsc.c +++ b/src/nvector/petsc/nvector_petsc.c @@ -248,26 +248,6 @@ N_Vector *N_VCloneVectorArray_Petsc(int count, N_Vector w) return(N_VCloneVectorArray(count, w)); } -/* ---------------------------------------------------------------- - * Function to create an array of new PETSc vector wrappers with - * empty (NULL) PETSc vectors. - */ - -N_Vector *N_VCloneVectorArrayEmpty_Petsc(int count, N_Vector w) -{ - return(N_VCloneEmptyVectorArray(count, w)); -} - -/* ---------------------------------------------------------------- - * Function to free an array created with N_VCloneVectorArray_Petsc - */ - -void N_VDestroyVectorArray_Petsc(N_Vector *vs, int count) -{ - N_VDestroyVectorArray(vs, count); - return; -} - /* ---------------------------------------------------------------- * Function to extract PETSc vector */ diff --git a/src/nvector/pthreads/nvector_pthreads.c b/src/nvector/pthreads/nvector_pthreads.c index 62093e6363..d4b3b10caa 100644 --- a/src/nvector/pthreads/nvector_pthreads.c +++ b/src/nvector/pthreads/nvector_pthreads.c @@ -289,25 +289,6 @@ N_Vector* N_VCloneVectorArray_Pthreads(int count, N_Vector w) return(N_VCloneVectorArray(count, w)); } -/* ---------------------------------------------------------------------------- - * Function to create an array of new vectors with NULL data array. - */ - -N_Vector* N_VCloneVectorArrayEmpty_Pthreads(int count, N_Vector w) -{ - return(N_VCloneEmptyVectorArray(count, w)); -} - -/* ---------------------------------------------------------------------------- - * Function to free an array created with N_VCloneVectorArray_Pthreads - */ - -void N_VDestroyVectorArray_Pthreads(N_Vector* vs, int count) -{ - N_VDestroyVectorArray(vs, count); - return; -} - /* ---------------------------------------------------------------------------- * Function to return number of vector elements */ diff --git a/src/nvector/serial/nvector_serial.c b/src/nvector/serial/nvector_serial.c index 980363fbb6..43ced7bc82 100644 --- a/src/nvector/serial/nvector_serial.c +++ b/src/nvector/serial/nvector_serial.c @@ -213,25 +213,6 @@ N_Vector* N_VCloneVectorArray_Serial(int count, N_Vector w) return(N_VCloneVectorArray(count, w)); } -/* ---------------------------------------------------------------------------- - * Function to create an array of new serial vectors with NULL data array. - */ - -N_Vector* N_VCloneVectorArrayEmpty_Serial(int count, N_Vector w) -{ - return(N_VCloneEmptyVectorArray(count, w)); -} - -/* ---------------------------------------------------------------------------- - * Function to free an array created with N_VCloneVectorArray_Serial - */ - -void N_VDestroyVectorArray_Serial(N_Vector* vs, int count) -{ - N_VDestroyVectorArray(vs, count); - return; -} - /* ---------------------------------------------------------------------------- * Function to return number of vector elements */ From b6018207ea6074c37854b7a49ed6aa7a6d056a9e Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 13:42:56 -0800 Subject: [PATCH 09/24] remove unused kinsol parts --- doc/kinsol/guide/source/Usage/index.rst | 76 ------------------------- src/kinsol/kinsol.c | 29 ++-------- src/kinsol/kinsol_impl.h | 13 ----- 3 files changed, 4 insertions(+), 114 deletions(-) diff --git a/doc/kinsol/guide/source/Usage/index.rst b/doc/kinsol/guide/source/Usage/index.rst index a2414757c3..98deec00ea 100644 --- a/doc/kinsol/guide/source/Usage/index.rst +++ b/doc/kinsol/guide/source/Usage/index.rst @@ -485,8 +485,6 @@ negative, so a test ``retval`` :math:`<0` will catch any error. +--------------------------------------------------------+----------------------------------+------------------------------+ | Data for problem-defining function | :c:func:`KINSetUserData` | ``NULL`` | +--------------------------------------------------------+----------------------------------+------------------------------+ - | Verbosity level of output | :c:func:`KINSetPrintLevel` | 0 | - +--------------------------------------------------------+----------------------------------+------------------------------+ | Max. number of nonlinear iterations | :c:func:`KINSetNumMaxIters` | 200 | +--------------------------------------------------------+----------------------------------+------------------------------+ | No initial matrix setup | :c:func:`KINSetNoInitSetup` | ``SUNFALSE`` | @@ -599,57 +597,6 @@ negative, so a test ``retval`` :math:`<0` will catch any error. ``NULL`` will always be directed to ``stderr``. -.. c:function:: int KINSetInfoHandlerFn(void * kin_mem, KINInfoHandlerFn ihfun, void * ih_data) - - The function :c:func:`KINSetInfoHandlerFn` specifies the optional - user-defined function to be used in handling informative (non-error) - messages. - - **Arguments:** - * ``kin_mem`` -- pointer to the KINSOL memory block. - * ``ihfun`` -- is the user's CC information handler function (see :numref:`KINSOL.Usage.CC.user_fct_sim.ihFn`). - * ``ih_data`` -- pointer to user data passed to ``ihfun`` every time it is called. - - **Return value:** - * ``KIN_SUCCESS`` -- The function ``ihfun`` and data pointer ``ih_data`` have been successfully set. - * ``KIN_MEM_NULL`` -- The ``kin_mem`` pointer is ``NULL``. - - -.. c:function:: int KINSetPrintLevel(void * kin_mem, int printfl) - - The function :c:func:`KINSetPrintLevel` specifies the level of verbosity of the output. - - **Arguments:** - * ``kin_mem`` -- pointer to the KINSOL memory block. - * ``printfl`` -- flag indicating the level of verbosity. Must be one of: - - 0 -- no information is displayed. - - 1 -- for each nonlinear iteration display the following information: - - - the scaled Euclidean :math:`\ell_2` norm of the system function evaluated at the current iterate, - - the scaled norm of the Newton step (only if using ``KIN_NONE``), and - - the number of function evaluations performed so far. - - 2 -- display level 1 output and the following values for each iteration: - - - :math:`\|F(u)\|_{D_F}` (only for ``KIN_NONE``). - - :math:`\|F(u)\|_{D_F,\infty}` (for ``KIN_NONE`` and ``KIN_LINESEARCH``). - - 3 -- display level 2 output plus - - - additional values used by the global strategy (only if using ``KIN_LINESEARCH``), and - - statistical information for iterative linear solver modules. - - **Return value:** - * ``KIN_SUCCESS`` -- The optional value has been successfully set. - * ``KIN_MEM_NULL`` -- The ``kin_mem`` pointer is ``NULL``. - * ``KIN_ILL_INPUT`` -- The argument ``printfl`` had an illegal value. - - **Notes:** - The default value for ``printfl`` is :math:`0`. - - .. c:function:: int KINSetUserData(void * kin_mem, void * user_data) The function :c:func:`KINSetUserData` specifies the pointer to user-defined @@ -1972,29 +1919,6 @@ follows: warnings. If a function that returns a pointer to memory encounters an error, it sets ``error_code`` to 0. -.. _KINSOL.Usage.CC.user_fct_sim.ihFn: - -Informational message handler function -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The user may provide a function of type :c:type:`KINInfoHandlerFn` to process any such messages. -The function type :c:type:`KINInfoHandlerFn` is defined as follows: - -.. c:type:: void (*KINInfoHandlerFn)(const char *module, const char *function, char *msg, void *ih_data) - - This function processes error and warning messages from KINSOL and its - sub-modules. - - **Arguments:** - * ``error_code`` -- is the error code - * ``module`` -- is the name of the KINSOL module reporting the error - * ``function`` -- is the name of the function in which the error occurred - * ``ih_data`` -- is a pointer to user data, the same as the ``ih_data`` - parameter passed to :c:func:`KINSetInfoHandlerFn` - - **Return value:** - This function has no return value. - .. _KINSOL.Usage.CC.user_fct_sim.jacFn: diff --git a/src/kinsol/kinsol.c b/src/kinsol/kinsol.c index 3f5171a88c..3446f0ff65 100644 --- a/src/kinsol/kinsol.c +++ b/src/kinsol/kinsol.c @@ -49,7 +49,6 @@ * KINScSNorm * KINSOL Verbose output functions * KINPrintInfo - * KINInfoHandler * KINSOL Error Handling functions * KINProcessError * KINErrHandler @@ -274,8 +273,6 @@ void *KINCreate(SUNContext sunctx) kin_mem->kin_constraintsSet = SUNFALSE; kin_mem->kin_ehfun = KINErrHandler; kin_mem->kin_eh_data = kin_mem; - kin_mem->kin_ihfun = KINInfoHandler; - kin_mem->kin_ih_data = kin_mem; kin_mem->kin_ret_newest = SUNFALSE; kin_mem->kin_mxiter = MXITER_DEFAULT; kin_mem->kin_noInitSetup = SUNFALSE; @@ -2359,9 +2356,10 @@ void KINPrintInfo(KINMem kin_mem, } - /* call the info message handler */ - - kin_mem->kin_ihfun(module, fname, msg, kin_mem->kin_ih_data); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO + SUNLogger_QueueMsg(KIN_LOGGER, SUN_LOGLEVEL_INFO, + "KINSOL", fname, "%s", msg); +#endif /* finalize argument processing */ @@ -2370,25 +2368,6 @@ void KINPrintInfo(KINMem kin_mem, return; } - -/* - * KINInfoHandler - * - * This is the default KINSOL info handling function. - * It sends the info message to the stream pointed to by kin_infofp - */ - -void KINInfoHandler(const char *module, const char *function, - char *msg, void *data) -{ - KINMem kin_mem; - kin_mem = (KINMem) data; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(KIN_LOGGER, SUN_LOGLEVEL_INFO, - "KINSOL::KINInfoHandler", function, "%s", msg); -#endif -} - /* * ================================================================= * KINSOL Error Handling functions diff --git a/src/kinsol/kinsol_impl.h b/src/kinsol/kinsol_impl.h index 47a684cc73..d76542cfdc 100644 --- a/src/kinsol/kinsol_impl.h +++ b/src/kinsol/kinsol_impl.h @@ -47,7 +47,6 @@ extern "C" { /* KINSOL default constants */ -#define PRINTFL_DEFAULT 0 #define MXITER_DEFAULT 200 #define MXNBCF_DEFAULT 10 #define MSBSET_DEFAULT 10 @@ -90,7 +89,6 @@ typedef struct KINMemRec { realtype kin_scsteptol; /* scaled step length tolerance */ int kin_globalstrategy; /* choices are KIN_NONE, KIN_LINESEARCH KIN_PICARD and KIN_FP */ - int kin_printfl; /* level of verbosity of output */ long int kin_mxiter; /* maximum number of nonlinear iterations */ long int kin_msbset; /* maximum number of nonlinear iterations that may be performed between calls to the @@ -279,16 +277,6 @@ typedef struct KINMemRec { void *kin_eh_data; /* dats pointer passed to ehfun */ FILE *kin_errfp; /* KINSOL error messages are sent to errfp */ - KINInfoHandlerFn kin_ihfun; /* Info messages are handled by ihfun */ - void *kin_ih_data; /* dats pointer passed to ihfun */ - FILE *kin_infofp; /* where KINSol info messages are sent */ - - /*--------- - Debugging - ---------*/ - - FILE *kin_debugfp; /* debugging output file */ - } *KINMem; /* @@ -432,7 +420,6 @@ void KINInfoHandler(const char *module, const char *function, #define MSG_FUNC_NULL "func = NULL illegal." #define MSG_NO_MALLOC "Attempt to call before KINMalloc illegal." -#define MSG_BAD_PRINTFL "Illegal value for printfl." #define MSG_BAD_MXITER "Illegal value for mxiter." #define MSG_BAD_MSBSET "Illegal msbset < 0." #define MSG_BAD_MSBSETSUB "Illegal msbsetsub < 0." From 9690f3d199d4b49883ac9b19c9ef9bb9a677d92b Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 13:50:33 -0800 Subject: [PATCH 10/24] remove use of printfl --- src/kinsol/kinsol_ls.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/kinsol/kinsol_ls.c b/src/kinsol/kinsol_ls.c index 61e9f8f659..59dd1ccb8c 100644 --- a/src/kinsol/kinsol_ls.c +++ b/src/kinsol/kinsol_ls.c @@ -1244,9 +1244,11 @@ int kinLsSolve(KINMem kin_mem, N_Vector xx, N_Vector bb, if (kinls_mem->LS->ops->numiters) nli_inc = SUNLinSolNumIters(kinls_mem->LS); - if (kinls_mem->iterative && kin_mem->kin_printfl > 2) +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + if (kinls_mem->iterative) KINPrintInfo(kin_mem, PRNT_NLI, "KINLS", "kinLsSolve", INFO_NLI, nli_inc); +#endif /* Increment counters nli and ncfl */ kinls_mem->nli += nli_inc; @@ -1325,9 +1327,11 @@ int kinLsSolve(KINMem kin_mem, N_Vector xx, N_Vector bb, } } - if (kin_mem->kin_inexact_ls && kin_mem->kin_printfl > 2) +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + if (kin_mem->kin_inexact_ls) KINPrintInfo(kin_mem, PRNT_EPS, "KINLS", "kinLsSolve", INFO_EPS, res_norm, kin_mem->kin_eps); +#endif return(0); } From 4a8ad535ff08f14cc236149d239ecbd5b5434604 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 13:52:39 -0800 Subject: [PATCH 11/24] change default logging level --- cmake/SundialsBuildOptionsPre.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/SundialsBuildOptionsPre.cmake b/cmake/SundialsBuildOptionsPre.cmake index 227c734045..3de3b3a29a 100644 --- a/cmake/SundialsBuildOptionsPre.cmake +++ b/cmake/SundialsBuildOptionsPre.cmake @@ -76,12 +76,12 @@ sundials_option(SUNDIALS_BUILD_WITH_PROFILING BOOL "${DOCSTR}" OFF) # --------------------------------------------------------------- set(DOCSTR "Build with logging capabilities enabled (0 = no logging, 1 = errors, 2 = +warnings, 3 = +info, 4 = +debug, 5 = +extras") -sundials_option(SUNDIALS_LOGGING_LEVEL STRING "${DOCSTR}" 3 +sundials_option(SUNDIALS_LOGGING_LEVEL STRING "${DOCSTR}" 2 OPTIONS "0;1;2;3;4;5") -if(SUNDIALS_LOGGING_LEVEL GREATER_EQUAL 4) +if(SUNDIALS_LOGGING_LEVEL GREATER_EQUAL 3) message(STATUS "SUNDIALS logging level set to ${SUNDIALS_LOGGING_LEVEL}") - message(WARNING "SUNDIALS built with debug logging turned on, performance may be affected.") + message(WARNING "SUNDIALS built with additional logging turned on, performance may be affected.") endif() set(DOCSTR "Build SUNDIALS logging with MPI support") From dbf7f3f6a2382b6221c561412928da83e7c46762 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 13:53:31 -0800 Subject: [PATCH 12/24] remove more unused stuff in arkode --- src/arkode/arkode_impl.h | 5 ----- src/arkode/arkode_io.c | 27 --------------------------- 2 files changed, 32 deletions(-) diff --git a/src/arkode/arkode_impl.h b/src/arkode/arkode_impl.h index 6cd8b85c25..596d3202a5 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -390,10 +390,6 @@ struct ARKodeMemRec long int netf; /* num error test failures */ long int nconstrfails; /* number of constraint failures */ - /* Diagnostic output */ - booleantype report; /* flag to enable/disable diagnostic output */ - FILE *diagfp; /* diagnostic outputs are sent to diagfp */ - /* Space requirements for ARKODE */ sunindextype lrw1; /* no. of realtype words in 1 N_Vector */ sunindextype liw1; /* no. of integer words in 1 N_Vector */ @@ -1010,7 +1006,6 @@ int arkSetErrHandlerFn(void *arkode_mem, void *eh_data); int arkSetErrFile(void *arkode_mem, FILE *errfp); int arkSetUserData(void *arkode_mem, void *user_data); -int arkSetDiagnostics(void *arkode_mem, FILE *diagfp); int arkSetMaxNumSteps(void *arkode_mem, long int mxsteps); int arkSetMaxHnilWarns(void *arkode_mem, int mxhnil); int arkSetInitStep(void *arkode_mem, realtype hin); diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index cc45123175..51ee41c81c 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -309,33 +309,6 @@ int arkSetUserData(void *arkode_mem, void *user_data) return(ARK_SUCCESS); } - -/*--------------------------------------------------------------- - arkSetDiagnostics: - - Specifies to enable solver diagnostics, and specifies the FILE - pointer for output (diagfp==NULL disables output) - ---------------------------------------------------------------*/ -int arkSetDiagnostics(void *arkode_mem, FILE *diagfp) -{ - ARKodeMem ark_mem; - if (arkode_mem==NULL) { - arkProcessError(NULL, ARK_MEM_NULL, "ARKODE", - "arkSetDiagnostics", MSG_ARK_NO_MEM); - return(ARK_MEM_NULL); - } - ark_mem = (ARKodeMem) arkode_mem; - ark_mem->diagfp = diagfp; - if (diagfp != NULL) { - ark_mem->report = SUNTRUE; - } else { - ark_mem->report = SUNFALSE; - } - - return(ARK_SUCCESS); -} - - /*--------------------------------------------------------------- arkSetAdaptController: From 89dcad3edef3b45c92773bbe4c52112b59318262 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 13:59:48 -0800 Subject: [PATCH 13/24] remove uses of ark_mem->report --- src/arkode/arkode.c | 5 ----- src/arkode/arkode_adapt.c | 8 -------- src/arkode/arkode_arkstep.c | 10 ---------- src/arkode/arkode_erkstep.c | 10 ---------- src/arkode/arkode_io.c | 2 -- src/arkode/arkode_ls.c | 8 -------- src/arkode/arkode_mristep.c | 8 -------- 7 files changed, 51 deletions(-) diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 3b85e35e73..2a910b107d 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -102,10 +102,6 @@ ARKodeMem arkCreate(SUNContext sunctx) ark_mem->relax_enabled = SUNFALSE; ark_mem->relax_mem = NULL; - /* Initialize diagnostics reporting variables */ - ark_mem->report = SUNFALSE; - ark_mem->diagfp = NULL; - /* Initialize lrw and liw */ ark_mem->lrw = 18; ark_mem->liw = 41; /* fcn/data ptr, int, long int, sunindextype, booleantype */ @@ -1435,7 +1431,6 @@ void arkPrintMem(ARKodeMem ark_mem, FILE *outfile) fprintf(outfile, "tstopset = %i\n", ark_mem->tstopset); fprintf(outfile, "tstopinterp = %i\n", ark_mem->tstopinterp); fprintf(outfile, "tstop = %" RSYM"\n", ark_mem->tstop); - fprintf(outfile, "report = %i\n", ark_mem->report); fprintf(outfile, "VabstolMallocDone = %i\n", ark_mem->VabstolMallocDone); fprintf(outfile, "MallocDone = %i\n", ark_mem->MallocDone); fprintf(outfile, "initsetup = %i\n", ark_mem->initsetup); diff --git a/src/arkode/arkode_adapt.c b/src/arkode/arkode_adapt.c index a8d4ef9b90..556b931317 100644 --- a/src/arkode/arkode_adapt.c +++ b/src/arkode/arkode_adapt.c @@ -160,10 +160,6 @@ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, /* enforce minimum bound time step reduction */ h_acc = int_dir * SUNMAX(SUNRabs(h_acc), SUNRabs(hadapt_mem->etamin*hcur)); - /* Solver diagnostics reporting */ - if (ark_mem->report) - fprintf(ark_mem->diagfp, "%"RSYM" %"RSYM" ", h_acc, h_cfl); - #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkAdapt", "new-step-after-max-min-bounds", @@ -195,10 +191,6 @@ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, ark_mem->eta /= SUNMAX(ONE, SUNRabs(hcur) * ark_mem->hmax_inv*ark_mem->eta); - /* Solver diagnostics reporting */ - if (ark_mem->report) - fprintf(ark_mem->diagfp, "%"RSYM"\n", ark_mem->eta); - #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkAdapt", "new-step-eta", "eta = %"RSYM, ark_mem->eta); diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index fbe130b2de..b1ea90d03f 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -1929,11 +1929,6 @@ int arkStep_TakeStep_Z(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) N_VPrintFile(step_mem->sdata, ARK_LOGGER->debug_fp); #endif - /* solver diagnostics reporting */ - if (ark_mem->report) - fprintf(ark_mem->diagfp, "ARKStep step %li %"RSYM" %i %"RSYM"\n", - ark_mem->nst, ark_mem->h, is, ark_mem->tcur); - /* perform implicit solve if required */ if (implicit_stage) { @@ -2082,11 +2077,6 @@ int arkStep_TakeStep_Z(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); #endif - /* solver diagnostics reporting */ - if (ark_mem->report) - fprintf(ark_mem->diagfp, "ARKStep etest %li %"RSYM" %"RSYM"\n", - ark_mem->nst, ark_mem->h, *dsmPtr); - #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, "ARKODE::arkStep_TakeStep_Z", "end-step", diff --git a/src/arkode/arkode_erkstep.c b/src/arkode/arkode_erkstep.c index 6929fd92de..78aec3331a 100644 --- a/src/arkode/arkode_erkstep.c +++ b/src/arkode/arkode_erkstep.c @@ -804,11 +804,6 @@ int erkStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) /* Set current stage time(s) */ ark_mem->tcur = ark_mem->tn + step_mem->B->c[is]*ark_mem->h; - /* Solver diagnostics reporting */ - if (ark_mem->report) - fprintf(ark_mem->diagfp, "ERKStep step %li %"RSYM" %i %"RSYM"\n", - ark_mem->nst, ark_mem->h, is, ark_mem->tcur); - #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::erkStep_TakeStep", "start-stage", @@ -866,11 +861,6 @@ int erkStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); #endif - /* Solver diagnostics reporting */ - if (ark_mem->report) - fprintf(ark_mem->diagfp, "ERKStep etest %li %"RSYM" %"RSYM"\n", - ark_mem->nst, ark_mem->h, *dsmPtr); - #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::erkStep_TakeStep", "error-test", diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index 51ee41c81c..fe6bd4c5b1 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -86,8 +86,6 @@ int arkSetDefaults(void *arkode_mem) ark_mem->tstopset = SUNFALSE; /* no stop time set */ ark_mem->tstopinterp = SUNFALSE; /* copy at stop time */ ark_mem->tstop = ZERO; /* no fixed stop time */ - ark_mem->diagfp = NULL; /* no solver diagnostics file */ - ark_mem->report = SUNFALSE; /* don't report solver diagnostics */ ark_mem->hadapt_mem->etamx1 = ETAMX1; /* max change on first step */ ark_mem->hadapt_mem->etamxf = ETAMXF; /* max change on error-failed step */ ark_mem->hadapt_mem->etamin = ETAMIN; /* min bound on time step reduction */ diff --git a/src/arkode/arkode_ls.c b/src/arkode/arkode_ls.c index 2645a83116..95d081ab15 100644 --- a/src/arkode/arkode_ls.c +++ b/src/arkode/arkode_ls.c @@ -2731,10 +2731,6 @@ int arkLsSolve(void* arkode_mem, N_Vector b, realtype tnow, if (retval != SUNLS_SUCCESS) arkls_mem->ncfl++; /* Log solver statistics to diagnostics file (if requested) */ - if (ark_mem->report) - fprintf(ark_mem->diagfp, "ARKLS kry %"RSYM" %"RSYM" %i %i\n", - bnorm, resnorm, nli_inc, (int) (arkls_mem->nps - nps_inc)); - #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkLsSolve", "ls-stats", "bnorm = %"RSYM", resnorm = %"RSYM @@ -3150,10 +3146,6 @@ int arkLsMassSolve(void *arkode_mem, N_Vector b, realtype nlscoef) if (retval != SUNLS_SUCCESS) arkls_mem->ncfl++; /* Log solver statistics to diagnostics file (if requested) */ - if (ark_mem->report) - fprintf(ark_mem->diagfp, "ARKLS mass %"RSYM" %i %i\n", - resnorm, nli_inc, (int) (arkls_mem->nps - nps_inc)); - #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkLsMassSolve", "mass-ls-stats", diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index f118ed0540..e6d32c65b3 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -1569,10 +1569,6 @@ int mriStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) ark_mem->tcur = ark_mem->tn + step_mem->MRIC->c[is]*ark_mem->h; /* Solver diagnostics reporting */ - if (ark_mem->report) - fprintf(ark_mem->diagfp, "MRIStep step %li %"RSYM" %i %"RSYM"\n", - ark_mem->nst, ark_mem->h, is, ark_mem->tcur); - #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", "start-stage", @@ -1679,10 +1675,6 @@ int mriStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) #endif /* Solver diagnostics reporting */ - if (ark_mem->report) - fprintf(ark_mem->diagfp, "MRIStep etest %li %"RSYM" %"RSYM"\n", - ark_mem->nst, ark_mem->h, *dsmPtr); - #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", "error-test", From a0502e3898733b36687ac14f3533d035d5397bef Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 14:12:45 -0800 Subject: [PATCH 14/24] build with different logging levels and profiling on/off --- .github/workflows/ubuntu-clang-latest.yml | 38 ++++++++++++++++++----- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ubuntu-clang-latest.yml b/.github/workflows/ubuntu-clang-latest.yml index 71f398d30a..e809bbabc0 100644 --- a/.github/workflows/ubuntu-clang-latest.yml +++ b/.github/workflows/ubuntu-clang-latest.yml @@ -1,4 +1,4 @@ -name: Ubuntu (clang) short test +name: Ubuntu/Clang build only (no tpls) on: pull_request: @@ -14,9 +14,13 @@ env: BUILD_TYPE: Release jobs: - build: + build_wo_profiling: runs-on: ubuntu-latest + strategy: + matrix: + logging_level: [0, 1, 2, 3, 4, 5] + steps: - name: Install LLVM and Clang uses: KyleMayes/install-llvm-action@v1 @@ -28,14 +32,32 @@ jobs: - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=$(which clang) -DCMAKE_CXX_COMPILER=$(which clang++) + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=$(which clang) -DCMAKE_CXX_COMPILER=$(which clang++) -DSUNDIALS_LOGGING_LEVEL=${{matrix.logging_level}} - name: Build # Build your program with the given configuration run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - name: Test - working-directory: ${{github.workspace}}/build - # Execute tests defined by the CMake configuration. - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest -C ${{env.BUILD_TYPE}} + build_w_profiling: + runs-on: ubuntu-latest + + strategy: + matrix: + profiling: ['OFF', 'ON'] + + steps: + - name: Install LLVM and Clang + uses: KyleMayes/install-llvm-action@v1 + with: + version: "14.0" + + - uses: actions/checkout@v3 + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=$(which clang) -DCMAKE_CXX_COMPILER=$(which clang++) -DSUNDIALS_BUILD_WITH_PROFILING=${{matrix.profiling}} + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} From 4e38f353f0d63dfa88d9dfb27c7efc4914ffa918 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 14:13:36 -0800 Subject: [PATCH 15/24] remove broken line --- src/arkode/arkode_adapt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/arkode/arkode_adapt.c b/src/arkode/arkode_adapt.c index 556b931317..a7604fd69a 100644 --- a/src/arkode/arkode_adapt.c +++ b/src/arkode/arkode_adapt.c @@ -146,8 +146,6 @@ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, "ARKODE::arkAdapt", "step-history", "hcur = %"RSYM", hhist[0] = %"RSYM", hhist[0] = %"RSYM, hcur, hadapt_mem->hhist[0], hadapt_mem->hhist[1]); - - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, #endif /* enforce safety factors */ From 90b09247d23418cda6b7c3cc802fc54b1c51442e Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 14:21:08 -0800 Subject: [PATCH 16/24] rename GitHub actions CI jobs --- .github/workflows/double-precision.yml | 2 +- .github/workflows/extended-precision.yml | 2 +- .github/workflows/macos-latest.yml | 4 ++-- .github/workflows/single-precision.yml | 2 +- .github/workflows/spack-develop.yml | 2 +- .github/workflows/ubuntu-clang-latest.yml | 2 +- .github/workflows/windows-latest-mingw.yml | 4 ++-- .github/workflows/windows-latest.yml | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/double-precision.yml b/.github/workflows/double-precision.yml index 31feaf3ffb..7f49a290fa 100644 --- a/.github/workflows/double-precision.yml +++ b/.github/workflows/double-precision.yml @@ -1,5 +1,5 @@ # -name: double precision build and test with GCC+TPLs (no GPUs) +name: Build and Test - Ubuntu/gcc double precision (TPLS, no GPUs) on: push: diff --git a/.github/workflows/extended-precision.yml b/.github/workflows/extended-precision.yml index 55d75f7d5d..af23133d87 100644 --- a/.github/workflows/extended-precision.yml +++ b/.github/workflows/extended-precision.yml @@ -1,5 +1,5 @@ # -name: extended precision build and test with GCC+TPLs (no GPUs) +name: Build and Test - Ubuntu/gcc extended precision (TPLS, no GPUs) on: pull_request: diff --git a/.github/workflows/macos-latest.yml b/.github/workflows/macos-latest.yml index 4d5599295e..457d191b5c 100644 --- a/.github/workflows/macos-latest.yml +++ b/.github/workflows/macos-latest.yml @@ -1,4 +1,4 @@ -name: MacOS short test +name: Build and Test - MacOS (short) on: pull_request: @@ -14,7 +14,7 @@ env: BUILD_TYPE: Release jobs: - build: + build_and_test: # The CMake configure and build commands are platform agnostic and should work equally # well on Windows or Mac. You can convert this to a matrix build if you need # cross-platform coverage. diff --git a/.github/workflows/single-precision.yml b/.github/workflows/single-precision.yml index 9a87e7f0bd..c61cb57007 100644 --- a/.github/workflows/single-precision.yml +++ b/.github/workflows/single-precision.yml @@ -1,5 +1,5 @@ # -name: single precision build and test with GCC+TPLs (no GPUs) +name: Build and Test - Ubuntu/gcc single precision (TPLS, no GPUs) on: pull_request: diff --git a/.github/workflows/spack-develop.yml b/.github/workflows/spack-develop.yml index 745a57df7e..388fdd0940 100644 --- a/.github/workflows/spack-develop.yml +++ b/.github/workflows/spack-develop.yml @@ -1,5 +1,5 @@ # -name: spack@develop build and test with GCC+TPLs (no GPUs) +name: Build and Test - Ubuntu/gcc spack@develop (TPLs, no GPUs) on: pull_request: diff --git a/.github/workflows/ubuntu-clang-latest.yml b/.github/workflows/ubuntu-clang-latest.yml index e809bbabc0..78696e520b 100644 --- a/.github/workflows/ubuntu-clang-latest.yml +++ b/.github/workflows/ubuntu-clang-latest.yml @@ -1,4 +1,4 @@ -name: Ubuntu/Clang build only (no tpls) +name: Build - Ubuntu/Clang (no TPLS) on: pull_request: diff --git a/.github/workflows/windows-latest-mingw.yml b/.github/workflows/windows-latest-mingw.yml index 5289a953da..ac296c6b1c 100644 --- a/.github/workflows/windows-latest-mingw.yml +++ b/.github/workflows/windows-latest-mingw.yml @@ -1,4 +1,4 @@ -name: Windows (mingw) short test +name: Build and Test - Windows/mingw (short) on: pull_request: @@ -14,7 +14,7 @@ env: BUILD_TYPE: Release jobs: - build: + buil_and_test: runs-on: windows-latest steps: diff --git a/.github/workflows/windows-latest.yml b/.github/workflows/windows-latest.yml index 66489fe976..feca1a4e67 100644 --- a/.github/workflows/windows-latest.yml +++ b/.github/workflows/windows-latest.yml @@ -1,4 +1,4 @@ -name: Windows short test +name: Build and Test - Windows/MSVC (short) on: pull_request: @@ -14,7 +14,7 @@ env: BUILD_TYPE: Release jobs: - build: + build_and_test: runs-on: windows-latest steps: From 6e17a61f5009b1389437f9fcdba0fe70ab97df3d Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 14:23:42 -0800 Subject: [PATCH 17/24] update log levels cycles through --- .github/workflows/ubuntu-clang-latest.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ubuntu-clang-latest.yml b/.github/workflows/ubuntu-clang-latest.yml index 78696e520b..6951249aa6 100644 --- a/.github/workflows/ubuntu-clang-latest.yml +++ b/.github/workflows/ubuntu-clang-latest.yml @@ -14,12 +14,13 @@ env: BUILD_TYPE: Release jobs: - build_wo_profiling: + build_cycle_log_levels: runs-on: ubuntu-latest strategy: matrix: - logging_level: [0, 1, 2, 3, 4, 5] + # 2 is what all other builds use (its the default), so skip it here + logging_level: [0, 1, 3, 4, 5] steps: - name: Install LLVM and Clang @@ -38,7 +39,7 @@ jobs: # Build your program with the given configuration run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - build_w_profiling: + build_cycle_profiling: runs-on: ubuntu-latest strategy: From 1ef6287efce5800754d3634a54607717da84c0b3 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 14:27:25 -0800 Subject: [PATCH 18/24] dont automatically include sundials_context.hpp --- include/sundials/sundials_context.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/sundials/sundials_context.h b/include/sundials/sundials_context.h index 6fef61b81d..e0cfb0bc6b 100644 --- a/include/sundials/sundials_context.h +++ b/include/sundials/sundials_context.h @@ -40,9 +40,5 @@ SUNDIALS_EXPORT int SUNContext_Free(SUNContext* ctx); #ifdef __cplusplus } -/* We include this here for backwards compatibility - (the contents used to be defined here directly) */ -#include - #endif #endif From c12540975c3526665bfbeffed4baa42c34645f11 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 14:27:33 -0800 Subject: [PATCH 19/24] add recent changes --- CHANGELOG.md | 3 +++ doc/arkode/guide/source/Introduction.rst | 4 ++++ doc/cvode/guide/source/Introduction.rst | 4 ++++ doc/cvodes/guide/source/Introduction.rst | 4 ++++ doc/ida/guide/source/Introduction.rst | 4 ++++ doc/idas/guide/source/Introduction.rst | 4 ++++ doc/kinsol/guide/source/Introduction.rst | 4 ++++ 7 files changed, 27 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8968010eb4..3a2cda6550 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,9 @@ method `ARKODE_VERNER_16_8_9`. Changed the `SUNProfiler` so that it does not rely on `MPI_WTime` in any case. This fixes https://github.com/LLNL/sundials/issues/312. +**Breaking change** +Functions, types and header files that were previously deprecated have been +removed. ## Changes to SUNDIALS in release 6.6.1 diff --git a/doc/arkode/guide/source/Introduction.rst b/doc/arkode/guide/source/Introduction.rst index 10108c8025..b6442c8fd8 100644 --- a/doc/arkode/guide/source/Introduction.rst +++ b/doc/arkode/guide/source/Introduction.rst @@ -182,6 +182,10 @@ This fixes `GitHub Issue #312 `_. Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. +**Breaking change** +Functions, types and header files that were previously deprecated have been +removed. + Changes in v5.6.1 ----------------- diff --git a/doc/cvode/guide/source/Introduction.rst b/doc/cvode/guide/source/Introduction.rst index b4c2388e34..daa94f9fee 100644 --- a/doc/cvode/guide/source/Introduction.rst +++ b/doc/cvode/guide/source/Introduction.rst @@ -134,6 +134,10 @@ This fixes `GitHub Issue #312 `_. Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. +**Breaking change** +Functions, types and header files that were previously deprecated have been +removed. + Changes in v6.6.1 ----------------- diff --git a/doc/cvodes/guide/source/Introduction.rst b/doc/cvodes/guide/source/Introduction.rst index d6ff7db84e..be21b803d0 100644 --- a/doc/cvodes/guide/source/Introduction.rst +++ b/doc/cvodes/guide/source/Introduction.rst @@ -137,6 +137,10 @@ This fixes `GitHub Issue #312 `_. Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. +**Breaking change** +Functions, types and header files that were previously deprecated have been +removed. + Changes in v6.6.1 ----------------- diff --git a/doc/ida/guide/source/Introduction.rst b/doc/ida/guide/source/Introduction.rst index 369147817e..83a4da2ba8 100644 --- a/doc/ida/guide/source/Introduction.rst +++ b/doc/ida/guide/source/Introduction.rst @@ -95,6 +95,10 @@ This fixes `GitHub Issue #312 `_. Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. +**Breaking change** +Functions, types and header files that were previously deprecated have been +removed. + Changes in v6.6.1 ----------------- diff --git a/doc/idas/guide/source/Introduction.rst b/doc/idas/guide/source/Introduction.rst index 4dc93c7b41..c9a7d91871 100644 --- a/doc/idas/guide/source/Introduction.rst +++ b/doc/idas/guide/source/Introduction.rst @@ -112,6 +112,10 @@ This fixes `GitHub Issue #312 `_. Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. +**Breaking change** +Functions, types and header files that were previously deprecated have been +removed. + Changes in v5.6.1 ----------------- diff --git a/doc/kinsol/guide/source/Introduction.rst b/doc/kinsol/guide/source/Introduction.rst index a4c33cc470..7ac3cd37c9 100644 --- a/doc/kinsol/guide/source/Introduction.rst +++ b/doc/kinsol/guide/source/Introduction.rst @@ -104,6 +104,10 @@ CMake targets. Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. +**Breaking change** +Functions, types and header files that were previously deprecated have been +removed. + Changes in v6.6.1 ----------------- From aede7e5ebc3e77da783e09c3cda05a00db7fb921 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 14:29:00 -0800 Subject: [PATCH 20/24] fix indentation --- doc/shared/nvectors/NVector_ParHyp.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/shared/nvectors/NVector_ParHyp.rst b/doc/shared/nvectors/NVector_ParHyp.rst index 6009af0424..97f3ed0f40 100644 --- a/doc/shared/nvectors/NVector_ParHyp.rst +++ b/doc/shared/nvectors/NVector_ParHyp.rst @@ -189,7 +189,7 @@ options as the vector they are cloned from while vectors created with appropriate HYPRE functions. * :c:func:`N_VNewEmpty_ParHyp`, and :c:func:`N_VMake_ParHyp` set the field - *own_parvector* to ``SUNFALSE``. The function :c:func:`N_VDestroy_ParHyp()` + *own_parvector* to ``SUNFALSE``. The function :c:func:`N_VDestroy_ParHyp()` will not attempt to delete an underlying HYPRE vector for any ``N_Vector`` with *own_parvector* set to ``SUNFALSE``. In such a case, it is the user's responsibility to delete the underlying vector. From 4d3ed8fdb7fd7113cce72cdab77fffb911ee2a22 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 14:48:10 -0800 Subject: [PATCH 21/24] undo removal of include --- include/sundials/sundials_context.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/sundials/sundials_context.h b/include/sundials/sundials_context.h index e0cfb0bc6b..6fef61b81d 100644 --- a/include/sundials/sundials_context.h +++ b/include/sundials/sundials_context.h @@ -40,5 +40,9 @@ SUNDIALS_EXPORT int SUNContext_Free(SUNContext* ctx); #ifdef __cplusplus } +/* We include this here for backwards compatibility + (the contents used to be defined here directly) */ +#include + #endif #endif From 522489314c27dc9dbbd7034ccc778dc20aafd998 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 14:49:18 -0800 Subject: [PATCH 22/24] dont fail fast --- .github/workflows/ubuntu-clang-latest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ubuntu-clang-latest.yml b/.github/workflows/ubuntu-clang-latest.yml index 6951249aa6..99321866df 100644 --- a/.github/workflows/ubuntu-clang-latest.yml +++ b/.github/workflows/ubuntu-clang-latest.yml @@ -18,6 +18,7 @@ jobs: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: # 2 is what all other builds use (its the default), so skip it here logging_level: [0, 1, 3, 4, 5] From 3d4661dba127ede5fc9b339d2041e40d0562c94a Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 16:01:07 -0800 Subject: [PATCH 23/24] fix logging statements in arkode_adapt broken in merge --- .github/workflows/double-precision.yml | 2 +- .github/workflows/extended-precision.yml | 2 +- .github/workflows/single-precision.yml | 2 +- .github/workflows/ubuntu-clang-latest.yml | 2 +- src/arkode/arkode_adapt.c | 18 ++++++------------ 5 files changed, 10 insertions(+), 16 deletions(-) diff --git a/.github/workflows/double-precision.yml b/.github/workflows/double-precision.yml index 7f49a290fa..6f43b2f2f2 100644 --- a/.github/workflows/double-precision.yml +++ b/.github/workflows/double-precision.yml @@ -1,5 +1,5 @@ # -name: Build and Test - Ubuntu/gcc double precision (TPLS, no GPUs) +name: Build and Test - Ubuntu/gcc double precision (TPLs, no GPUs) on: push: diff --git a/.github/workflows/extended-precision.yml b/.github/workflows/extended-precision.yml index af23133d87..dfb021dc66 100644 --- a/.github/workflows/extended-precision.yml +++ b/.github/workflows/extended-precision.yml @@ -1,5 +1,5 @@ # -name: Build and Test - Ubuntu/gcc extended precision (TPLS, no GPUs) +name: Build and Test - Ubuntu/gcc extended precision (TPLs, no GPUs) on: pull_request: diff --git a/.github/workflows/single-precision.yml b/.github/workflows/single-precision.yml index c61cb57007..a769b09729 100644 --- a/.github/workflows/single-precision.yml +++ b/.github/workflows/single-precision.yml @@ -1,5 +1,5 @@ # -name: Build and Test - Ubuntu/gcc single precision (TPLS, no GPUs) +name: Build and Test - Ubuntu/gcc single precision (TPLs, no GPUs) on: pull_request: diff --git a/.github/workflows/ubuntu-clang-latest.yml b/.github/workflows/ubuntu-clang-latest.yml index 99321866df..eb46e250d4 100644 --- a/.github/workflows/ubuntu-clang-latest.yml +++ b/.github/workflows/ubuntu-clang-latest.yml @@ -1,4 +1,4 @@ -name: Build - Ubuntu/Clang (no TPLS) +name: Build - Ubuntu/Clang (no TPLs) on: pull_request: diff --git a/src/arkode/arkode_adapt.c b/src/arkode/arkode_adapt.c index a7604fd69a..d18cdf5d5a 100644 --- a/src/arkode/arkode_adapt.c +++ b/src/arkode/arkode_adapt.c @@ -136,16 +136,10 @@ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, } if (h_cfl <= ZERO) h_cfl = RCONST(1.0e30) * SUNRabs(hcur); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::arkAdapt", "error-history", - "ecur = %"RSYM", ehist[0] = %"RSYM", ehist[0] = %"RSYM, - ecur, hadapt_mem->ehist[0], hadapt_mem->ehist[1]); - - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::arkAdapt", "step-history", - "hcur = %"RSYM", hhist[0] = %"RSYM", hhist[0] = %"RSYM, - hcur, hadapt_mem->hhist[0], hadapt_mem->hhist[1]); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, + "ARKODE::arkAdapt", "new-step-before-bounds", + "h_acc = %"RSYM", h_cfl = %"RSYM, h_acc, h_cfl); #endif /* enforce safety factors */ @@ -158,8 +152,8 @@ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, /* enforce minimum bound time step reduction */ h_acc = int_dir * SUNMAX(SUNRabs(h_acc), SUNRabs(hadapt_mem->etamin*hcur)); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, "ARKODE::arkAdapt", "new-step-after-max-min-bounds", "h_acc = %"RSYM", h_cfl = %"RSYM, h_acc, h_cfl); #endif From 40f5135cbef189cc14d703cd189a5b5262e1f59e Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 16:05:55 -0800 Subject: [PATCH 24/24] fix compiler warning --- src/arkode/arkode_ls.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/arkode/arkode_ls.c b/src/arkode/arkode_ls.c index 95d081ab15..bb88e24be2 100644 --- a/src/arkode/arkode_ls.c +++ b/src/arkode/arkode_ls.c @@ -3151,6 +3151,10 @@ int arkLsMassSolve(void *arkode_mem, N_Vector b, realtype nlscoef) "ARKODE::arkLsMassSolve", "mass-ls-stats", "resnorm = %"RSYM", ls_iters = %i, prec_solves = %i", resnorm, nli_inc, (int) (arkls_mem->nps - nps_inc)); +#else + /* Suppress warning about set but unused variables due to logging ifdef. */ + (void) nps_inc; + (void) resnorm; #endif /* Interpret solver return value */